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.

The two signals are connected to digital inputs 5 (MSF) and 4 (DCF).

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.

Here is a link to a zip file containing an executable file of the program, the BBC BASIC for Windows code below as well as the gif file for the pcb. I have also included a pdf file of the pcb art work.

msf_dcf_vel.zip version 2.2

Below is the little graphic demonstration program - for those of you that like to read this sort of thing.

   10 REM MSF/DCF_Vel
   20 REM Display MSF/DCF clock pulses
   30 REM (c) Jochen Lueg
   40 REM http://roevalley.com
   50 REM Limavady, 27th May 2013
   60 REM Version 2.1
   70
   80 REM Press keys 1 to 5 to change time base
   90 ON ERROR PRINT REPORT$;" at line ";ERL  : END
  100 PROCK8055_init
  110 ON ERROR PROCerror
  120 ON CLOSE PROCclose
  130 PROCport_setup
  140 PROCinit
  150 SYS K8055_CloseDevice%
  160 SYS K8055_OpenDevice%,0
  170 SYS K8055_ClearAllDigital%
  180 PROCplot_clocks
  190 CLOSE
  200 QUIT
  210 END
  220
  230
  240 DEFPROCplot_clocks
  250 S=1
  260 VDU 5
  270 MOUSE OFF
  280 REPEAT
  290   Restart%=0
  300   H%=60
  310   CMSF%=0
  320   CDCF%=0
  330   X%=-8
  340   Y%=2260
  350  
  360   YM%=2260
  370   YD%=2160
  380   DX%=X%
  390   DY%=YD%
  400   GCOL 0,15:MOVE 10,2394:PRINT "Press 1 - 5 to change the time base, S to pause at the end of a screen and C to monitor continuously. (Default)"
  410   MOVE X%,Y%
  420   GCOL 0,11:MOVE 10,500:PRINT Mode$
  430   REM Find start of change of state
  440   TIME=0
  450   REPEAT
  460     SYS K8055_ReadDigitalChannel%,MSF_Port% TO Port%
  470     IF TIME>200 PROCno_connection
  480   UNTIL Port%=0
  490   REPEAT
  500     SYS K8055_ReadDigitalChannel%,MSF_Port% TO Port%
  510     IF TIME > 200 PROCno_connection
  520   UNTIL Port%=1
  530   REM Start plotting
  540   OldPortMSF%=1:OldPortDCF%=1
  550   REPEAT
  560     REM MSF signal
  570     GCOL 0,11
  580     SYS K8055_ReadDigitalChannel%,MSF_Port% TO Port%
  590     IF OldPortMSF%=0 AND Port%=1 DRAW X%/S,YM%+H%*Port%:CMSF%=1
  600     OldPortMSF%=Port%
  610     DRAW X%/S,YM%+H%*Port%
  620     OX%=X%/S:OY%= YM%+H%*Port%
  630    
  640     REM DCF signal
  650     GCOL 0,14
  660     MOVE DX%,DY%
  670     SYS K8055_ReadDigitalChannel%,DCF_Port% TO Port%
  680     DRAW X%/S,YD%+H%*Port%
  690     DRAW X%/S,YD%+H%*Port%
  700     DX%=X%/S:DY%=YD%+H%*Port%
  710     X%+=1
  720    
  730     IF X%/S>3040 AND CMSF%=1 THEN
  740       X%=0
  750       YM%=YM%-60-(2*(H%+20))
  760       YD%=YD%-60-(2*(H%+20))
  770       OX%=X%:DX%=X%
  780       OY%=YM%:DY%=YD%
  790     ENDIF
  800     IF INKEY(-49) OR INKEY(-108) S=.5 :   Restart%=1
  810     IF INKEY(-50) OR INKEY(-125) S=1  :   Restart%=1
  820     IF INKEY(-18) OR INKEY(-109) S=2  :   Restart%=1
  830     IF INKEY(-19) OR INKEY(-123) S=3  :   Restart%=1
  840     IF INKEY(-19) OR INKEY(-124) S=4  :   Restart%=1
  850     IF INKEY(-83) Mode$="Continuous mode"    :GCOL 0,0:RECTANGLE FILL 0,500,1000,-40:GCOL 0,11:MOVE 10,500: PRINT Mode$
  860     IF INKEY(-82) Mode$="Screen display mode":GCOL 0,0:RECTANGLE FILL 0,500,1000,-40:GCOL 0,11:MOVE 10,500: PRINT Mode$
  870     CMSF%=0
  880     MOVE OX%,OY%
  890   UNTIL YM%<=500 OR Restart%=1
  900   MOVE 500,498
  910   IF Restart%=0 AND Mode$="Screen display mode" THEN
  920     GCOL 0,15
  930     MOVE 500,350
  940     PRINT"Press SPACE to continue"
  950     REPEAT
  960       A$=GET$
  970     UNTIL A$=" "
  980   ENDIF
  990   CLG
 1000   GCOL 0,11:MOVE 10,12:PRINT Mode$
 1010 UNTIL FALSE
 1020 ENDPROC
 1030
 1040
 1050 DEFPROCno_connection
 1060 MOVE 200,2000: PRINT"You have either not connected the atomic clock receiver or you made a wrong connection."
 1070 MOVE 200,1800:PRINT"To begin plotting you should correct either or both omissions."
 1080 MOVE 200,1600: PRINT "Turning ON the power to the receiver may also be a good idea"
 1090 REPEAT UNTIL TIME>800
 1100 TIME=0:CLG
 1110 ENDPROC
 1120
 1130
 1140 DEFPROCerror
 1150 VDU4
 1160 CLS
 1170 PRINT REPORT$;" at line ";ERL  :
 1180 SYS K8055_ClearAllDigital%,1
 1190 SYS K8055_ClearAllAnalog%,1
 1200 SYS K8055_CloseDevice%,1
 1210 SYS "FreeLibrary",K8055_Board%
 1220 END
 1230 ENDPROC
 1240
 1250
 1260 DEFPROCinit
 1270 S%=82
 1280 MOUSE OFF
 1290 MSF_Port%=5
 1300 DCF_Port%=4
 1310 Board%=0
 1320 Mode$="Continuous mode"
 1330 REM Double thick lines
 1340 VDU 23,23,2;0;0;0;
 1350 ENDPROC
 1360
 1370
 1380 DEFPROCport_setup
 1390 PROCwindow(1620,1000,"MSF/DCF atomic clock plotter")
 1400 *FONT Lucida Console,14,2
 1410 ENDPROC
 1420
 1430
 1440 DEFPROCwindow(WindowWidth%,WindowHeight%,WindowTitle$)
 1450 MODE 30
 1460 SYS "SetWindowPos",@hwnd%,0,0,0,WindowWidth%,WindowHeight%,6
 1470 SYS "SetWindowText",@hwnd%,WindowTitle$
 1480 ENDPROC
 1490
 1500
 1510 DEFPROCclose
 1520 SYS K8055_CloseDevice%
 1530 SYS "FreeLibrary",K8055_Board%
 1540 QUIT
 1550 ENDPROC
 1560
 1570
 1580 DEFPROCK8055_init
 1590 REM  Typing errors in routine name do not generate an error message - they just hang up the program.
 1600 REM These are all the system calls in the order found in the latest manual
 1610 SYS"LoadLibrary","K8055D.dll" TO K8055_Board%
 1620 SYS"GetProcAddress",K8055_Board%,"OpenDevice" TO K8055_OpenDevice%
 1630 SYS"GetProcAddress",K8055_Board%,"CloseDevice" TO K8055_CloseDevice%
 1640 SYS"GetProcAddress",K8055_Board%,"SearchDevices" TO K8055_SearchDevices%
 1650 SYS"GetProcAddress",K8055_Board%,"SetCurrentDevice" TO K8055_SetCurrentDevice%
 1660 SYS"GetProcAddress",K8055_Board%,"CloseDevice" TO K8055_CloseDevice%
 1670 SYS"GetProcAddress",K8055_Board%,"Version" TO K8055_Version%
 1680 SYS"GetProcAddress",K8055_Board%,"ReadAnalogChannel" TO K8055_ReadAnalogChannel%
 1690 SYS"GetProcAddress",K8055_Board%,"ReadAllAnalog" TO K8055_ReadAllAnalog%
 1700 SYS"GetProcAddress",K8055_Board%,"OutputAnalogChannel" TO K8055_OutputAnalogChannel%
 1710 SYS"GetProcAddress",K8055_Board%,"OutputAllAnalog" TO K8055_OutputAllAnalog%
 1720 SYS"GetProcAddress",K8055_Board%,"ClearAnalogChannel" TO K8055_ClearAnalogChannel%
 1730 SYS"GetProcAddress",K8055_Board%,"ClearAllAnalog" TO K8055_ClearAllAnalog%
 1740 SYS"GetProcAddress",K8055_Board%,"SetAnalogChannel" TO K8055_SetAnalogChannel%
 1750 SYS"GetProcAddress",K8055_Board%,"SetAllAnalog"  TO K8055_SetAllAnalog%
 1760 SYS"GetProcAddress",K8055_Board%,"WriteAllDigital" TO K8055_WriteAllDigital%
 1770 SYS"GetProcAddress",K8055_Board%,"ClearDigitalChannel" TO K8055_ClearDigitalChannel%
 1780 SYS"GetProcAddress",K8055_Board%,"ClearAllDigital" TO K8055_ClearAllDigital%
 1790 SYS"GetProcAddress",K8055_Board%,"SetDigitalChannel" TO K8055_SetDigitalChannel%
 1800 SYS"GetProcAddress",K8055_Board%,"SetAllDigital"  TO K8055_SetAllDigital%
 1810 SYS"GetProcAddress",K8055_Board%,"ReadDigitalChannel" TO K8055_ReadDigitalChannel%
 1820 SYS"GetProcAddress",K8055_Board%,"ReadAllDigital"  TO K8055_ReadAllDigital%
 1830 SYS"GetProcAddress",K8055_Board%,"ResetCounter"  TO K8055_ResetCounter%
 1840 SYS"GetProcAddress",K8055_Board%,"ReadCounter"  TO K8055_ReadCounter%
 1850 SYS"GetProcAddress",K8055_Board%,"SetCounterDebouceTime"  TO K8055_SetCounterDebounceTime%
 1860 SYS"GetProcAddress",K8055_Board%,"ReadBackDigitalOut" TO K8055_ReadBackDigitalOut%
 1870 SYS"GetProcAddress",K8055_Board%,"ReadBackAnalogOut" TO K8055_ReadBackAnalogOut%
 1880 ENDPROC
 1890


    
 


Return to interfacing index

Back to the start
Tudor with sign