Raspberry Pi and a real time clock



One of the problems with using the Raspberry Pi with WiFi using an access point, as I am doing with my weather balloon project, is that without Internet access the Raspberry Pi has no clock. The answer is to use a real time clock and there is an excellent one designed to plug straight onto the GPIO pins. The same device is available from a number of sources on eBay and prices range from about £1.50 post paid from China, to about £7 in the UK. I managed to find a UK source that was selling them at less than £4 post paid.

The device itself is tiny, on the underside is a backup cell and the RTC is mounted on the top. This RTC is an upgrade on the usual DS1307. The DS3231 has improved temperature stability and will operate at both 3 volts and 5 volts. It can be used on either the Raspberry Pi or the Arduino. DS1307 libraries can be used with no problems.

Setting up the Raspberry Pi took some time and was a little complicated, I found the best source was  here at the Pi Hut. I found it easier to follow than the Adafruit tutorial, although you need to follow the Adafruit tutorial on setting up i2c on the Raspberry Pi. It took me about half an hour to set everything up, and now I will be able to time stamp images from my weather balloon project.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s