Remote controller for Clocks (IKEA and others, DCF77, WWVB, MSF, JJY)
A remotely controlled, precise analog wall clock like that one from IKEA is a cool thing. Today we will build our own remote control for such analog and digital clocks. All we need is a Raspberry Pi and a few electronic components. And we will learn something about resonance frequencies, capacitors, and ferrite antennas. Letβs hack!
This is material presented in the following video:
Installation:
Source of the software: https://github.com/hzeller/txtempus
sudo apt-get install git build-essential -y git clone https://github.com/hzeller/txtempus.git cd txtempus make
Start command:
sudo ./txtempus -v -s DCF77
Options:
-s <service> : Service; one of 'DCF77', 'WWVB', 'JJY40', 'JJY60', 'MSF'
-r <minutes> : Run for limited number of minutes. (default: no limit)
-t 'YYYY-MM-DD HH:MM' : Transmit the given local time (default: now)
-z <minutes> : Transmit the time offset from local (default: 0 minutes)
-v : Verbose.
-n : Dryrun, only showing modulation envelope.
-h : This help.
Automatic Startup:
Create a service file for systemd:
Create a service file:
sudo nano /lib/systemd/system/remoteClock.service
Insert the following content:
[Unit]
Description=My Sample Service
After=multi-user.target
[Service]
Type=idle
ExecStart=/home/pi/txtempus/txtempus -v -s DCF77 > /home/pi/remoteClock.log 2>&1
[Install]
WantedBy=multi-user.target
Press ctrl-X , Y and Enter to save the file
Set the permission:
sudo chmod 644 /lib/systemd/system/remoteClock.service
Restart systemd
sudo systemctl daemon-reload
sudo systemctl enable remoteClock.service
sudo reboot
Nick Garrod
10. October 2019 @ 14:54
Hi Andreas, in the automatic startup script for the DFC77 remote controller, I think there is an error. There is a spurious y after the [Service] header. Thank you for providing the example, as I always need to look these things up. Hardware is more my thing.
Regards
Nick G0OQK
admin
7. November 2019 @ 18:08
Hi Nick,
Thank you for your info. Now the “y” should be removed…
Marcus Tarquinio
14. October 2019 @ 17:36
Hi Andreas. I been following your youtube channel for a while now. I am a big MicroPython fan and every Sunday I hope that the topic of your video will be on MicroPython. I have some spare devices with the K210 chip. I wonder if are interested I can donate one to the channel.
https://m5stack.com/collections/all/products/stickv
Let me know…
admin
7. November 2019 @ 18:02
Hi Marcus,
thank you for your offer. I have a few of the K210 modules, but so far did not find time to use them π
Zsolt
1. December 2019 @ 8:30
Dear Andreas,
Thank you for your DCF77 for ESP32 project! This way with less investment, I’m able to set my radio controlled clocks around the house… At least this is my goal.
I tried to implement the changes to the DCF77-Transmitter-for-ESP32 what you made on the NTP-time-for-ESP8266-and-ESP32 repository, but I was not successful. The easy part ( very first line, lower case timer.h , credentials.h default comment was easy. ) But with the counter, and getTimeReducedTraffic function I was not able to achieve it.
Also it seems to be – hope not my ESP32 is faulty – It lost the time once in a while. First it synchronizes with NTP, and suddenly – at the next sync? – it shows invalid date&time ( like if it would try to catch the time via NTP servers but unsuccessful ).
Can you help with the merging updates from the plain NTP sketch of yours?
Also, I’d like to recommend to extend the documentation with topics : “array of pulses” , “led and antenna pins 4/5 also the type of the pins (GPIO / pin number) – https://i.imgur.com/pBJgAEK.jpg (my esp32 variant)”
Hope I was understandable.
Thank you for your work, time and effort!
Regards,
Zsolt
admin
5. December 2019 @ 14:51
I would not change anything. The sketch runs like that. I added the two pins to the readme file.
Dave
5. December 2019 @ 16:40
imho the raspberry on is overkill…looks like an esp32 would do fine
Time could easily be picked up from a GPS or an internet time server.
Am I over simplifying?
naxxfish
7. January 2020 @ 10:36
Hi Andreas,
Thanks for this and your follow-up video implementing this on the ESP. As a British person, your comment about BST and “you never know what the Brits might do” made me laugh – I for one was quite looking forward to abolishing daylight savings time, as it has been a cause of a lot of (boring) work for me in my career as a broadcast engineer ! But alas it would not surprise me if our government decided to implement an even more obtuse daylight savings scheme – perhaps called Extra British Summer Time – just to “retain our sovereignty” and keep us engineers in work!
I wonder, though, if you’ve ever considered using GPS to set time rather than NTP ? I can imagine where this could be useful – perhaps for a caravan which may not always have a reliable network connection? Or a remote sensor station ?
Thanks very much for sharing your experience and wisdom through your videos and I wish you a good 2020!
admin
9. January 2020 @ 16:51
Using GPS should be rather easy because you get libraries to read the serial data. I assume these libs will also read the time, but I never tried. I have no caravan and in the basement, GPS is very weak π
Franck
9. March 2020 @ 8:36
Hi.
Good Job.
I’d like to know if the antenna is the same to receive and transmit.
Can I buy an antenna ready to be used for you project?
admin
9. March 2020 @ 10:29
I assume you can use the same antenna. I did two videos about DCF77, and in one of them I showed how I tuned the antenna. I do no more remember in which one.
Franck
21. March 2020 @ 16:21
Ok thanks for your reply.
Sad, there’s no schema with ESP32 + antenna to get a global vision how to plug the antenna.
I assume the antenna is a serie with resistor (500ohms) + Antenna (77.5khz coil) + capacitor .95nF linked to the ground.
Just to be sure.
I wondered if two capacitors (One normal + the other variable), was good just to adjust the frequency.
Rui Costa
25. August 2020 @ 12:34
Hi Andreas Spiess and thanks for a outstanding project.
I already did the basic experiment (with the 3 resistors only and a few centimeters of coiled electric wire) with one of my RPI and I can adjust the clocks by almost touching the clock’s DCF antenna to the power cord. I already bought a 77.5kHz Fine Tuned Loop Stick Antenna for DCF77 Receiver at eBay, from Canada and while I’m waiting for it to arrive, I take this opportunity to ask the following questions:
What could be the coverage of the DCF signal, using the basic circuit, but with the DCF77 antenna (the length of this antenna is 60mm, with a core diameter of 10mm)?
What could be the coverage of the DCF signal, using your modified circuit with the PNP transistor (3.3Volt) and the DCF77 antenna?
What could be the coverage of the DCF signal, using your modified circuit with the PNP transistor (5.0Volt) and the DCF77 antenna?
Many thanks in advance and best regards.
Rui, CT1AIC
Jan Verhoeven
4. September 2021 @ 14:38
Andreas,
It might be dun to have the wll clock display temperature and humidity
It will be enough to make up a time telegram that contains the time, calculated as
Hour = RH x 60
Minutes = Temp + 30
It will not be the fastest weather station… Yet quite funny.