In this document I describe the device I built for controlling a railway clock.
There is also a video available, much less serious than this document:
The video is in Polish language but subtitles are available in English and Polish:
The video is also available on youtube (with subtitles available as well):
I have a railway clock produced by KZŁ. This kind of clock can't work on its own but it requires a master clock which will provide a 24V signal every minute: +24V every even minute and -24V every odd minute. This will make the clock advance its position by 1 minute.
This kind of mechanism works very similarly to a more familiar quartz mechanism, with the difference that here it moves the minute hand every minute instead of moving the second hand every second.
So I needed to create a device which would fulfil the role of a master clock. Actually, I already received such device together with the clock but it did not meet my requirements. There is nothing wrong with it, it works well, but I made up some other requirements and wanted to create my own device according to them.
The device I received (not the one I built):
I wanted to create a device which:
A very simple power supply is used. A transformer with its output side split in half. Both sides go through a diode and capacitor to produce a rectified DC supply.
I chose to use a transformer with output split in half because the 24V needed by the clock is too high for the ICs I used. This allows them to be powered by 12V instead.
The transformer which I had available produces slightly higher voltages. So wherever the schematic says 12V it's actually 15V and where it says 24V it's 30V. Luckily the clock still works at 15V.
The same transformer which supplies power also supplies a 50Hz reference. Or rather a 100Hz reference as I'm counting each half separately. The half waves go into the 555 IC which compares the levels internally and switches its output when thresholds are crossed. This produces a 100Hz square wave. The ON and OFF times are not equal but that's not a problem.
The power supply frequency is actually a good time reference (in many countries, but not all).
There is a circuit for creating a reset pulse based on a 555 IC. While the capacitor is charged after connecting power the output is high and after reaching a threshold it goes low and stays there.
This is resetting the counters and flip-flop used in other parts of the device.
The 100Hz signal has to be divided to produce signals with a lower frequency. An output pulse must be produced every minute and its duration should be slightly less than 1s.
I decided to use the pulse duration of 0.75s ands 80 such pulses each minute. This means dividing the 100Hz by 75 and then by 80. Other values can be used as long they give 6000 when multiplied. The pulse should be long enough that the clock manages to move to the next minute in that time and short enough that it's possible to set the time without waiting forever. If the power supply frequency is 60Hz then the 2 factors multiplied should give 7200.
Two 4029 counters are used together in binary countdown mode to make an 8 bit counter. The 100Hz signal is used as the clock signal. Wherever the PRESET ENABLE is high the counter is preset to a value selected by jumpers. I use the value 75 (and NOT 75-1=74) to divide by 75.
With each rising edge of the 100Hz signal the counter counts down by 1. When 0 is reached, the CARRY OUT output goes low. This output, inverted, goes into a 555 IC. This is to filter out any very short pulses which might appear there before really reaching 0.
This filtered output is used as the tick signal in the next stage. Also it is indicated by an LED.
This signal is then OR-ed with the 100Hz signal and inverted. This OR-ed with the reset signal goes into the PRESET ENABLE input which resets the counter.
The OR with the 100Hz signal is needed. This makes the CARRY OUT signal to remain low as long as the 100Hz clock is high. Otherwise the counter would be reset immediately producing a very short pulse.
The second dividing stage is very similar to the first one. Here the input clock signal is the tick produced in the previous stage. The preset value is such (I use 80) that the resulting output is exactly 1 BPM.
There is one additional thing not present in the previous stage. The CARRY OUT signal can be replaced by the lowest bit of the counter (inverted or not - selected by jumper) if a button is pressed. It should be inverted if the preset value is odd and not inverted if the preset value is even. This causes the output signal be generated at each tick, to allow setting the time.
The 1 BPM signal goes into a 4027 J-K flip-flop. At each rising edge its output is flipped. The 1 BPM signal is OR-ed with both the straight and inverted output. This way each minute only one of the signals is activated.
And if the button is pressed the signals appear without the 1 minute delay.
Each of these signals is turning on a relay which connects the clock to the positive or negative voltage taken from the transformer and rectified with a diode and capacitor. A jumper allows to select 12V or 24V. (or currently 15V and 30V)
I build a case from leftover wood pieces. The front wall I made from transparent plastic. I attached a button and the power input connector and the output connectors. Also 2 metal pieces for hanging it on the wall.
If more than 1 clock is used some additional steps are required when connecting for the first time: