Copyright (©) by Arvin Schnell
The clock is synchronised via the German time signal DCF77. It has a display with automatic brightness control and a RS232 computer interface.
The clock is built around a PIC16F84 microcontroller from Microchip. I chose this microcontroller since its FLASH memory is easy to program and assembler and programmer software is freely available for GNU/Linux. It has 13 general input/output pins which is just enough to implement all the feature I wanted.
Display with Brightness Control
The 6 7-segment LEDs are multiplexed with a frequency of 100 Hz. A simple combination of a 74138, 74247 and some transistors is used. With more I/O pins on the microcontroller, one could save the two chips but the current might be to high for a microcontroller.
The brightness of the LEDs is controlled by the ambient light. This is achieved by varying their illumination time, also known as Pulse Width Modulation. Whenever a new 7-segment LED is switched on, a capacitor is discharged. The capacitor is then slowly charged. When the voltage at the capacitor gets higher than the reference voltage determined by the A1060 photocell, the display is blacked out.
RS232 Interface
The hardware part of the RS232 interface is straightforward. Two pins of the PIC16F84 act as RX/TX, and MAX232 does the conversion from TTL to RS232 signal level.
The software part is more interesting. Since the PIC16F84 does not have an USART, the coding and decoding of the serial signal is entirely done in software. This is suboptimal since the PIC16F84 does not have interrupts for any I/O pins, so the software must constantly poll the RX pin. You can get example code from Mircochip for this. But as a consequence, the main code for analysing the radio signal and driving the display is called from the RS232 code and is only allowed to use a limited amount of time. This amount of time available decreases with higher serial speeds, so the highest possible speed with this design is 1200 Baud. Next time I would definitely use a microcontroller with a build in USART.
Radio Signal Receiver
The radio signal is demodulated with an U4224B by TEMIC Semiconductors. The digitised serial signal is displayed by a LED and fed into to PIC16F84. The U4224B together with the ferrite antenna are placed in a separate box to keep circuit noise emission from the antenna and to allow perfect alignment of the antenna.
Don't expect a detailed construction plan here. The real fun is designing and programming a clock like this. If you simply want a clock in your living room or keep your computer clock accurate you will find cheaper solutions in the next shop.
PDF with circuit diagrams and board layouts: dcf77.pdf
Archive containing PIC assembler code, circuit diagrams, board layouts and control software for GNU/Linux: dcf77.tar.bz2
Where can I order the U4224B?
Sorry, but I don't know. As far as I can tell it's not manufactured anymore.
Last modified 15th March 2007 | Copyright (©) 1998 - 2007 by Arvin Schnell |