Shop OBEX P1 Docs P2 Docs Learn Events
How best to receive local time data? — Parallax Forums

How best to receive local time data?

Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
edited 2016-12-01 04:35 in General Discussion
I'm building an electronic clock. It needs to be able to set itself to local time automatically indoors (residential). I'm considering the following options for obtaining local time:

1. Parallax PAM-Q7 GPS module. Will it operate indoors to receive time only, but with enough precision to know what time zone it's in? Receive sensitivity is -161dBm.

2. U-Blox CAM-M8Q GNSS module (successor to PAM-Q7?). Same question as above. Receive sensitivity is better at -167dBm. Board is more of a challenge to connect to (a disadvantage), but it's really tiny (an advantage).

3. Adafruit Ultimate GPS. Same question as above. Receive sensitivity is -165dBm. Includes a battery-backable RTC (nice!).

4. Parallax Wi-Fi module. Clock will most likely be in Wi-Fi range. It could access my own time server website. It would have to be programmed to access user's Wi-Fi network (a disadvantage).

5. WWVB NIST radio time receiver. Never could get one of these to work. Pacific NW is in a fringe area.

6. Subcarrier FM radio receiver. Don't know enough about what's available locally or how big an antenna it would require. Parallax doesn't seem to be carrying their FM radio module any longer. And I don't know if it was capable of subcarrier demodulation.

Which would you choose? Any other ideas?

Thanks,
-Phil
«1

Comments

  • kwinnkwinn Posts: 8,697
    GPS is good if you can get good reception indoors, otherwise a Propeller with a supercap or battery backed RTC works well.
  • Phil

    I am not sure, but perhaps this article will catch your interest. It pertains to an RDS decoder.

    mictronics.de/projects/rds-decoder/
  • In fact, if you search "RDS decoder" in google images, I am certain you could something useful
  • It now appears that you need an FM stereo to start with. Sorry my bad.
  • Mobile cellphone ?

    Most carrier sent a time info ....


  • Okay Phil, I must admit that your post caught my interest, so I have been doing a bit of research.

    Let me first say that I am truly unsure of the feasibility.... or the availability of these ICs

    Look into the TEA5767 IC... The TEA5767/68 is a single chip stereo FM receiver... It appears that a module can be picked up on ebay $0.99

    The TEA5767 can be paired with the SAA6588 IC... The SAA6588 is an RDS decoder

    http://www.ebay.com/itm/like/191975745742?lpid=82&chn=ps&ul_noapp=true
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2016-12-01 16:14
    I am personally using a GPS module for time in an application. Every minute it updates a BBRTC and switches automatically to the RTC if the signal lock is lost on the GPS. I have manually set the time zone, however I did experiment with some code to set the time zone based on the longitude, but the fact that there are areas that don't observe DST makes it a bit more of a challenge. I've chosen to add a feature to select the Time Zone and DST settings by menu. I used to have an application that automatically switched between DST modes based on date, however at some point those dates were changed and I never updated that project (deprecated).
  • I recently used the "RRD-102 V2" module in an FM radio project. It is based on the RDA5807M IC, which supports RDS/RBDS. The Parallax FM module used RDA5807SS, which lacks the RDS feature. While I have not used the RDS functions (yet), there are several resources on-line showing how to do so.

    The module can seek valid FM signals, so it should be adaptable if it is moved around. When I was testing, I had surprisingly decent reception using only a small jumper wire as a makeshift antenna.

    I would be more than happy to share resources, if it might be helpful. I can spare a populated module (OSH Park project linked here), design files (DipTrace), data sheets, a few pages of notes, and my work-in-progress PropBASIC code to facilitate.
  • The problem I see with using a GPS module is figuring out what time zone you are in. Getting from lat/long to time zone would be no mean feat, even if you limited it to continental USA. You certainly cannot just go by longitude (see any time zone map).

    Of course, if you are allowed to tell it what zone it is in, then it is dead easy.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    It wasn't until I moved from NY to CA that I even thought about time zone. Up to that point I was happy to hard-code the offset. Still, I don't see myself moving outside of the US anytime soon, so manual works for me.
  • kwinnkwinn Posts: 8,697
    The problem I see with using a GPS module is figuring out what time zone you are in. Getting from lat/long to time zone would be no mean feat, even if you limited it to continental USA. You certainly cannot just go by longitude (see any time zone map).

    Of course, if you are allowed to tell it what zone it is in, then it is dead easy.

    Dead easy is having the time difference between UTC and local time stored as an hhmm signed variable. That even works for places like Newfoundland which is UTC - 3:30.
  • ercoerco Posts: 20,256
    edited 2016-12-01 18:20
    Great question, PhiPi. Some things like a self-setting clock seem so simple when they come free in phones, tablets and even appliances (IoT) but building them into freestanding projects can be complicated. Makes me appreciate the little $10 "atomic" clocks which sync to satellites occasionally: http://www.ebay.com/itm/WT-2171U-BZ-La-Crosse-Technology-Atomic-Digital-Travel-Alarm-Clock-Bronze-/271684214775 Runs forever (?) on a single AA battery. How dey do dat?

    Older AC analog clocks with synchronous 60 hz motors worked perfectly until the power went out (even then they were useful for showing when the outage happened!). Nothing wrong with old tech, like the home appliances you mentioned in another thread, PhiPi. I bought a small electric space heater the other day. Nice little unit, just $9.97 at Walmart. Ouch, full retail, but still, how can they possibly do that? Purely WW2-era electromechanical tech. AC motor, fan/heater switch, tipover switch on the bottom, electric heating element, adjustable mechanical thermostat and an NE-2 neon bulb. No WiFi, no IoT, no IR remote, no timer, nothing solid state. No post-1940's tech to be found. Yet we survive. It works great and it may outlast me.



  • kwinn wrote: »
    Dead easy is having the time difference between UTC and local time stored as an hhmm signed variable. That even works for places like Newfoundland which is UTC - 3:30.



    Never knew anyone was on a half-hour time difference, I guess they couldn't figure out what time zone they wanted to belong to.

    erco wrote: »
    Makes me appreciate the little $10 "atomic" clocks which sync to satellites occasionally:




    I live farther from Boulder, Colorado than you do. But I have one clock that when it set's itself, it can go from perfect time to something way off. You never know when to trust it, or catch yourself looking at it first, then checking it with another clock. That is a waste of time.
  • Heater.Heater. Posts: 21,230
    I have been wondering about this. Recently I bought an egg timer for a couple euros. It's a beautiful thing in the shape of an egg. Twist it's top half around and it will time anything from a minute or so to 20 minutes. When the time expires it rings a bell. All good old fashioned clockwork and springs. No micros, no batteries required.

    I was wondering how on earth one would make that using electronics. It would have to harvest power from the winding up action. It would be horrible complicated.

  • kwinnkwinn Posts: 8,697
    MikeDYur wrote: »
    kwinn wrote: »
    Dead easy is having the time difference between UTC and local time stored as an hhmm signed variable. That even works for places like Newfoundland which is UTC - 3:30.

    Never knew anyone was on a half-hour time difference, I guess they couldn't figure out what time zone they wanted to belong to.

    Newfoundland is an island just off our east coast so I think the half hour thing is a bit of a compromise between being in the Atlantic time zone (-4h) with the neighboring provinces and the daylight period.
  • yetiyeti Posts: 818
    edited 2016-12-01 20:04
    MikeDYur wrote: »
    Never knew anyone was on a half-hour time difference, I guess they couldn't figure out what time zone they wanted to belong to.

    https://www.timeanddate.com/worldclock/iran/tehran
    https://www.timeanddate.com/worldclock/afghanistan/kabul

    For Iran I heared that they are offset by half an hour because then the whole Iran fits in that one timezone instead of being split in 2 halves when using the common hour steps.

    Afghanistan has a similar width, so maybe the same motivation is the reason of their timezone offset.

    There probably are more timezones with sub hour offeset... but those were the two I remembered without asking wikipeter...
    Edit: ...and I'm round about 41.34 minutes east of Greenwich... I'll definitely take this into account when building my next clock and will add a that as one of the timezones. Probably a GPS will be my timebase, so I get that degrees information and the time wherever that clock will be... \o/ ...TLT (true local time)?
  • kwinnkwinn Posts: 8,697
    Heater. wrote: »
    I have been wondering about this. Recently I bought an egg timer for a couple euros. It's a beautiful thing in the shape of an egg. Twist it's top half around and it will time anything from a minute or so to 20 minutes. When the time expires it rings a bell. All good old fashioned clockwork and springs. No micros, no batteries required.

    I was wondering how on earth one would make that using electronics. It would have to harvest power from the winding up action. It would be horrible complicated.

    There are times when old tech works better than new tech.
  • ercoerco Posts: 20,256
    Cheap modern wind-up (more precisely generator/charge-up) flashlights are marvelously inefficient and make me appreciate a simple battery-powered LED flashlight. My friend is a collector/hoarder of old AC motors and old military spring wind-up incandescent flashlights. These are rare and ridiculously expensive, as are the incandescent bulbs they use. I can't even find one on Ebay or Google right now, so my friend may have cornered the market.
  • Heater.Heater. Posts: 21,230
    Hmm...wind up flashlights are a bit of a different case. For sure if you want lot's of light you need lots of energy. The LED helps greatly here of course.

  • Thanks for the time zone enlightenment, kwinn and yeti.

    kwinn wrote: »
    There are times when old tech works better than new tech.


    I have to give credit to RS and new tech, this has won my wife quite a few online auctions.
    2656 x 1494 - 520K
  • ercoerco Posts: 20,256
    MikeDYur wrote: »

    I have to give credit to RS and new tech, this has won my wife quite a few online auctions.


    Do tell. How so?
  • jmgjmg Posts: 15,173
    I'm building an electronic clock. It needs to be able to set itself to local time automatically indoors (residential). I'm considering the following options for obtaining local time:

    1. Parallax PAM-Q7 GPS module. Will it operate indoors to receive time only, but with enough precision to know what time zone it's in? Receive sensitivity is -161dBm.

    2. U-Blox CAM-M8Q GNSS module (successor to PAM-Q7?). Same question as above. Receive sensitivity is better at -167dBm. Board is more of a challenge to connect to (a disadvantage), but it's really tiny (an advantage).

    3. Adafruit Ultimate GPS. Same question as above. Receive sensitivity is -165dBm. Includes a battery-backable RTC (nice!).
    ...

    Which would you choose? Any other ideas?

    How 'indoors residential' is this, and is it one off, or a consumer item ?

    I'd favour the GPS ones, and I'd test all the candidates, as the relative specs could mean very little.
    Those dBm numbers seem to be when locked, not seeking lock, and probably exclude the antenna

    Does the model with a RTC use TCXO calibrate when out of lock ?

    If power is less an issue, you could add a VCTCXO to the system, and lock that to the GPS, which gives much greater drop out tolerance.

    Once you start doing Global+DST, things escalate, but this resource looks useful
    https://www.iana.org/time-zones/repository/tz-link.html
    and this shows what you need to deal with...
    https://www.timeanddate.com/time/dst/2016.html

    A compact MCU solution to that mess, could be to generate a (say) 1000 x 1000 x 2 byte array, and just index from the GPS location - large serial flash is quite cheap.


    Or maybe, you look at the $$ that was going into the GPS module, instead going into better local timing.
    Working on one-column banner values from Digikey

    At one extreme I notice for just $1100, you can get 50ppt atomic timing, that needs 5V/2.8A, 51mmx51mm

    More modest,
    $12.40 can get you 100ppb, or
    $28.88 for 50ppb,
    $40 for 25ppb,
    $41 for 20ppb,
    $55 for 10ppb
    $77 for 5ppb
    $84 for 3ppb
    $119 for 1.5ppb

    You do need to watch the aging specs, which on some, are not great.

    Another approach is to use the GPS volumes, and target TCXO's used in GPS, and a part like
    TG2016SBN 16.0000M-TCGNBM0 gives 500ppb, at 1.4mA and 64c/1k so you can use 3 or more to get some aging coverage.
  • erco wrote: »
    Do tell. How so?

    Bidding at the last second, the clocks time co-insides with the administrators network time. and wha-la.. ._you won.

    I wish I could could hit the mother load with it., or with anything. ;)
  • jmgjmg Posts: 15,173
    MikeDYur wrote: »
    Bidding at the last second, the clocks time co-insides with the administrators network time. and wha-la.. ._you won.
    I thought most Auction sites now use auto-extend, which adds a small time after the most recent bid ?

  • jmgjmg Posts: 15,173
    Heater. wrote: »
    I have been wondering about this. Recently I bought an egg timer for a couple euros. It's a beautiful thing in the shape of an egg. Twist it's top half around and it will time anything from a minute or so to 20 minutes. When the time expires it rings a bell. All good old fashioned clockwork and springs. No micros, no batteries required.

    I was wondering how on earth one would make that using electronics. It would have to harvest power from the winding up action. It would be horrible complicated.

    Not sure about 'horrible complicated' ? - a Stepper Motor would be the logical generator, very wide range to choose from, and you have natural quadrature action for the post-wind(charge) precise time set.
    It would need some means to show the set-time & down counting.

    Either a LCD display, or could LEDs be low enough power ?

    I guess LEDs are the closest in form and function ? or is there a radial-LCD out there somewhere?

  • jmg wrote: »

    I thought most Auction sites now use auto-extend, which adds a small time after the most recent bid ?



    Don't ask me, my wife and facebook have a system.
  • A couple of the GPS modules that I've looked at have built-in RTCs running on a 32kHz crystal with battery backup. What's not clear from the datasheets is whether the RTC data is available in an NMEA sentence absent a GPS fix. It could be that the RTC is there only to speed startup from ephemeris data stored in RAM. IOW, if you have the ephemeris data and know what time it is, you know which satellites will be in view. Beyond that, though ... ?

    -Phil
  • kwinnkwinn Posts: 8,697
    yeti wrote: »

    Edit: ...and I'm round about 41.34 minutes east of Greenwich... I'll definitely take this into account when building my next clock and will add a that as one of the timezones. Probably a GPS will be my timebase, so I get that degrees information and the time wherever that clock will be... \o/ ...TLT (true local time)?

    So you're turning back the clock to a time when every town/city set their clocks to the local time based on the sun?
  • jmgjmg Posts: 15,173
    ... It could be that the RTC is there only to speed startup from ephemeris data stored in RAM. IOW, if you have the ephemeris data and know what time it is, you know which satellites will be in view. Beyond that, though ... ?
    The Adafruit info suggests it is there for faster locking, and not much else.
    I wonder would the RTC info be enough to allow better sensitivity too ?

  • I have been looking into this as I will probably eventually add auto-setting to my Propeller powered Nixie clock.

    http://localroger.com/nixie/nixie.html

    At this point I believe by far the cheapest and most reliable solution, since I have a wifi connection, will be an ESP8266 ESP-01 module which you can get from $3 to $7 depending on quality level and source, querying a NTP server and shipping the time to the Propeller over a serial link. For the ESP8266 software I'd go with NodeMCU to run Lua and something like this:

    https://github.com/kubi57/ESP8266/blob/master/pong-clock/ntp.lua

    As pointed out upthread WWVB, the method used by those "atomic" clocks, can be annoyingly iffy especially if you're too far from Boulder; it generally works only at night and can be shut down by interference from other nearby computer equipment, a hard thing to debug when it only works at night in the first place. GPS should be pretty reliable if you can get signal; this can be checked with a handheld receiver before committing, but the modules are far more expensive than an ESP01.
Sign In or Register to comment.