WWVB timecode from blue pill

fredbox
Mon Mar 11, 2019 10:51 pm
The last couple of months I have worked on a circuit to use a blue pill to create a time signal to set my atomic clocks. Atomic clocks in the US are set from 60 khz time signal that is broadcast from Colorado on 60Khz. That signal is supposed to be fairly strong, but there is enough RF interference that the time signal is rarely received unless I take the clocks outside. My circuit has a short range and successfully set all four of my atomic clocks to Daylight Saving time yesterday. Source code is attached if anyone is interested. Readme.h within the zip file has brief instructions.

Core: fpiSTM official core v1.5.0
Boards: Blue Pill STM32F103 + DS3231 clock module (i tried using the internal RTC but was constantly resetting the time. The DS3231 module has been running for weeks since it was initially set and is still within a second of the actual time.)
Optional: Nokia PCD8544 display

The binary file is just over 40K with SerialUSB enabled. It is about 8K smaller with a USB/Serial dongle connected to UART 1.


ahull
Tue Mar 12, 2019 1:28 am
Neat, I was thinking of doing something like this, but you have saved me a lot of head scratching.

I had a quick look at readme.h

Could you not use a trimmer capacitor on the antenna to get it resonant at the correct frequency, rather than changing the number of coils?


fredbox
Tue Mar 12, 2019 4:26 am
The capacitor in parallel with my loopstick antenna is 4700pf. Most trimmer caps are < 100pf. The peak at resonance is fairly broad and not too critical.

I wrote a small program to sweep the frequency above and below 60Khz while watching a scope to note the resonant frequency. As long as you get it within a couple of kilohertz it will be close enough and there will be a nice sine wave across the antenna.


Riva
Tue Mar 12, 2019 8:49 am
Slightly off topic as the sketch was for an AVR but I made a similar thing for MSF timecode used in the UK. For the antenna I just used a length or wire attached to the output pin and draping it over the clock is enough to do the job.

sheepdoll
Tue Mar 12, 2019 8:12 pm
I have an really old WWVB receiver module, I was going to use on a 68HC11 to drive some slave clocks I have.

It sits in a box somewhere. As I recall it has a simple RS232 interface. It was from one of those hobby kits (like propeller or something)

The west coast reception of the signal is not the best. Especially that I live on the northwest side of a range of hills east of San Francisco. (anywhere else these would be called mountains.)

Somewhere I also have the ring charts from when I was collecting clocks. The slave clocks are from my high school (I knew I would be staring at that clock in my english class forever.) These are standard electric AR-3s They take a 24 volt pulse, I think it is one second every minute to advance the ratchet. If there is a power outage a 48V pulse (might be -48V) is sent which releases the counter weights and the hands fall to 6:00 or 6:30. They are then quickly ratcheted to the correct time. Sync pulses can also be sent at the sync hour which will reset the hands.

Somewhere I bought a FET from radio shack. The tricky part was how to release the stepped 48/24v pulses. In the master clocks this was done with cams and relays. I sold the master years ago when I moved. Still have the slave clocks. I rarely run them as they make a loud click every minute when the ratchet pawl is engaged.


zoomx
Wed Mar 13, 2019 8:11 am
I have some radio controlled clock working using DCF77 ( one of then is multistandard) that works at 77,5 kHz.

I too live a bit too far so some of them works perfectly, some others need to be in the north part of my house.


ahull
Thu Mar 14, 2019 4:58 pm
I recently acquired an MSF watch. Unsurprisingly it is pretty accurate. ;)

Image

One other project I had considered was converting a really cheap AM radio from fleabay to pick up the MSF signal on 60kHz, and then use the audio output from that to feed a micro-controller.


ag123
Thu Mar 14, 2019 7:55 pm
i got too curious after reading about these radio clocks synced to atomic clocks
as it turns out science and electronics advances has come so far today that it goes from this atomic clock
https://www.nist.gov/news-events/news/2 … -stability
Image

to this atomic clock
https://ieee-uffc.org/download/principl … ic-clocks/
https://www.microsemi.com/document-port … user-guide
https://www.digikey.com/catalog/en/part … -kit/81778
https://www.microsemi.com/product-direc … clock-csac

atomic clocks you can buy

would anyone want to run your blue pill RTC to
1 in 9,192,631,770 accuracy / precision ?
https://en.wikipedia.org/wiki/Caesium_standard

:lol:


ag123
Thu Mar 14, 2019 8:25 pm
the chip scale atomic clock evaluation kit is kind of expensive $928.75
https://www.digikey.com/products/en?mpa … 000&v=1522
an irony is that it actually cost less than those luxury mechanical watches
:lol:

mrburnette
Thu Mar 14, 2019 10:58 pm
Image

GPS —> ESP8266 –> UDP

Image
https://www.hackster.io/rayburne/tardis … server-gps


ag123
Fri Mar 15, 2019 5:30 am
cool project from ray :D

BennehBoy
Fri Mar 15, 2019 7:36 am
The village where I live has one of the few remaining police boxes in the UK.

https://www.bbc.co.uk/news/uk-england-leeds-40960459


zoomx
Fri Mar 15, 2019 7:57 am
[ahull – Thu Mar 14, 2019 4:58 pm] –
One other project I had considered was converting a really cheap AM radio from fleabay to pick up the MSF signal on 60kHz, and then use the audio output from that to feed a micro-controller.

MSF, DCF77 and a lot of others radio stations (mostly european radios, I believe) can be heard here
http://websdr.ewi.utwente.nl:8901/
It is n online SDR radio that you can tune.


ag123
Fri Mar 15, 2019 8:16 am
as the asian govts don’t really believe in time signal stations, i’d either need to use the noisy short wave radios or gps to get ‘NIST atomic’ accuracy, so most of the time i made do and simply sync my pc to NTP and then try to sync my bp/mm rtc to my pc once in a while. unfortunately my cheap 32k crystals drifts like an old inaccurate clock then i go about doing all that drift adjustments

oh and about that chip scale atomic clock
https://en.wikipedia.org/wiki/Chip-scale_atomic_clock
i’d think there is a chance it become more popular and that prices start to come down with mass production and new competition
so in future you may be able to run an atomic clock on the bp/mm

and who knows if your next high end iphone may just offer that
https://www.edn.com/electronics-news/41 … at-mobiles
:lol:


ted
Fri Mar 15, 2019 1:51 pm
Image

Satellite dish and police box


BennehBoy
Fri Mar 15, 2019 2:11 pm
The dish is gone, that pub has now shut down – which is no bad thing since the clientele were a bit rough.

ted
Fri Mar 15, 2019 4:29 pm
History is more important, don’t touch the box.

sheepdoll
Fri Mar 15, 2019 6:53 pm
When I was more active collecting clocks in the 1990s, One of the members had a portable HP atomic clock. It was the size of a small suitcase. I think it was cesium based. What was interesting is that the actual timekeeping was done with a quartz crystal in a temperature controlled ‘oven’ The cesium fountain was used to keep things in sync ( think by measuring the radioactive decay.)

This clock was a bit obsolete at the time as precise timekeeping was being done with Hydrogen mazer. Cell towers also have highly accurate clocks, and precise locations, which are checked against the GPS satellites. I think it you can triangulate three towers you can find your exact location without seeing the birds. Getting the time from one of the birds needs relativistic corrections. Turns out that nothing is absolute and gravity does not exist as it is a dimensional illusion, like the other directions. It does not help that the past is infinitely slow, and the future infinitely fast. Finite infinities are so fun to play with. You can however find your land location precisely with a pendulum to measure the local gravitational constant, which will tell you the local time.

Ironically Nostradamus did his scrying with a pendulum on a tripod over a bowl of water acting as a mirror. I think Gravity is what separates the theories between Hawking and Kip Thorn. Personally I like the illusion of free will. It is weird to think that what I will write in the later part of this post already exist before I write it. Not that the paragraphs are written in order. ( tend to revise on the re-read before hitting send.)

The trick, with precise timekeeping is keeping the crystal at a common temperature. Why common quarts wristwatches are better timekeepers than the best mechanical chronometers. Even so If one was navigating with either one, it is best to keep a temperature log. Not to mention rate charts. The best watch/clock makers were metallurgists, who could measure the shape of the alloy over time and temprature and formulate the best solutions.

Ironically my mentor, said that in the 1940s and 1950s some of the best mechanical watches were made. That we know the 16th to 18th century alloys will be stable for about 500 years. That the post war alloys might be stable for a 1000 years or more. I forget how old the gears in the Prague clock (which I have seen in person.) they are 100s of years old, I think dating back to the 12th century when tower clocks were the tech like computers are now. Every city had one, and it went exponential in the 18th and 19th century when ever person had a watch or a clock. By the 20th century they were small and strong enough to strap to the wrist. (although queen Elizabeth the First had a bracelet with a watch in it.)

I always found it interesting that time is the easiest to measure but hardest to define. Temperature is easy to define but hard to measure. When I was writing the color test suite for Apple laser printers, I learned that color and temperature are the same thing. Now if someone could relate temperature to time …


BennehBoy
Fri Mar 15, 2019 7:06 pm
…they would require the Tardis above :lol: :lol:

Riva
Sat Mar 16, 2019 9:42 am
You could paint an analogue clock face with different colours for the numbers and then express the time as something like ‘It’s Teal minutes past mauve’ or ‘orange minutes past green’ :lol:
Sounding a bit sexist but this idea would not work well for me (and most men) as I don’t think I have 12+ colours in my vocabulary where I find my wife (and most women) have a larger colour word range.

Leave a Reply

Your email address will not be published. Required fields are marked *