ESP32 based old clock controller, with NTP sync
smallhacks.wordpress.com
smallhacks.wordpress.com
A very common control protocol, used more or less by IBM, Simplex, and Standard Electric, is this: a pulse delivered once per minute advances the minute hand one notch. A pulse delivered at the top of every hour (on a separate wire, I believe in the Simplex case that I am most familiar with) powers an electromagnet which "snaps" the minute hand to the 00 position, correcting any error that occurred in tracking the minute pulses over the preceding hour.
If the clock is doing a poor job of tracking the minute pulse (due to a dirty/bound up local mechanism in the case of school clocks I've messed with), it's common to see the minute hand perhaps ten minutes behind late in the hour, and then at the top of the hour it will fairly quickly "sweep" to the correct position. Of course these clocks should be serviced, but the school district I was dealing with had a paltry budget and a hard time finding companies to service the clocks so they tended to stay broken in this way for years at a time.
The big problem with this system is that it could only "correct" clocks that were a bit off at the top of the hour (if the error was too large the top-of-the-hour reset did not function correctly, and the hour hand was never corrected). This meant that in the event of a loss of power to the clock system, it was necessary to manually reset the hour hand of every clock in the building prior to restart. The convention for Simplex and I believe for other vendors as well is to set all clocks to 12:00 exactly, the master clock then has a mode in which it delivers "accelerated" minute pulses to advance all clocks to the correct time. Back when I was in middle school the controller seemed to be broken in a way where it occasionally went into this mode incorrectly (maybe a short power disruption) and sometimes all the clocks in the building would be moving at 10x speed for a few hours of the day.
DST correction needs to be handled similarly, so you will have to visit every clock in the system at least twice a year, assuming you have reliable power and aren't in Arizona or something. Or, in an underfunded school district, just apply the DST correction weeks late or not at all. It is amazing how habituated people become to the clocks being completely unreliable.
I have read that there were systems that used a third signal to reset the hour hand at 12:00, avoiding this problem, but I've never personally seen one - perhaps they weren't popular at all or perhaps they just fell into an awkward spot at the end of the period where analog systems were being installed. In modern slave clock systems, it's more common to use RS422 or 900MHz radio to directly transmit timestamps once per second. These have the major advantage of making digital displays extremely easy to implement and analog displays still fairly easy, with no need to ever manually set clocks.
In installations today though, it seems like the most popular option for schools are one of several digital (sometimes IP) paging systems that support a clock display as an add-on feature. Integrating the clocks with paging makes more sense than you might think, as the slave clock system in schools generally also controlled the bells (sometimes using the same signal wires, e.g. using opposite polarity of pulses to open a relay on the 12/24vac bells), and so now that bells are being replaced with paging it makes sense to keep clocks on the same system.
There's a subset of the curious internet community of fire alarm collectors who also collect these clock systems, since they are somewhat similar in nature to older fire alarms. I'll admit that I've considered trying to get a few old Simplex slave clocks to fix up and put in my house, probably implementing my own controller since even the later-generation digital controllers Simplex sold were large wall cabinets.
I've always had a weird interest in these systems since they tend to pop in large old buildings and are one of the many odd building systems you have to figure out sometimes - along with vacuum controlled HVAC and old phone systems. A small side project of mine right now is trying to get a working dental office communicator light system.
THATS why the clocks at school did that when I was a kid. I always thought they did it to mess with us (why is the minute hand taaaaaaaking so long??). Regardless of the veracity of my statement- good info, thanks.
Though you're limited to pulses that drive the second hand. So you would have to keep track of pulses and hold one back or add an extra now and then. Something like waking up every half second, calculating current ntp time minus last known ntp time and sending pulses to match.
Daylight savings that goes back would be an issue for that hour, best you could do is wait, or send a bunch of pulses to go around as quick as the stepper allows.
Another idea is to use FRAM instead of the board flash, to solve wear out problem forever :)
An even earlier version used an atmega and was powered from batteries [3]
Those slave-clocks are pretty loud. Both versions have a way to pause the clock.
https://gitlab.com/close2/nebenuhr https://gitlab.com/close2/nebenuhr_hardware https://github.com/close2/nebenuhr
I see you solving +- same problem but a bit different way + my board have OLED to show the status and also that you supporting work on battery and i was not doing that. Another different i found that you using custom hw board. I was thinking about this initally, but later decided that motor driver is the best match here. This would work (with a small changes) with 24v version as well, but will require different hardware (custom h-bridge?) for the 60V version.
Also, the commenter on your website is correct about fading OLED displays. The cheap 128x64 OLEDs selling on eBay for $1-$2 seem to degrade within 6 months. I hope to use an LCD for my next clock.
So one just need synthesize a perfect 60Hz ~115vac input and the clock will keep perfect time. (In theory the grid tries to keep somewhat accurate time, but in practice at least on the west coast the departures can be pretty substantial.)
I have a wall clock here that keeps coordinated Mars time, driven off a local atomic clock.
I use ntp and this: https://www.npl.co.uk/msf-signal
I set my wrist watch manually. That's my time of first resort. It's slightly inaccurate but very, very reliable and handy (by definition!) I bought it about 15 years ago and its solar powered. Never failed yet. My phone keeps decent time but the battery needs charging - fails very infrequently but needs waking up. My laptop keeps a decent tick. It has a fairly decent local oscillator and ntp with several sources. Similar probs to phone and takes a while to boot. My three GPS synched ntp stratum 1 servers (RPis) that I keep in the office keep a very good tick.
For my needs, consistency is more important than real accuracy but I do like to see sub millisecond accuracy available. It makes log analysis a lot easier.
I was under the impression that even though the frequency drifts can be substantial, the grids compensate so that the total number of cycles over a longer time matches pretty exactly what the target frequency would have given?
I.e. if the target is 60 Hz, and 61 Hz happens for an hour, then the grid will later on intentionally go down to 59 Hz for an hour (or, perhaps more likely, a frequency close to, but below, 60 Hz for a longer time) to compensate. This is an easier task than targetting a fixed frequency, because the total number of cycles is just a matter of counting and crude intentional drifts for compensation. And it's the total number of cycles that AC-synced clocks use, so they might run slow or fast for a short while, but will then correct themselves by running faster or slower later on.
Can someone more knowledgeable comment?
Here are some charts of grid time offset from 2014 (I think from Menlo Park): http://users.megapathdsl.net/~hmurray/time-nuts/line/Calif-6... -- so you can see this spanning 60 seconds in a year.
[Source post: https://www.febo.com/pipermail/time-nuts/2015-July/092791.ht... ]
Here is some more recent data: http://users.megapathdsl.net/~hmurray/time-nuts/60Hz/60Hz-20...
This is interesting because that's very similar to how the Swiss railway clocks synchronize their time. The second hand takes 58.5 seconds to make one full rotation, and then the clock pauses and waits for a central pulse that comes every minute.
If I'm not mistaken I believe most of their actual station clocks are made by Mobatime, although Mondaine seems to have gotten the rights for the Swiss railway's merchandise, which is kind of sad because they haven't replicated that characteristic and historic smooth second hand and pause-and-go motion on their clocks and watches, and seem to have slapped on a run-of-the-mill cheap ticking quartz mechanism.
I'd love an NTP sync'd wall clock but my time for hardware hacking is pretty limited. Are there any off the shelf wall clocks that do NTP? Bonus points for POE and no WiFi.
It could work anywhere a GPS signal can be locked, no need for an Internet connection.
https://www.timeexpander.com/posts/nixie_kit_1_3/
It currently uses RPi Zero, but I think there is an ESP32 version planned.
What is the PS-1 mechanism?