NTP-enbling a cheap $2 Ikea analog clock using ESP-12/NodeMCU/Arduino

Similar projects worth following
In this project, I connected a cheap $2 Ikea analog clock to the ESP-12/NodeMCU dev module and synchronized the clock time with NTP time (localized with Google Maps Timezone API). On startup, simply connect to the device configuration AP and configure your Wi-Fi login credentials and physical clock time. The config web page will capture your current location automatically using HTML5 Geolocation and use that to automatically figure the local time and DST offset via the Google Maps Timezone API.

In an ideal world, all clocks should synchronize with the network and deal with daylight saving hell automatically. Not only that, they should run for at least a year on a single AA battery and cost around the same price as current clocks.

In this project, I try to NTP-enable a cheap $2 Ikea RUSCH wall clock using a ESP-12E dev module. This project was inspired by another blog post that explores controlling the Lavet motor in a typical analog quartz clock using an Arduino.

Most NTP clock projects make use of digital displays of one form or another. The only analog one I can find is this one by Jim Loos. I think my contribution here is the setup. It automatically captures your location using the HTML5 Geolocation API. It then use the Google Maps Timezone API to automatically convert the UTC time returned by NTP to the local time with DST offset.

Hence setup is extremely simple. Connect to the device configuration access portal and enter 1) Wi-Fi credentials 2) clock face time. Hit "Save" and the device should take care of the rest.

Of the 3 goals stated, 2 of them have been met. The clock will sync within a few seconds of NTP time, take care of DST automatically and only cost a few dollars more due to the low cost of ESP12/ESP8266. The only problem that remains is the practical need to run this clock from the mains. Even when connected to a 10,000mha battery pack, it will only last for about 6 to 7 days.

I hope this will be solved eventually...

  • 1 × ESP-12 / NodeMCU dev module ($6)
  • 1 × Ikea RUSCH analog clock ($2)
  • 1 × Jumper wires
  • 1 × Soldering iron

View all 2 project logs

  • 1
    Step 1

    My full project diary can be found here. There are very few parts required, and all of them should be quite easy to obtain. Connect the ESP-12E dev module to your laptop via a standard micro-USB cable. Then install the Arduino IDE and follow the steps here to configure it for ESP-12 support. You also need to install WiFi Manager using the IDE's Library Manager. Once you have the environment set up, try running the sample WiFi Manager sketch and connect to the configuration access point. My own experience was quite smooth-sailing. I got everything up and running in 30 minutes or so, half of which was waiting for things to download.

  • 2
    Step 2

    Once the development environment is set up and running, we need to take apart the Ikea clock and solder 2 jumper wires to the clock mechanism. Remember to verify that the clock mechanism has been re-assembled correctly by driving it using an AA battery. The first time I did that, the second hand wouldn't tick properly due to suspected gear misalignment. The second time was a success.

  • 3
    Step 3

    Connect the jumper wires to pin D1 and D2 of the ESP-12 and run the sample clock driver sketch (make sure there's no battery in the clock!). The clock should tick as per normal.

View all 5 instructions

Enjoy this project?



victor-chew wrote 11/29/2016 at 10:09 point

BTW there are some discussion here:

that writing the clock time to the EEPROM every second will blow away the 100,000 write cycle in no time. I pointed out that potentially some wear-leveling strategy might be applied, don't have time to drill in for now.

  Are you sure? yes | no

Simon Brown wrote 11/07/2016 at 11:12 point

Would it be possible to switch between ESP control and the normal clock? e.g. electronically switch the nortmal clock battery connection on and off.  Run the ESP in low power mode and wake it every x hours for a resync by disconnecting the clock battery again and changing the time, followed by a reconnection of the battery and back to sleep.  this would increase the battery life of the clock and would keep it running even if the ESP battery had died.

  Are you sure? yes | no

bench2004 wrote 11/17/2016 at 15:53 point

yes indeed this will save power, but there are two things:

1) need to keep track of the position of the hands, so you know weither to inc. or dec. the time to sync

2) How to pulse the coil so the hands will go backward (if needed) is an interesting problem

For 1) I have an idea to tie the hands to some pot. so when the esp wakes up it reads the resistance, hence the position of the hands so works out what time it is.

For 2) I have no idea how to do that.

  Are you sure? yes | no

victor-chew wrote 11/29/2016 at 10:06 point

1) The potentiometer idea is interesting, but is there some kind of pot that can be used that does not drastically reduce the battery life due to the increased resistance on the hands?

2) I've previously tried to pulse the coil in various ways, but it seems the hand will only go forward.

  Are you sure? yes | no

victor-chew wrote 11/29/2016 at 10:07 point

@Simon Brown: That would be nice, but I think a significant drift will inevitably occur, since the ESP clock and the quartz clock are slightly different. It can only happen if there's a power efficient way for the normal clock to store its current time so that the ESP can somehow read it and then resync.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates