Electronics | Approximate Hour Clock

This is a version of a clock that only has 12 LEDs. As time progresses, these LEDs turn successively on and fade out. Depending on the relative brightness of two LEDs, we can estimate the current time (e.g., 1/4rd 14h00 and 3/4rds 15h00 implies 14h45).

The circuit uses a stand-alone ATMega328P (driven by an external 16 MHz crystal) in order to lower the total power consumption. All chips sit inside their own sockets. To connect the circuit to an external battery or power adapter, it also contains a U-Reg +5V 1A TO220 voltage regulator with a source rectifier diode for protection. In addition, the PCB contains extra circuitry to easily flash the CPU (e.g., after updating the code), by connecting the PCB to an empty Arduino board connected to a PC. The circuit continuously tracks time (even when not powered), by means of a DS1302 real-time clock (RTC) fitted with a 3V coin cell battery. The total current draw of the circuit is about 25mA. At a 5V supply voltage this leads to a total power consumption of about 125mW.

The 12 LEDs are controlled by 2 Texas Instruments SN74HC595N shift registers, each driving 6 LEDs. One shift register controls all the even LEDs, the other one all the odd LEDs. The output enable (OE) pin of each shift register is connected to an Arduino PWM pin, allowing to dim each couple of consecutive LEDs separately. Because a linear increase in the LEDs' PMW cycles does not result in a linear increase in brightness, we have corrected these cycles by logarithmically transforming them so they appear more natural and smooth to the human eye. There is also a button installed that, when pressed, switches between normal clock mode and a lightshow that cycles through all the LEDs in sequence.

Arduino sketch

RTCDS130x library

ButtonDebouncer library

GeneralTools library

Demonstration of lightshow (mp4, 17.88 MiB)

Electrical diagram:

Assembled and soldered circuit board: