MSF Clock Synchronisation for Microcontrollers

I have been far too busy recently with real work to be able to dabble in any hardware design but there has been a project that has been nagging away at the back of my brain for many decades and I thought it about time I started thinking about getting it done. I’ll leave the details of the project itself unsaid for the interim but one component I knew was essential was an accurate time source as the project would not work well if its view of time drifted from official time (OK, it’s a type of clock!)

There are many ways of finding the time with GPS (see my previous dabblings with VP Oncore timing and NTP), NTP to the internet etc all being possibilities but in environments which have no good line of sight to the sky and where network connectivity isn’t immediately available an old fashioned way is to use the long wave time signal from Rugby. In the decades since I first had an interest in this signal it has now moved home from Rugby to Cumbria but the principle remains the same and is described at http://en.wikipedia.org/wiki/Time_from_NPL.

Receiving the signal requires a 60kHz receiver of some kind and the SYMTRIK module sold by PV electronics and described at http://www.pvelectronics.co.uk/rftime/SYM-RFT-XX.pdf is a good starting point and is reasonably priced (although if you have a spare radio clock lying around you could probably just hack that). The signal itself is Carrier Wave (CW) with either 60kHz present or absent indicating a zero or a one respectively. The receiving circuitry comprises a ferrite rod wound with enamelled wire and tuned to 60kHz, the module itself then detects the presence of the carrier or not and then inverts this and sends a logic level output to whatever micro-controller you wish to add.

“Any sufficiently advanced technology is indistinguishable from magic.” Clarke.

Getting the thing to work is another matter! I attached the module to a controller I had lying around (an Espruino) and then started experimenting with decoding the inbound signal but got absolutely no-where. The LED on the receiver module was flickering so I assumed that information was being received but analysis of the bit stream yielded nothing sensible.

After a bid of consideration I decided that the receiver module must be suffering from noise issues due to the hardware I had connected to it, specifically the controller is powered from the USB connection of my PC, which in turn is powered by the PSU within the computer. The Computer PSU is a switching power supply where frequencies akin to the MSF signal are used so it was possible that a 60kHz ripple was coming through my USB lead and disrupting the reception. I tried a few things and did alot of googling which suggested adding a low pass filter and/or ferrite beads/filters to the power supply but rather than embark on that I decided on a process of elimination.

I removed the module from the controller and attached it to my lab power supply which is a linear device so should not have much in the way of switching noise and was flabbergasted to see that the random flickering continued. I then went a stage further and powered the module directly from two AA cells and still the issues continued, the problem was not power supply noise!

Positioning of the device is very important, especially the ferrite rod aerial which is highly directional (a fact that is very useful for radio direction finding e.g. in ARDF/Radio orienteering competitions!) but no amount of rotation solved the problem.

Finally I relocated away from my lab desk toward the window and all the flickering disappeared! I had been at two different desks and had issues at both but now I was away from either suddenly sensible data was coming out of the receiver. It was at this point that it dawned on me! The issue wasn’t power related, not even controller related, it was the fact that on my desks I have a computer monitors that seem to be disrupting the receiver, a bit of research later and it seems the timebase for monitors is often exactly the 60kHz the receiver is trying to discriminate.

I made a little video to show the effect with the hope that others won’t have to go through the pain!

The moral of this story is that MSF receivers and modern computer monitors and possibly computer switched power supplies do not mix. Not such good news for having a clock based project on my desk. The solution seems to be to at least have the receiver reasonably far away from the monitor, perhaps connected by a 2m wire, we shall see.

Once the receiver was away from the computer equipment I put the output into the oscilloscope and started looking at the details which I’ll discuss in my next post but suffice it to say the signal looks reliable with very little noise, it’s looking possible.

(And if you find you have a radio clock that isn’t syncing…. think about moving it further away from your computer screen!)

Advertisements

About nivagswerdna

Professional Geek
This entry was posted in Uncategorized. Bookmark the permalink.

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