Arduino MSF receiver
As a long time fan of ‘the correct time’ I found that my shack clock also needed a PC to be running in order for it to be displayed . Joking aside the computer is pretty good at telling accurate time but what it isn’t good at doing is making sure its done all by itself.
Whilst looking for inspiration for a project to do with my Arduino I came across various posts and a few web pages about liking a DCF77 receiver (The German time signal on 77KHz) to an Arduino and outputting that to an LCD display. So I thought I’d have a go at drawing something together for the MSF60 time signal. Some useful background can also be found here.
First things first
I’ll assume following
1. You have and Arduino Uno and the development software
2. You have some components – Breadboard, leads, 8KOhm resistor, etc
3. Some spare time (In my case quite a bit)
4. An MSF60Khz receiver module (The MSF60 receiver I got came form PV Electronics for a whole £6.95 + p&p)
5. LCD module. I used a standard 2 line display that you can get just about anywhere. Mine is a no-name version that came as part of a pack from eBay
Its a simple circuit, the clever bit is done by the microprocessor. The MSF receiver module is a small board with a number of connections on it. There is a little bit of soldering to do with the antenna but this shouldn’t present any problems if you’re happy to use a soldering iron. Essentially all we have to achieve is to connect up the antenna and to power on the module. TCON then goes to pin 7 on the Arduino
|A1||Antenna input 1|
|A2||Antenna input 2|
|Vdd||Power supply for the module|
|TCON||Serial output pin in inverted format|
|PON||Power-On. Connect to GND to power on module|
|GND||Ground connection for the module|
|NC||No Connection. Leave open, do not ground|
The above is all you need to output the data to the serial console on the Arduino development environment. If, like me, you want a stand alone item that once programmed you don’t need to use a PC then we’ll need something to output the information to. An LCD module for example. I happened to have a simple 16×2 LCD module kicking about and it was a perfect fit for the Arduino.
So, we then need to output the data from the Arduino to an LCD module. This comes from the pins detailed below and is driven by the standard LCD library. By outputting to the serial meant that I knew the programme worked and the correct time was being displayed (a good idea to do the same if you want to make sure its all working well). Changing between serial and LCD output is very simple and this site helps to understand what to connect where. the only programming changes were to swap the Serial output commands for LCD output commands
|LCD Pin||Connect to|
|1 (VSS)||GND Arduino pin*|
|2 (VDD)||+ 5v Arduino pin|
|3 (contrast)||Resistor to GND Arduino pin*|
|4 RS||Arduino pin 12|
|5 R/W||Arduino pin 11|
|6 Enable||Arduino pin 10|
|7 No connection|
|8 No connection|
|9 No connection|
|10 No connection|
|11 (Data 4)||Arduino pin 5|
|12 (Data 5)||Arduino pin 4|
|13 (Data 6)||Arduino pin 3|
|14 (Data 7)||Arduino pin 2|
|15 Backlight +||Resistor to Arduino pin 13 (40 Ohm minimum)|
|16 Backlight GND||GND|
Now I can’t lay claim to any part of the programme itself nor the libraries. The effort in this part was all done by this chap here. At first I took the serial output example and made sure that there was the correct signal coming out of the receiver and through the Arduino. After a few false starts with things in the wrong place (libraries mainly). So making sure the libraries and programme go in the correct places and pushing the upload button does the trick.
The breadboard version in the photos and video’s is a slight modification in as much as I outputted the data (Is this even English?) to the LCD module. For some reason or another I couldn’t get the module to write the phrases in the order they came, it jumped from the first to the last statement and missed out the middle one. You have to take a bit of care when setting where the characters go but this is just a case of putting blank characters (spaces) in between the speech mark’s.
As you can see in the video the unit takes a minute or so to get a fix and then is quite happy on my desk where only occasionally it has a bit of a crisis of confidence when it loses the radio fix, but soon regains its composure to display the right time and date.
So the breadboard version is complete, only it doesn’t look too good and uses the large Arduino Uno board. Using Ardweeny boards or ATmega328 chips on their own adds in a bit more complexity but will be next on the list of jobs to do to complete my shack clock. Something I have yet to do but will try and fit in before too long. Perhaps even a custom PCB and fancy case as well!
Photos & Video’s
Following on from some discussions with Martyn (see comments below) who had some difficulties compiling the code its worth noting that there are some peculiarities with the Arduino that need to be taken care of.
The libraries need to be in the library folder, sounds obvious enough but you’ll need to make sure that the Time.cpp, Time.h, MSFTime.cpp and MSFTime.h libraries are in a folder called Time within the libraries area. The MSFTimeExample.pde sketch that comes from the above source needs to be elsewhere. The IDE will open the libraries up when you open up the sketch and it ‘should’ compile first time. Most of the problems I had were as a result in having the right files in the wrong place.
Other issues which seemed to be be a bit hit and miss were that the latest IDE v1.00 didn’t seem to like the libraries too well and that if you use v0023 then it all seemed to work well for me.
Here are the Eagle files as is, still at a preliminary level so use them for a guide only. They have not been checked nor has a board been made from them. Once a working version is available it will be posted here