Shop OBEX P1 Docs P2 Docs Learn Events
Other options for time — Parallax Forums

Other options for time

BenjBenj Posts: 66
edited 2008-10-31 23:47 in Propeller 1
I have used a DS1307 for keeping track of date and time, but have found that even the SparkFun RTC that uses a 1307 is not very accurate over time. The best I have been able to accomplish is losing about 10 seconds per day. I would like to build a clock but need it to maintain fairly accurate time (so I don't have to reset the thing every few days / weeks). Are there any other options I should be looking at? Can the prop keep accurate time by using cnt, or will I run into the same problems? I have also seen the PropNIC product by uconnect and though that maybe I could use it to connect to a network time server to get the time and periodically update the DS1307 or prop, but don't know where to begin. Anyone have any ideas or places to start looking?

Comments

  • Ken PetersonKen Peterson Posts: 806
    edited 2008-10-30 15:09
    You can use a WWV receiver. It receives the broadcast time codes from Colorado.

    en.wikipedia.org/wiki/WWV_(radio_station)

    http://www.ntp-time-server.com/wwvb-receiver/wwvb-receiver.htm

    If you use cnt for your time base, you're only as accurate as your crystal.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"I have always wished that my computer would be as easy to use as my telephone.· My wish has come true.· I no longer know how to use my telephone."

    - Bjarne Stroustrup

    Post Edited (Ken Peterson) : 10/30/2008 3:25:00 PM GMT
  • JonathanJonathan Posts: 1,023
    edited 2008-10-30 15:16
    Another option is to get the time from a GPS. I bought a Motorola Oncore cheap on epay, and I transmit the time locally via RF for all my projects. This provides a spot on, always right, self setting and self adjusting for DST timebase.

    I've used WWVB, but I could only synch at night and not at all during periods of bad weather.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • BenjBenj Posts: 66
    edited 2008-10-30 15:23
    Thank you for both answers, but my project will be located in a basement where WWV and GPS reception is not available, but I do have internet via ethernet.
  • BenjBenj Posts: 66
    edited 2008-10-30 15:31
    Now that I look at the Motorola Oncore, it might be useful for another project. Do you have any info on how you connected it to your prop and the code to get the time?
  • RaymanRayman Posts: 14,243
    edited 2008-10-30 15:32
    Getting the time over the LAN via a time server might be a good approach then...

    I don't see how the DS1307 is losing 10 seconds per day unless the crystal is really, really bad...

    There's a version of the DS1307 that has an integrated crystal that is much more precise.· But, it doesn't come in a DIP package...
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-10-30 15:50
    One thing I have noticed with both the DS1302 and the DS1307 is that when running off the backup battery they tend to gain time. I have seen this on the order of a couple of minutes over an hour. My test clock running at home now is off by almost 15 minutes (fast) due to a few power outages. In any event I am going to be trying the DS3234. This RTC has a higher accuracy using a built-in crystal. As with the one Rayman mentions this one is not available in a DIP package either, but SIOC can be hand-soldered pretty easily.

    http://www.maxim-ic.com/quick_view2.cfm/qv_pk/4051

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • DarrenYDarrenY Posts: 61
    edited 2008-10-30 16:40
    If you need an I2C clock, try the DS3231, accurate to within +/- 2 minutes per year (so they say!)

    www.maxim-ic.com/quick_view2.cfm/qv_pk/4627

    LIVE DEMO can be seen here:
    www.maxim-ic.com/landing.cfm?lp=26
  • JonathanJonathan Posts: 1,023
    edited 2008-10-30 16:47
    Benji,

    Sure, I have code for the Oncore, plus a DST correction calc. I'm not at home for a few days, but you can remind me at jpeakall AT madlabs DOT info. You can also get an external antenna with enough lead to get you a signal, I'm sure. The other thing that is nice about the Oncore is it has a built in RTC for periods of non reception, and it has a 'keep alive" power input that you can hook a super cap too and keep the time during power outage etc. It also has an accurate 1pps output too.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • BenjBenj Posts: 66
    edited 2008-10-30 18:45
    Jonathan,

    I see a few of the Oncores listed on ebay and they don't seem to come with an external antenna. Do you use one and are they required for a non-basement setup?
  • JonathanJonathan Posts: 1,023
    edited 2008-10-30 19:28
    You need an external antenna, and I found one on epay too. They don't need a great view to sync up often enough to keep the time accurate.

    If you see a GT or UT get those. How finicky are your timing needs? One day I am going to change to a UT when I see one cheap. They can have the 1pps adjusted to account for transmission delay errors etc. The only reason I care is I am slowly building a seismicmonitor, and being as closely synched time wise as possible increases the accuracy of origin triangulation and such. For most purposes, any GPS is fine.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • BenjBenj Posts: 66
    edited 2008-10-30 19:58
    I just need to not have to reset the time over weeks, months, years, etc manually. If the DS1307, etc can't keep rock solid time, I need something like this to keep it on point. I don't need accuracy to within ms, but at 8PM I don't want it reading 7:45. I guess accurate to within a few seconds is what I want.

    For the antenna, did you buy the Motorola active antenna, like this:

    http://www.tedss.com/stock/images/1994/1994000169.jpg

    or something less expensive? This antenna is more expensive than the GT module.
  • JonathanJonathan Posts: 1,023
    edited 2008-10-30 20:21
    It looked similar. IRRC, I paid about US$15 for the antenna and about US$20-25 for the GPS. Since I transmit the time locally and all of my projects (garden timers, clocks, solar energy system, weather station data logger) all use the same time base, it was a cheap solution for me. And it sets the time and DST automatically, so I don't even need buttons to set time/date.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • BenjBenj Posts: 66
    edited 2008-10-30 20:25
    What do you use for hardware to transmit and receive locally?
  • StefanL38StefanL38 Posts: 2,292
    edited 2008-10-30 21:34
    another idea is to watch the time-error over some days and calculate a correction-factor that is applied in every day or every 3 hours or whatever you like

    best regards

    Stefan
  • CarlosFandangoCarlosFandango Posts: 67
    edited 2008-10-31 23:47
    You could try this (see attached datasheet). I'm using this in a current design - it has a register which allows the timekeeping to be adjusted. The backup current is 0.6uA, which means a lithium battery has the potential to keep it running for 20 years...
Sign In or Register to comment.