I am looking at making a radio-controlled/MSF clock for use here in the UK (more on the MSF signal here: Time from NPL (MSF) - Wikipedia)
Have I missed anything?
The bit I am stuck on is the code.
Any ideas on that? Anyone willing to help?
Many thanks.
Oliver.
Maybe you need a pull-up resistor for the data pin of the receiver.
I've done similar code for the German DCF77 radio clock signal and similar receiver module.
Unfortunately the signal gets disturbed by many kinds of electronics like, PCs computer monitors, TV sets, switching power adapters, energy saving lamps and many more.
Here in Germany, it' easier to get GPS time from a GPS module, even indoors, than getting reliable radio clock signal.
Maybe I could provide test code for such modules, just for evaluating the signal quality, but I have no code for decoding MSF time code protocol.
otronics:
Will an LCD screen need its own power supply?
It depends on the power requirements of the LCD.
Example: When powering an Arduino UNO board by USB, you can simply use the 5V pin of the UNO board to power a 1602 textmode-LCD (including backlight( from the UNO 5V pin, no other power supply required for a 1602 LCD.
You don't need the i2c version. The i2c version requires only 2 Arduino pins (A4 & A5 on Uno/Nano). The non-i2c version needs 6 Arduino pins. You have lots of spare pins on the Nano in your project as it stands. You will also need a small pot (10K) to adjust the contrast on tbe display (if you don't use one with an i2c backpack).
If you are considering alternatives to msf, you could use WiFi to connect to a Network Time Server. For this I would recommend a Wemos Mini instead of the Nano. Because the Wemos has fewer pins than the Nano, the i2c display would be a good idea.
Attached is some code I cobbled together some time ago but I cannot remember the results of testing it so it may be faulty.
Also I only tested it using an audio file as the source and not an MSF receiver module as I cannot get a reliable signal at my workbench and the ultimate aim was building an MSF Encoder so I could set radio controlled clocks in places where they cannot get a radio signal.
Someone decided to buy radio controlled clocks for the workplace so they would not need resetting twice a year. But did not think of the problems of getting a signal in a electronically noisy MCR in a metal clad building.
PaulRB:
You don't need the i2c version. The i2c version requires only 2 Arduino pins (A4 & A5 on Uno/Nano). The non-i2c version needs 6 Arduino pins. You have lots of spare pins on the Nano in your project as it stands. You will also need a small pot (10K) to adjust the contrast on tbe display (if you don't use one with an i2c backpack).
If you are considering alternatives to msf, you could use WiFi to connect to a Network Time Server. For this I would recommend a Wemos Mini instead of the Nano. Because the Wemos has fewer pins than the Nano, the i2c display would be a good idea.
Got it. I have plenty of pins to spare on the Nano so will get the non-i2c version.
Re/ a 10k pot, will this be OK:
Linear or logarithmic?
I am not considering any alternatives to MSF but thanks for the thought.
That pot would work fine, but it's a bit big & bulky for the job. A "trimmer" or "trimpot" is appropriate. You won't need to adjust it very often, so something you can adjust with a small screwdriver. (Unless you plan to make the circuit battery powered, in which case the lcd may well be a mistake anyway).
Log pots are generally only used in analog audio circuits. Linear pots are what's usually needed for Arduino projects.