Real Time Clock [RTC]

PROBLEM

The Raspberry Pi has an intelligent way of managing what time the clock is. While there is no battery on the device it is not able to count hours, minutes and seconds, this is instead done by a connection to the internet through a known domain, which makes it able to update the internal clock while booting. The problem arises when the Raspberry is abruptly is  shut down. DIY users has blogged about this problem at several forums and noted that this function is not yet working as intended.

I our case this will cause that data will be transmitted with a false time tag causing the reading in Emoncms being unreadable. In worst case the raspberry pi will not even be able to receive data from the sensors [JeeNode] in the cold room storages. On the same time the reading made by the JeeNodes sensors in the cold room locker is as well transmitted with none time tag, because the sensors is only turned on while transmitting, which is for less than a second every to minutes

SOLUTION

Skærmbillede 2013-03-28 kl. 15.23.24

The easy solution is to ad a physical time circuit to the system called a Real Time Clock. This circuit consist of only a few resistors, a microprocessor unit and a 32.768kHz Crystal Connection. The entire circuit can be bought both pre assembled or as parts.

We made the assembly on our own with attention to the following tutorial

learn.adafruit.com/adding-a-real-time-clock-to-raspberry-pi

This will guide you through the entire process and take no more than 30 minutes if you do not hit any unforeseen circumstances.
We did not manage to do it in 30 minutes while a firewall did some strange things to the RTC hardware module. Nevertheless it is working very well in the actual prototype. Nice to know is that it updates the time and date whenever the raspi get an internet connection, like in our case where it is designed and built in Denmark and shipped to Ethiopia, it will adjust the time in the hardware RTC module when time zone is changed.

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