ESP32 Becomes Modern Controller For A 1960s Clock

These days, everything’s got a clock in it, and a good proportion of those clocks are automatically syncronized to high-accuracy Internet time servers. Back in the past, things weren’t so easy. Often, institutions that required accurate time would use a single highly-accurate primary clock to drive a series of secondary clocks around a facility. Without the primary clock, the secondary clock has no signal to drive it. [Oleksii Samorukov] had just such a clock, and whipped up a controller to stand in for timekeeping duty.

The secondary clock in question is a Pragotron PJ 27, which requires regular 12V signals of alternating polarity in order to keep time. To handle this job, [Oleksii] decided to use an ESP32 in combination with an L298N motor controller. The L298N is an H-bridge driver chip, allowing it to easily supply the 12V signals in alternating polarities where required. To ensure the system keeps accurate time, the ESP32 regularly queries an NTP time server over WiFi.

It’s a tidy build, and one that brings this attractive 1960s timepiece into the modern era. We’d love to have such a stylish, well-built clock in our own home, too. Of course, if you want really accurate time, building a GPS clock is a great option, too!

[Thanks to Irregular Shed for the tip!]

20 thoughts on “ESP32 Becomes Modern Controller For A 1960s Clock

  1. Brings back memories of the Simplex clock system we had at my elementary school. Especially when we went off of daylight savings time in the Fall, because the custodian would set it to advance those 23 hours, one minute at a time, before he went home on the Friday afternoon before the change. Why he didn’t just unplug the master clock for an hour, I never knew.

    1. Much the same in my elementary school. The bell system was wired into the master clock to ring the bells for ten seconds every hour during the school day to signify period changes. IIRC it also controlled the warning lights for the school speed zone out on the road. But, I remember going there early in the morning for summer camp orientation one year, and someone had forgotten to turn the bells off at the end of the normal school year (knowing the janitor, he probably intentionally.) So come 8AM, pretty much everyone in the cafeteria jumped out of their skin.

  2. I did the same with an arduino and a rtc. You just need an accurate second clock signal. The secondary clock doesn’t give you back any state. Would be great if you can get the time from ntc and the secondary clock and correct the time on the secondary or set time to winter/summer time.

    1. When I did my clock I concluded that the cheapest and most reliable way to feed-back the actual position of the clock hands would be a web camera looking at the face from across the quad, and then OpenCV or similar.
      This is mainly a commentary on how cheap webcams and single-board computers have become.

  3. FWIW I did this to a public clock from 1930 5 years ago.
    https://bodgesoc.blogspot.com/2015/09/clock.html
    That uses a radio time signal rather than rely on WiFi or GPS and an Arduino Nano.
    I tried to make a system that would last several decades. The hardest part of that was wear-levelling the EEPROM where the last-written time is stored (to recover from power cuts).
    Ironically it needs an Arduino with a good on-chip time-base to keep good enough synch with the minute-long time signal to get the time (which comes last) reliably.

    1. Nice build! Simple, effective, and with a good reward for your effort.

      It was rumoured that students in the engineering faculty in a previous year at my university made a mains invertor that ran at about 55 Hz – 60Hz (i.e. about 10% to 20% fast), and connected it to the clock in the auditorium of a lecturer they didn’t like. Reduced the time of the lectures.

      1. If the participation at the lectures is not mandatory, what is the benefit of this? Paying amount X for tuition and then reducing what you get in return… Schools etc with mandatory participation are then a different game.

  4. Hehe, we have passed the stage where people use a complete Arduino for lighting an LED. Now we have come to the stage of using ESP32’s for lighting an LED. ;)

    I did something similar, but switching a lamp on and off at exactly dusk and dawn. But never implemented any power-saving feature. The switch is always connected to mains, and always connected to WiFi. I guess it uses about 200 times the amount of power that is actually necessary.

    I wonder how all those homebuilt devices using ESP8266 or ESP32, and for which nobody spent any time optimizing the power usage, are affecting our global use of energy…

  5. I’ve been reviewing a lot of similar projects and they all have the same issue: no way to detect when at midnight. Meaning you have to manually “calibrate” the clock by telling it when the hands are in that position and then is has to either save it somehow or it has to be done again when power is removed.

    Some radio clocks seem to be able to detect the 12:00 position somehow. I had one that would periodically reset itself to 12:00 every few days and then back to the correct time, I guess because the motor drive wasn’t very reliable.

      1. Holes drilled in the rim of the hour and minute wheels and an optical slot sensor is probably the more reliable way. In my application, though, I wasn’t sure that the detectors would last for the design life.

        1. Yup that’s what it is. I took apart a dead analog atomic clock mechanism and that’s what it used. Although I have an ancient metal slave Simplex clock that has limit switches to detect the top of the hour.

  6. I’ve dropped using the esp32, and now using the stm32. Its stocked with most USA distributors. There is talk of china only products coming to an end in the semi conductor industry

  7. Pragotron clocks are awesome. I’ve wanted one since I saw a post about someone doing something similar to this a while ago. When I was in Hungary and Czech Republic last summer, they were still everywhere!

  8. Many years ago I built a ‘motherclock’. Just by dividing the 50 Hz mains frequency by 3000 and send a 1 sec. pulse to the ‘motor’ of the clock.
    To adjust the time; hold the pulses (simple toggle switch), until the correct time is shown or press a button (and hold) to have the division by 96 (or something).
    Just a couple of binary counters and some diodes to do the division part and a simple H bridge (just some ‘power’ transistors) did the job.

    Using the 50 Hz mains frequency is extremely precise in the long run.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.