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

The circuit.

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

Pin Function
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
The programme

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

 

IMAG0018

Problems Compiling?

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.

Eagle files

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

Clock – P1

Gerbers

16 Comments

  1. Very interesting post, Alex. I don’t know how similar Arduino code is to Parallax Spin but I’d quite like to try interfacing one of these to my Gadget Gangster. It would be no real hardship to start my WSPR beacon manually at the start of an even minute but that isn’t the point. :)

  2. Thanks for the kind words Julian, most of the code hard work was done by others but I just about managed to follow it. I understand its based on C but thats where my knowledge of it ends. I spent a bit of time working through examples of code to do basic functions like making lights blink etc up to checking web pages for certain words and displaying them as a series of LED’s. This was my first real project and all it needs now is a proper case really.

  3. Martyn

    HI Alex, I have been trying to get this project working for a few frustrating days, i was working from the Jarkman pages and just about gave up, that when i found your page. I just cant get the sketch to compile, i suspect its the same problems you had? i just dont know enough about getting it all in the right place! any tips? I want to get the smae result as you, using the LCD.

  4. Martyn, I found that working through the sketch to get a serial output helped first off. Once I had that then it was a bit easier to change the output from serial to LCD.

    The other thing was making sure the libraries were in the right place. If you can go through where you are with the project I’ll help you if I can

  5. Martyn

    Hi, thanks for the offer of help. This is my first Arduino project, I have done a few things with PICs, really just standing on other peoples shoulders and then hacking the code for my purposes. Im keen to just get the serial working, the LCD bit I kind of want to try and do on my own. I have downloaded the files from Jackman and get loads of errors when I click Compile.
    I think im a bit lost, I have tried to find all the libraries, but now I not sure if I should have them with or “name of library.h”, im not even sure if this is the main problem, maybe im aiming to high!! I recon once im there I can just plod on on my own, I just need a starting point!

  6. I’m not at my pc at the moment so from memory I could give you a false steer. I did get a lot of compile errors that did my head in. If you have a couple moments then check the antenna soldering (twice) as that also gives errors or a long time to sync.

  7. Kevin

    Hi Alex,
    I have the MSFTimeExample.pde up and running but I have struggled converting the code. Would it be possible if you could show the required pde, It would be greatly appreciated. Also did you ever try using the lol shield?

  8. Which bit are you struggling with Kevin? I’ll certainly help if I can.
    I didn’t use the LOL shield as I had an LCD unit. If you’re struggling with that then it shouldn’t be too hard to sort.
    All the code should be on the links, as it’s not mine I think a link to the original source preserves the originators hard work

    Alex

  9. Cody

    I am trying to use a WWVB 60KHz receiver (in the United States of course) from PV Electronics with the above example. I was able to compile the code, but the LED on my receiver is flashing erratically and the serial monitor has read “waiting for minute sync” for 20 minutes. From what I can tell from videos online this LED should pulse on and off fairly regularly. Is this correct?

  10. It should flash about once a second. Sounds like it is having trouble receiving the signal. Try moving it away from likely interference sources and double check the antenna connection. Make sure you removed all the enamel off the wires before soldering. Hope that helps

  11. Alex,

    beautiful work! If MSF works anything like DCF77, there should be a second perk you can get out of your receiver. The carrier itself (77.5 KHz in our case) is derived from an atomic clock source and can be used with a simple PLL to stabilize a 10MHz VFO which can in turn serve as a calibration frequency source for all your radios and test equipment. It could get even simpler if you let the Arduino do the work (as a FLL)..

    73, Jan

  12. Thanks Jan, I can’t claim anything for the code in the Arduino but I’m sure given a bit of attention the code could be adapted. I can’t imagine there is much in the way of difference between the two. MSF60 serves quite a lot of Europe and has recently been relocated to just a few miles from my qth.

    I was planning on doing something else with the Arduino once I’ve done the simple PCB, perhaps I can adapt it to do the calibration kit as well. Now it would be useful then.

    Alex

  13. Brian

    Have solved the compiling under Arduino 1 . In MsfTime.cpp change #include to #include if having problems with uploading hanging delete exclamation marks from Serial.println(“Bad pulse!!!!!….”)
    I’m still having problems getting it to decode signal.

  14. One step forward two back Brian?

    For a while I had a real problem with mine locking onto the signal. Eventually I re-soldered the antenna leads and that made it work better for one day then it started playing up again. i was powering it off a usb cable. I swapped leads and it worked. i can only imagine it was the cable.

    Alex

  15. Rich g4pce

    Alex, I am currently working on a nixie clock with a MSF module, but want to get it working on a lcd display first. The link to jarkman isn’t working. I,d really appreciate it if you could email it to me. I have arduino v1.02 or so but v22 on another box.
    Just had a look else where on your page, I notice a distinct absence of cw contacts in your log book, the best mode I say !!

  16. I’m not good enough to do cw…..I leave that to the talented ones. Unless there is a magic button I’m missing somewhere on my rig that turns my mess into readable Morse

    I’ll drop you an email and hopefully get you going.

    Alex



Add Your Comment