Picture of Arduino-based master clock for schools
If your school, or kids school, or other location relies on a central master clock that is broken, you may have a use for this device. New master clocks are available of course, but school budgets are under extreme pressures, and it really is a satisfying project if you have the necessary skills.

This master clock controls the signals sent to the slave clocks, and keeps them synchronized. The firmware in the clock currently supports the National Time synchronization protocol. The master clock also controls the bells that can be set at scheduled times during the day. The firmware in the clock currently supports two bell zones (indoor and outdoor bells).

The firmware in the clock also automatically adjusts to daylight savings time (this can be turned off). This library might also be useful for other  clock-projects (make sure to  also get the modified DateTime  library).

The clock is set up by connecting it to a computer via the Arduino USB port, and running a Java control program with a GUI interface. Once the time has been set, and a bell schedule loaded, the computer can be disconnected.

The design of the clock emphasizes simplicity, with a minimum of controls. Any complex setup is better handled by running the control program on a computer and temporarily connecting to the clock.  The picture shows the front panel of the clock. The switch allows bells to be turned off completely if bells are not wanted (holidays, teacher training days etc.) The LEDs are normally all green, anything else indicates an unusual state.
Remove these adsRemove these ads by Signing Up
Superb project,
Please instruct me how to set alarm without using java programming i.e only use of hyper terminal etc, Bcz Java code doesn't work in my system.And please send schematic i would be a great help to me.
JonIrving1 year ago
This is awesome - I realise this is an old project but it's a perfect solution for multiple automated bells in the small factory I work in. Is there a way to get a schematic for this?
AJC8942 years ago
could it start a motor instead of a bell
zzebrowski3 years ago
Just a quick note to say that this is an awesome project.
pyperdown3 years ago
Most cool. Looking to replace a brain-dead (no NTP support) expensive dukane controller. Has this been tested with Dukane clocks, to your knowledge?
tobyasz4 years ago
Nice instructabe!
How do I download the schematics?
 A schematic would be reeeaaaaaalllllllyy helpful!  I've got an old school slave clock that will look great in my kitchen, and is my reason for getting into arduino projects (and, by extension, electronics).  So a schematic would be a huge help!
niamheus4 years ago
As an art project, I need to stop an analog clock (which would most likely be a slave clock) for 2 minutes and restart it after the two minutes have passed. The clock then needs to switch back to display the correct time. Could you think of a way of doing this?
MasterClockMaker (author)  niamheus4 years ago
Hmm. The slave clocks in the school run on 24V 60Hz, and they just keep running. The correction signal, depending on length, moves the hands to the next hour, or to six o'clock. You might be able to use these, 2 cases:
(1) You only stop the clock 2 minutes before the hour, and then apply the correction signal on the hour. You could only stop/start once per hour though.
(2) If you used a higher frequency (120Hz) the clock would run twice as fast, maybe that could be useful? 

It would be so much simpler with a digital clock! 

Perhaps taking an analog clock apart could help, I don't know exactly how they work. 

Also, there are other slave clock protocols. Some advance only when sent a signal by the master clock. I think these are referred to as "impulse" control. I don't think they have second hands though. Maybe driving the second and minute hands separately somehow can achieve what you need. 

Sorry I don't have a clear answer. I'll think some more and try to come up with something!
Hmm, I didn't even know there was a correction signal. how does that work?

I could go with option 1 then.

How does the master clock know the position of the hands on the slave clock?

Thanks for replying so quickly.

MasterClockMaker (author)  niamheus4 years ago
 The master clock does not know the position of the hands, but after the hourly sync (I said correction, but sync is better) the slave clock minute hand will be in a known state. Similarly, after the 12 hour sync, the hour hand will be in a known state. The second hand just keeps going. 

So if the slave clock is slow, it will be corrected. If it is a little fast, nothing happens (I think), if it is very fast (or ahead), it will be an hour ahead after the sync. Hence the 12 hour sync, when everything will be 6 (pm or am looks the same). 

There are some different protocols. "My" clocks use the National, or Standard Time protocol. There are some other similar, but slightly different ones. 

For you, it would be a simple matter to cut the power for two minutes, and the  clock hands would not move (not the second hand either). Turn on the power and it moves normally, except that it is 2 minutes behind. Apply the sync signal (for 25 seconds in my case) and the clock hands move fast to the next hour. 

I hope this helps
Ok, I'm not sure if you''ll know much about this but I though I mite as well ask.

On a radio controlled clock mechanism, when the battery is inserted, the clock turns to 12. It then stops and waits for the correct signal. If the signal is recieved, the clock turns to the correct time. If the signal is not recieved, the clock starts operating as a quarts mechanism from 12.

Do you know is there any way we could make the clock work as a quarts movement without waiting for the signal?

Thanks Niamh
MasterClockMaker (author)  niamheus4 years ago
I don't know much about radio-controlled clocks.
Maybe if you take one apart it would be clearer. 

Regular quartz clocks can be manipulated. They have a simple 
motor that takes (~1.5V) pulses of alternating polarity, one short 
pulse per second. If you generate these pulses (say with an Arduino) 
they can be slower or faster in any way you wish. If you stop the pulses, 
the clock will stop. If you send 10 pulses every second, the clock will 
move 10x as fast, the second hand moving around the dial in 6 seconds!
It is tricky and unreliable to make it go backwards, as the direction is 
designed into the metal parts of the motor (people make clocks that go backwards by flipping this piece of metal). 

Anyway, If you use this idea, the clock (especially the second hand) 
will move quickly as you "catch up" to real time. Using electronics 
to generate the pulses allows for a lot of flexibility. 

Let me know if I need to explain more. 
Good luck!
spudstud4 years ago
 To me it seems like the jar file is broken. I am unable to download it. Your file would be perfect to experiment with since I have often dreamed of getting a java program to interface with my arduino. 
MasterClockMaker (author)  spudstud4 years ago
 Apparently Instructables renames the files to "something-weird.tmp"
Just change the name of the file you download to what it is supposed 
to be, and it should work. Let me know if there is a problem. It should 
definitely work on Mac OS X (it may not find the right port on Windows). 

I'll see if I can get you the source code somehow, that would probably 
be more useful for you. 

The easiest communication is just by using the serial console in the 
Arduino IDE. That's a good place to start. 
(removed by author or community request)
Neither, just an involved parent!

And yes, you can use the code for an alarm clock or any kind of timer. 
The shift from daylight savings and back again has worked beautifully. 
KC0GRN5 years ago
I wonder if this system could be used in a smaller scale, and without the slave clocks.

Here is my situation. My church has a manual electric buzzer system (push one of the 3 buttons in the church and the buzzers go off, it only buzzes for as long as you hold the button) for signaling Sunday School, Church and Wednesday night programs.

What I thought would be nice is to have an arduino controlled clock to automatically sound the buzzers at the proper time intervals, and for the proper length of time, like a short or a long buzz to signal a 5 minute warning.

Obviously this doesn't need slave clocks, it just needs to operate a relay switch to take over for the manual buzzer buttons.
MasterClockMaker (author)  KC0GRN5 years ago
 Yes, this should be simple enough. You do not have to connect the slave clocks. You do not have to connect the bells. You do not have to connect the LCD. It's mix and match! 

Right now the bells only go off Monday-Friday, and the duration is always the same (but adjustable). Right now there are two bell "zones", but it shouldn't be very hard to add one more (need to change the Java controller software a little though). 

Let me know if you need more help.
randofo5 years ago
Oh man. I wish I had this Instructable when I was in high school. I can think of some mighty fun ways to use this knowledge to get expelled.

Great Instructable.
MasterClockMaker (author)  randofo5 years ago
Yes, there are some fascinating possibilities! There is a good reason no Ethernet shield is used for this project even though that would have allowed for an automatically setting clock (using internet time servers). Some fully-featured master clocks for sale do have this feature...

cyrozap5 years ago
My spanish teacher currently does not have a clock in his class, so it's annoying for everyone who wants to know what time it is. He's trying to get a new clock, but the beauracratic system is insanely slow, and him getting a clock is a low priority. The clocks that are in other classrooms look like the clock you took a picture of, and there are 4 (I think) wires that would go into the clock. Could you possibly give me some information on how to make a slave clock? I am very good with technology (I built a MakerBot, #000117) and have an arduino, so this should be a piece of cake.

Maybe it could have 4 large 7-segment diplays made by using 1 led each and diffusing plastic. I have the LEDs on hand.
MasterClockMaker (author)  cyrozap5 years ago
The easiest solution and most low-tech, but also the least fun, is just to go to Stapes (or whatever) and get a large battery-operated clock to hang on the wall.

If the classroom has the wires already, then you could attempt to build a slave-clock. Beware that the wires could be 120V AC. The slave-clocks in the school where I installed this master-clock run on 24V AC. There are three wires for the clock, hot, neutral, and synchronization. There are a couple of other wires for the PA system housed in the same cabinet (also used for the bell signals).

The protocol for "my" slave clocks is that the sync wire goes hot on the hour for 25 seconds, except at 6 am and pm, where the signal lasts 25 minutes. To build a slave-clock, you just need a "regular" arduino clock, with some sort of connection from the sync wire to an arduino input. A diode and then two resistors (say 10K and 1K) with a capacitor (say 10 microF) in parallel. The Arduino ground goes to the neutral wire, and the Arduino input senses the voltage over the 1K resistor (this is assuming 24V AC on the sync). The Arduino input can only handle up to 5V (DC of course).

You add some code to a basic clock that senses when the sync signal goes on, and when it goes off the clock should display either X:00:25 or 06:25:00 depending on the length of the sync signal and the time (X) when the sync signal started. Thus if your clock is a little slow or a little fast, it can adjust on every sync.

Good luck! And if you are building a slave-clock, feel free to ask more questions.
mman15065 years ago
 oh that happend at are school every 5 minutes it went into "time travel mode"
indivara5 years ago
Just out of curiosity (since it is unlikely I'll get a chance to do this) -
* How do you interface the master clock to the other (slave) clocks? What kind of signal do they expect? Are they wired or wireless?
* Is the clock protocol openly available? (The manufacturer you mentioned doesn't appear to disclose anything)
MasterClockMaker (author)  indivara5 years ago
The slave-clocks are wired. There is one wire that carries the synchronization signal, 25 seconds on the hour every hour, except at 6 (am and pm) where it is 25 minutes (12 hour sync). There are other protocols.

Even though the manufacturers themselves do not disclose the protocols, they can be found on the internet.