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 adjacent LEDs, we can estimate the current time (e.g., 1/4rd 14h00 and 3/4rds 15h00 implies 14h45). The idea is that if we do not need to know the exact time, a sufficiently close estimate idea will do.

The circuit uses an Arduino Nano. To connect the circuit to an external battery or power adapter, it also contains a barrel jack connected to an efficient LM2596 DC-DC switching regulator (adjustable buck converter module). It can take up to 50 V on the input side and is adjusted to convert it to approximately 7.2 V. There is a source rectifier diode right after the output side, preventing power flowing back into the module when the circuit is powered/programmed through the Arduino Nano's USB port. The available voltage to the remaining system is then 5 V. The circuit continuously tracks time (even when not powered), by means of a DS1302 real-time clock (RTC) fitted with a 3 V coin cell battery (connected to pins A0, A1, and A2). The total current draw of the circuit is about 25 mA when only two leds are active.

The 12 LEDs are controlled by 2 SN74HC595N shift registers (connected to pins A3 and A4 for shift and latch registers, and pins D2 and D4 for data transfer), each driving 6 LEDs. One shift register controls all the even-hour LEDs, the other one all the odd-hour LEDs. The output enable (OE) pin of each shift register is connected to Arduino pins D5 and D6 for pulse-width modulation (PWM), 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 (connected to pin A5) that, when pressed, changes the operational mode of the clock: a short press puts the clock in hour/minute/second mode, where the hour is approximately shown, together with an indication of the current minute of the hour and the current second of the minute. A longer press of about one second, switches between showing only the approximate hour and current minute of the hour, or only the approximate hour. A very long press of over two seconds activates a light show that cycles through all the LEDs in sequence. Finally, during night time, all LEDs turn off until the morning.

Arduino sketch

  • Preliminary testing and demonstration

  • Operational test
    PWM on the oscilloscope
    Startup sequence
    Light show
  • Finished product