Comparison of four real-time clocks
Suggestions for Further Work
A very interesting test would be to change the temperature dramatically during the test (by putting it in the freezer or running a hairdryer over the board) and see how temperature affects the accuracy. Because the DS3231 is temperature compensated, the results would be very insightful.
Next Time
In the next column, I will implement a circuit and PCB board for a watchdog timer, which is used to reboot a computer (e.g., an Arduino or Raspberry Pi) if the computer stops functioning because of a software problem or a power glitch. It makes your system much more reliable and resistant to coding errors (yes, I build software with bugs – sometimes fatal) and problems with the power supply. This board is going on Project Curacao [10] in October 2014 to improve its reliability.
QuestionS
Question: In your last column, you talked about how 5V outputs can damage Raspberry Pi GPIO inputs. Why is this?
Answer: The Raspberry PI has protection diodes between the pin and 3.3V and ground. Positive voltages greater than 3V3+one "diode drop" (normally 0.5V) will be shorted to 5V; this means that if you put a 5V power supply on the GPIO pin, you will "feed" the 3V3 supply with 4.5V (= 5V – [the diode drop of 0.5V]), and that may damage 3V3 logic.
I have blown out pins on my Raspberry Pi doing just this. Other people have turned the Pi into a brick. Only use 3.3V outputs connected to your Raspberry Pi GPIO pins without putting a voltage level converter between the devices. Note that you can drive most 5V device inputs with the Raspberry Pi 3.3V GPIO outputs. Most devices will read 3.3V inputs as a logic 1.
If you have a suggestion for a column, please send email to raspigeek@switchdoc.com. If you have specific questions, please post on the SwitchDoc blog [11], so everybody can learn from your question. I'll be picking the best question and answering it in the next SwitchDoc Labs column.
Infos
- RTCEval.py software: http://github.com/switchdoclabs/RTCEval
- Graphing tutorial: http://www.switchdoc.com/2014/09/graphs-raspberry-pi-raspiconnect/
- Graph example: http://www.switchdoc.com/2014/01/matplotlib-raspberry-pi-mysql-and-project-curacao/
- RasPiConnect: http://www.milocreek.com
- RTC test code and MatPlotLib code: http://github.com/switchdoclabs/RTCTest
- Rasp Pi Python library for DS1307: http://www.switchdoc.com/2014/07/python-driver-ds1307-real-time-clock/
- Rasp Pi Python library for the MCP79400: http://www.switchdoc.com/2014/07/raspberry-pi-python-library-mcp79400-real-time-clock/
- Rasp Pi Python library for the DS3231: http://www.switchdoc.com/2014/08/raspberry-pi-python-library-ds3231/
- Rasp Pi Python library for the PCF8563: http://www.switchdoc.com/2014/08/raspberry-pi-python-library-pcf8563/
- Project Curacao: http://www.switchdoc.com/project-curacao-introduction-part-1/
- SwitchDoc blog: http://www.switchdoc.com
Buy this article as PDF
Pages: 6
(incl. VAT)