Adding clock module onto RPi


7 posts
by Narf03 » Mon Jun 18, 2012 4:03 pm
I want to know who did that already, I need a clock module in RPi cause the app that I need to run in RPi is very time sensitive, losing time is not an option.

Want to know how it can be done, how to do and how much it will cost me, thanks.
Posts: 221
Joined: Mon Jun 11, 2012 3:44 pm
by jecxjo » Mon Jun 18, 2012 4:25 pm
You could buy an I2C based RTC part like this http://www.gravitech.us/i2crecl.html and install it to an expansion board. At that point you'd have to configure the Kernel to use this as a HW RTC source or just create an init script that reads on startup and writes on shutdown.
IRC (w/ SSL Support): jecxjo.mdns.org
Blog: http://jecxjo.motd.org/code
ProjectEuler Friend: 79556084281370_44d12dd95e92b1d9453aba2bdc94101b
User avatar
Posts: 157
Joined: Sat May 19, 2012 5:22 pm
Location: Ames, IA (USA)
by Gert van Loo » Mon Jun 18, 2012 6:55 pm
Narf03 wrote:I want to know who did that already, I need a clock module in RPi cause the app that I need to run in RPi is very time sensitive, losing time is not an option.

Want to know how it can be done, how to do and how much it will cost me, thanks.


"very time sensitive" is rather vague. What kind of precision are you looking for and at which time scale.
0.1 Seconds per 24 hours or micro seconds per minute?
User avatar
Moderator
Moderator
Posts: 1843
Joined: Tue Aug 02, 2011 7:27 am
by Narf03 » Tue Jun 19, 2012 3:27 am
ok, my "very time sensitive" means, it needs to have the correct time, mostly scheduling, time need not to be very accurate, but should not be too far away(+-10mins) from the real/correct time.
Posts: 221
Joined: Mon Jun 11, 2012 3:44 pm
by jbeale » Tue Jun 19, 2012 5:44 am
If you have any kind of network connection, you should easily be able to get time accurate to 1 second. Any type of stand-alone clock will eventually gain or loose minutes over a long period of time, unless corrected by reference to a standard clock. But if you just need +/- 10 minutes per month, for example, a chip like the Maxim DS1307 RTC should do it. I have several of the DS1307 chips and they drift by about 2 minutes in a month, so you'd need to set it about twice a year to ensure < 10 minute error. If you need to do better, consider the Maxim DS3231 which is specified at +/-2 ppm over 0-40 C, that is about 1 minute per year.
User avatar
Posts: 1886
Joined: Tue Nov 22, 2011 11:51 pm
by jamesh » Tue Jun 19, 2012 8:25 am
Narf03 wrote:ok, my "very time sensitive" means, it needs to have the correct time, mostly scheduling, time need not to be very accurate, but should not be too far away(+-10mins) from the real/correct time.


When I read time sensitive, I was thinking nano seconds! You could use a GPS dongle if you have GPS reception. That gives very accurate timing. Check out other threads on GPS.
Moderator
Moderator
Posts: 10568
Joined: Sat Jul 30, 2011 7:41 pm
by jasonclark » Tue Jun 19, 2012 1:37 pm
If your device will be on the internet, use a network time server, this should be fairly simple to set-up and will provide the cheapest and least complex (ie no hardware or special software) solution.

If this is not possible, one of the SPI or I2C RTC IC's will do the job, the ones already mentioned are fine.
I've previously used one with a very stable clock source (on a -40C to +85C product), I'm not sure how you would interface this to Linux (newb here on Linux), but it is possible from reading the other helpful posts.
User avatar
Posts: 42
Joined: Sun May 13, 2012 3:51 pm
Location: Hertfordshire, UK