A combined MSF/DCF atomic clock receiver

This is the atomic clock project that has it all - an Anthorn MSF receiver as well as a Mainflingen DCF receiver, all wrapped into a single neat little package.

The MSF?/DCF receiver

For this to work you must obviously live in an area that can receive both signals. My circuit is based on two modules taken from two radio clocks bought at Lidl's supermarket. Originally both were for the DCF clock but by substituting the original 77.5kHz crystal with a 60kHz crystal, one of the modules was converted to MSF.

Notice that both antennas are lined up in my photograph. This is because Anthorn and Mainflingen - as seen from Limavady - are roughly in the same direction. The alignment of the ferrite rods obviously has to be adapted to your location.

Circuit description The dual clock circuit diagram

The circuit is based on the single clock projects found elsewhere on this site. The supply for the two actual receiver modules makes use of a 3.3V zener diode. Supply voltage is 5V. The four links allow both the output signals and the LEDs to be inverted by moving the link. Each group of four NOT gates - on the pcb - consists of two 7400 NAND gates wired as Not gates.

I found that the circuit worked extremely well and reception is near perfect under most conditions.

The pcb

The pcb

A suggested pcb layout is on the left. A copy of the draw file for this circuit can be found in the zip file, the link to which is below.

The output

The program

I have written a simple little single tasking graphics program which plots the output of both clocks one over the other. The MSF clock is yellow, the DCF clock is green. On the right is a small section of the output.

Not much can be learned. The most interesting bits are the beginning of minute markers. This is a half second ON for the MSF clock and a full second OFF for the DCF clock. Notice also the double pulse in first DCF second indicating a 100ms difference between atomic time and GMT. This used to be 400ms not all that long ago.

I have highlighted the interesting bits. Anything you see in red was not produced by my program but inserted via !Draw.

Here is a link to a zip file containing the draw file of the pcb layout, the circuit diagram and the BASIC V program below.

Version 2 of the program allows you to plot continuously or screen after screen. You can also change the time base.

The zip archive (Version 2)

Video of the setup and the output of the program

Below is the little graphic demonstration program - for those of you that like to read this sort of thing. Notice line 990. This assigns GPIO  lines 14 and 15 to the respective clocks. If your interface uses different pins, change this assignment.

   20 REM Plot both atomic clock signals
   30 REM (c) Jochen Lueg
   40 REM http://roevalley.com
   50 REM Limavady, May 2013
   60 REM Version 2.0
   70 REM
   80 REM Uses GPIO 14 (MSF) and 29 (DCF) for input
  110 OSCLI"RMEnsure GPIO 0.00 RMLoad GPIO"
  120 OSCLI"RMensure GPIO 0.40 ERROR  Please install the GPIO module"
  130 PROCsetupGPIO
  150 ON ERROR PROCerror
  160 PROCinit
  170 PROCplot_clocks
  180 *QUIT
  190 END
  230 DEFPROCplot_clocks
  240 LOCAL S,H%
  250 S=40
  260 VDU 5
  280 MOVE 10,1438: PRINT "Press 1 - 5 to change the time base, S to pause at the end of a screen and C to monitor continuously (default)"
  281 GCOL 255,255,0:MOVE 10,12:PRINT  Mode$
  290 REPEAT
  300   Restart%=0
  310   H%=80
  320   CMSF%=0
  330   CDCF%=0
  340   X%=0
  350   Y%=1340
  360   YM%=1340
  370   YD%=1240
  380   DX%=X%
  390   DY%=YD%
  400   MOVE X%,Y%
  410   REM Find start change of state
  420   REPEAT
  430     SYS "GPIO_ReadData",MSFPort% TO Port%
  440   UNTIL Port%=0
  450   REPEAT
  460     SYS "GPIO_ReadData",MSFPort% TO Port%
  470   UNTIL Port%=1
  490   REM Start plotting
  500   OldPortMSF%=1:OldPortDCF%=1
  510   REM MSF signal
  520   REPEAT
  530     GCOL255,255,0
  540     SYS "GPIO_ReadData",MSFPort% TO Port%
  550     IF OldPortMSF%=0 AND Port%=1 DRAW X%/S,YM%+H%*Port%:CMSF%=1
  560     OldPortMSF%=Port%
  570     DRAW X%/S,YM%+H%*Port%
  580     OX%=X%/S:OY%=YM%+H%*Port%
  610     REM DCF signal
  620     GCOL 0,255,255
  630     MOVE DX%,DY%
  640     SYS "GPIO_ReadData",DCFPort% TO Port%
  650     DRAW X%/S,YD%+H%*Port%
  660     DX%=X%/S:DY%=YD%+H%*Port%
  670     X%+=1
  690     IF X%/S>2300 AND CMSF%=1 THEN
  700       X%=0
  710       YM%=YM%-80-(2*(H%+20))
  720       YD%=YD%-80-(2*(H%+20))
  730       OX%=X%:DX%=X%
  740       OY%=YM%:DY%=YD%
  760     ENDIF
  770     IF INKEY(-49) OR INKEY(-108) S=20 : Restart%=1
  780     IF INKEY(-50) OR INKEY(-125) S=30 : Restart%=1
  790     IF INKEY(-18) OR INKEY(-109) S=40 : Restart%=1
  800     IF INKEY(-19) OR INKEY(-123) S=80 : Restart%=1
  810     IF INKEY(-20) OR INKEY(-124) S=160: Restart%=1
  830     IF INKEY(-83) Mode$="Continuous mode":GCOL 0,0,0:RECTANGLE FILL 0,0,600,12:GCOL 255,255,0:MOVE 10,12:PRINT Mode$
  840     IF INKEY(-82) Mode$="Screen display mode":GCOL 0,0,0:RECTANGLE FILL 0,0,600,12:GCOL255,255,0: MOVE 10,12:PRINT Mode$
  850     CMSF%=0
  870     MOVE OX%,OY%
  880   UNTIL YM%<100 OR Restart%=1
  890   IF Restart%=0 AND Mode$="Screen display mode" THEN
  900     GCOL 255,255,255
  910     MOVE 500,350
  920     PRINT"Press SPACE to continue"
  930     REPEAT
  940       A$=GET$
  950     UNTIL A$=" "
  960   ENDIF
  970   CLG
  971   GCOL 255,255,0:MOVE 10,12:PRINT  Mode$
 1020 DEFPROCinit
 1030 S%=80
 1040 MODE 1280,720,32
 1050 VDU 5
 1070 Mode$="Continuous mode"
 1110 DEFPROCerror
 1120 CLS
 1130 PRINT REPORT$;" at line ";ERL
 1140 QUIT
 1180 DEFPROCsetupGPIO
 1190 MSFPort%=14:DCFPort%=29
 1200 SYS"GPIO_EnableI2C",0
 1210 SYS"GPIO_ExpAsGPIO",2
 1220 SYS"GPIO_WriteMode",MSFPort%,0
 1230 SYS"GPIO_WriteMode",DCFPort%,0

Return to interfacing index

Back to the start
Tudor with sign