NTP to DCF77 WATCH SYNCHRONISER

by oliverb in Circuits > Arduino

905 Views, 5 Favorites, 0 Comments

NTP to DCF77 WATCH SYNCHRONISER

DisplayStandfrontsideLid01AnimationFrames.gif
DisplayStandfront01a.jpg

This project synchronises radio watches that use the European DCF77 time signal from Germany and sets them using Internet or NTP time.

In locations with bad or no DCF77 signal, time is fetched from a Network Protocol Time Server over WIFI.

Time is then converted to DCF77 code and transmitted to your clocks and watched to synchronise the correct time.

Although designed for European clocks and watches you should be able to convert the code for other world time formats.

Supplies

BOM.jpg

1 off OLED display 0.96 Inch Yellow Blue OLED Display 12864 SPI IIC and can be found on Amazon here 

1 off ESP32 WROOM32S 30Pin here

1 off HC-SR501 PIR Motion Sensor Module here

1 off PIR cover and mount from a old AM312 Mini Pyro electric PIR Sensor Module here

Various 3D Printed parts + optional 18mm plywood base

Credits

toto99303.jpg
watchstand.jpg

I used this code from https://vmod.wordpress.com/solo-dcf77-esp32-transmitter/ and https://vmod.wordpress.com/solo-dcf77-esp32-transmitter/

Pic 1 original compact project designed to synch a single watch.


Pic 2 The watch stand is available here https://www.printables.com/model/419380-timeless-organization-the-minimalist-3d-printed-wa

I used two of these with one printed reversed which fit into my 3D printed base.

Modifications

I have modified the holder and some of the code.

My design holds up to 2 watches and has a movable DCF77 transmitter antenna to allow the antenna to be located correctly for various different watches/clocks.

The code has been changed slightly to show the time code segment being transmitted to the watch.

I have used Vero Board rather than a PCB and a WROOM 32 module.

An LED displays the DCF77 pulses and a PIR turns off the display when no one is around.

The watch holders are mounted in a 3D printed base that also houses the OLED display, DCF77 LED and PIR.

The Wave Ceptor logo has been changed to a generic logo.

A PIR is used to turn off the display when noone is close by.


 

How It Works

DisplayLabelAnimFrames.gif
side01.jpg

Using an ESP32 WROOM module time is fetched from an NTP time server via a WIFI connection.

This time is then converted into DCF77 code and is then transmitted to the watch or clock by a very low power aerial.

The aerial has a range of only a few centimeters so as not to interfere with the weak DCF77 signal from Germany.

The aerial is mounted on a moving arm so it can be placed in the sweet spot of the device being set.

 

Pic 1 Dust cover removed showing the parts.

Pic 2 Side view showing aerial arm details.

Watch Synchronising Timelapse

dcf77ntp02.gif


The watch on the left is set to synchronise to the DFC77 signal transmitted from NTP to DCF77 device while the watch on the right is already in sync.

As the watch on the left synchronises the time is stepped forward until it in sync with the real time on the watch on the right.

The stopwatch on the right was started as the DCF77 reception was enabled.


Electronic Parts & Modules OLED Display

AnimationFramesCropSmallanim.gif
OLEDColour_96Rear.jpg

OLED Display

Pic 1 The display is a 0.96 Inch Yellow Blue OLED Display 12864 SPI IIC and can be found on Amazon here .

Spec

Display area: 21.744 x 10.864mm 128 x 64 pixels

Physical size: 27.3 x 27.8mm

Interface type: Default 4-wire SPI

Switchable rear resistor to use 3-wire SPI, IIC interfaces


Pic 2 rear view of OLED showing resistor options for I2C and SPI.


Electronic Parts & Modules ESP32 WROOM32S 30Pin

ESP32WROOM32_30pinSide.jpg
ESP32WROOM32_30pin.jpg

Electronic Parts & Modules PIR

PIRtop.jpg
PIRMod.jpg
PIRModHoles.jpg
PIR_Sensor.jpg

HC-SR501 PIR Motion Sensor Module 

Pic 1 Adjustment

• Adjust the distance potentiometer clockwise rotation, increased sensing distance (about 7 meters).

• Adjust the delay potentiometer clockwise rotation sensor the delay lengthened (300S) or anti clockwise to shorten the induction

delay (5S).


Pic 2 Rear of the PIR Module showing sensor pins soldered to the PCB.


Pic 3 The SR501 sensor is de-soldered and mounted on the base.

Pic 4 SR501 PIR Sensor

The DCF77 Signal

DCF77_Code_Layoutl.jpg
DCF77_weather-_code.jpg

Note the weather data is not sent out by this device so meteo data bits 1 to 14 are sent as zeroes.

 

DCF77 is controlled by the Physikalisch-Technische Bundesanstalt (PTB), Germany's national physics laboratory and transmits 24/7.


Most service interruptions are short-term disconnections of under two minutes. Longer lasting transmission service interruptions are generally caused by strong winds, freezing rain or snow induced T-antenna movement.

This manifests itself in electrical detuning of the antenna resonance circuit and hence a measurable phase modulation of the received signal. When the maladjustment is too large, the transmitter is taken out of service temporarily. Over a year this will typically be a few hours.


The time code sent is either in Coordinated Universal Time (UTC)+1 or UTC+2 depending on daylight saving time.


The time is represented in binary-coded decimal. It represents civil time, including summer time adjustments.

The time transmitted is the time of the following minute; e.g. during December 31 23:59, the transmitted time encodes January 1 00:00.


Pic 1 The chart below shows the makeup of the DCF77 time code transmitted at 1 pulse per second over 60 seconds


Pic 2 DCF77 Weather Data

 Encrypted weather data is transmitted, alongside the time and date information, from the DCF77 transmitter.

In each minute there are 14 bits which are sent and one weather message consists of three consecutive minutes of 14 bits of weather data. In total 42 bits are used.

Note bits 1 and 8 from the first minute are not used.

In addition there are 40 bits needed derived from the time signal itself, this acts as the cypher.



Setting Up the NTP to DCF77 Watch/Clock Synchroniser

Code Setup

Before uploading the code to the ESP32 Module the code will need to be modified to add your WIFI details and the NTP server address near you. 

 

WIFI

In the code search for "Wifi credentials" and you should see the following.

// Wifi credentials

const char* ssid = "WIFI SSID";

const char* password = "WIFI PASSWORD";

Enter your WIFI SSID and password.

If you have your own NTP server add the SSID and password for your NTP server.

 

NTP Server

Once your WIFI credentials have been entered you will know need to enter your local NTP Server to get the time.

To find your local NTP server use this site https://www.ntppool.org/en/ .

 In the code search for "const char* ntpServe"


You will find the following line of code

const char* ntpServer = "192.168.4.1"; // enter your closest pool or pool.ntp.org

Enter your local NTP server found from the link above.

If you have your own NTP server add the IP address in this field.

 

Time Zone Info

Search in the code for "const char* TZ_INFO"

I am in the United Kingdom and when I followed the instructions in the code my watches were set an hour slow.

I think the problem is the instructions in the code tell you to set the TZ_INFO form https://remotemonitoringsystems.ca/time-zone-abbreviations.php

I followed these instructions and set the TZ_INFO to "GMT+0BST-1,M3.5.0/01:00:00,M10.5.0/02:00:00";

The problem is the time zone location info is already set inside my watches and clocks so using the above line corrected the time twice.

Instead of this I modified the TZ_INFO like this.

Time zone Code for United Kingdom GMT+0BST-1,M3.5.0/01:00:00,M10.5.0/02:00:00

Modified Time zone Code for the United Kingdom GMT-1BST-2,M3.5.0/02:00:00,M10.5.0/03:00:00

This modified Time zone code keeps the GMT header but tell the transmitter to send the time as central European time CET.

This is the time code always sent from the DCF77 transmitter in Germany. Your clocks/watches will then convert the time to your timezone.

 

Once the code modification has been completed upload the new code to your device.


 


Synchronising the Time on Your DCF77 Devices

Insert your watches onto the holders and move the transmitter aerial close to the watch faces.

If you are synchronising a clock position the clock behind the clock synchroniser and move the transmitter aerial near the clock.

You will need to find the best location for the transmitter aerial as it will vary for each clock/watch being synchronised but some come with signal strength indicators which make setting up much easier.

 

Power up the clock synchroniser and you should see the OLED display cycle through the startup cycle.

 

Once connected to the NTP server the final screen shows the code being sent through the aerial and also the local time and date.

I have modified the original code to show information on which data is being transmitted second by second.


The animation below shows a summary of what is displayed on the OLED.


When DCF77 data is being transmitted the DCF77 Signal LED will flash accordingly.


I have set the PIR to come into effect after around 5 minutes and the display will stay on during that time. After this time the display is controlled by the PIR as it detects motion.


Once your clocks and watches have been sychronised to the correct time power down the synchroniser and remove the watches.

Schematic

Schematic.jpg

Schematic

Note the SR501 PIR Sensor is de-soldered from the module and wired on the case.

The circuit is powered from the ESP32 USB port.

Full size schematic here


Veroboard Layouts

veroboard.jpg
veroboard01.jpg
veroboardrear.jpg

Aerial Construction

Aerial01.jpg
Aerial.jpg

Pic 1 completed aerial with aerial wire going through the AerialArm into the left & right Aerial Tubes.

Inside the aerial tubes the wire is wrapped around a small ferrite rod.

I just experimented with different wire/ferrite rods until I got a few centimeter range out of the aerial.

I used a DIY DCF77 signal monitor (design to follow brief details in step 14 ) to check my aerial did not have too much range.

Pic 2 Details on the cut away diagram.

DCF77 Monitor

DCF77_ReceiverAnimFrames-600.gif
DCF77_ReceiverSideAnimationFrames700.gif
DCF77Module.jpg

This simple device is made from a DCF77 Module Pic 3, a switch, LED and 2 AAA batteries housed in a 3D printed case.

Pic 1&2 The Module picks up the DCF77 signal from germany but can also be used to check the DCF77 signal range from your watch synchroniser.

3D Printed Parts

Download zip file of stl and FreeCAD files here


AerialArm 1 off

Fixed to the AerialBase with an M2 nut and bolt to allow adjustment of the aerial.

Curved at the top to allow it to be glued to the left & right aerial tubes.

Slotted for the aerial cable.


AerialArmCover 1 off

Glued in place over the cable slot of the AerialArm above.




AerialBase 1 off

Fixed to the AerialArm with an M2 nut and bolt to allow adjustment of the aerial.

The base has 2 off M2 threaded inserts fitted to allow the 2 watch stand parts to be bolted to it.





AerialTubeLeft & AerialTubeRight 1 off each

The aerial tubes cover the aerial wire and are glued together with the aerial wire coming out the center.

The tubes are glued together and are then glued to the AerialArm with the aerial wire running down the slot in the AerialArm.




WatchStand 2 off (one printed mirrored)

The watch stand is available here https://www.printables.com/model/419380-timeless-organization-the-minimalist-3d-printed-wa

As only the STL file is available for download one will need to be printed mirrored in CURA.





standbase 1 off

Fixed to the wooden base with M2 brass screws the standbase has slots for the watchstands, OLED display, PIR diffuser and LEDHolder.

A hole will need to be drilled in the rear to take the coax cable for the aerial.



OLEDHolder 1 off front and rear views 

The OLED display is hot melt glued to the slot of the cover.

The slot is big enough to allow for some adjustment of the OLED while the hot melt glue hardens.

The OLEDHolder is super glued to the standbase above. The rear of the OLEDHolder inside the hole of the standbase and the front just on top of the hole.




LEDHolder 1 off

Designed to friction fit into the hole on the left of the standbase.

The 3mm LED in turn friction fits into the rear of the LEDHolder.

Note printed in clear PLA.




PIR_Cover 1 off

Holds the PIR sensor diffuser in place on the standbase.

Fixed with 2 off M2 brass countersunk screws.


Rear of cover showing rebate for the PIR diffuser





Base 1 off

Designed to be screwed into the bottom of the wooden base with M2 screws



Woodenbase 1 off

In my design I have used a 164x164x18mm sheet of plywood to make the wooden base.

The 3D printed Base above is designed to screw into the bottom of the wooden base with M2 screws.

I have included a basic 3D version of the base if required that can be fixed using the same screws as the wooden base.

Note there are no screw holes in the 3D Printed version of the wooden base s these will need to be made with a 1.5mm drill as required or added to the included FreeCAD file before printing.


I have not tested/printed the 3D version of the wooden base.


The dimensions of the wooden base are shown below.

The bevels on the base are cut at 45°.

 

 

 

 

 

StandRear 1 off

Fixed to the wooden base with M2 screws the stand rear provides fixings for the StandRearCover.

The StandRearCover has 4 M2 brass inserts fitted to the lugs on the inner part of the cover.

A cable exit slot is cut into the rear.




StandRearCover 1 off

The StandRearCover is bolted to the StandRear with 4 off M2 bolts into the brass inserts fitted to the StandRear.

The four raised areas are drilled for M2 self tappers from the Vero board mounts.

A cable exit slot is cut into the rear to align with the slot on the StandRear.

 


Code

Download code here

Code Setup

Before uploading the code to the ESP32 Module the code will need to be modified to add your WIFI details and the NTP server address near you. 

 

WIFI

In the code search for "Wifi credentials" and you should see the following.

// Wifi credentials

const char* ssid = "WIFI SSID";

const char* password = "WIFI PASSWORD";

Enter your WIFI SSID and password.

If you have your own NTP server add the SSID and password for your NTP server.

 

NTP Server

Once your WIFI credentials have been entered you will know need to enter your local NTP Server to get the time.

To find your local NTP server use this site https://www.ntppool.org/en/ .

 In the code search for "const char* ntpServe"


You will find the following line of code

const char* ntpServer = "192.168.4.1"; // enter your closest pool or pool.ntp.org

Enter your local NTP server found from the link above.

If you have your own NTP server add the IP address in this field.

 

Time Zone Info

Search in the code for "const char* TZ_INFO"

I am in the United Kingdom and when I followed the instructions in the code my watches were set an hour slow.

I think the problem is the instructions in the code tell you to set the TZ_INFO form https://remotemonitoringsystems.ca/time-zone-abbreviations.php

I followed these instructions and set the TZ_INFO to "GMT+0BST-1,M3.5.0/01:00:00,M10.5.0/02:00:00";

The problem is the time zone location info is already set inside my watches and clocks so using the above line corrected the time twice.

Instead of this I modified the TZ_INFO like this.

Time zone Code for United Kingdom GMT+0BST-1,M3.5.0/01:00:00,M10.5.0/02:00:00

Modified Time zone Code for the United Kingdom GMT-1BST-2,M3.5.0/02:00:00,M10.5.0/03:00:00

This modified Time zone code keeps the GMT header but tell the transmitter to send the time as central European time CET.

This is the time code always sent from the DCF77 transmitter in Germany. Your clocks/watches will then convert the time to your timezone.

 

Once the code modification has been completed upload the new code to your device.