Sixteen LEDs Clock

by jumbleview in Circuits > LEDs

270 Views, 1 Favorites, 0 Comments

Sixteen LEDs Clock

IMKP5100_acr.jpg

This project presents LED digital clock. While there are only sixteen LEDs, it is twenty four hours clock and it shows time with fifteen seconds precision. Most people will think that telling time looking at this clock would be mind bending. In following steps I'll try to disprove this claim.

Supplies

List of supplies I'll provide at step 6 of this project

Why Do Clock Run Clockwise

BackwardClock.jpg

Here you see backward clock. You can buy such a clock in some stores or form Amazon and even get used to it. While clock looks like a jock there is actually some deep meaning in its design. Neil deGrasse Tyson even dedicated whole Youtube episode to this subject. This episode only fifteen minutes long, but in case you are short in time I'll provide some brief here.

  1. Precursor of mechanical clock was a sundial. During the day shadow of sundial gnomon moves following the sun. Inventors of first mechanical clock built it in such a way that hands of clock moved similarly to shadow of gnomon. This is how clockwise direction appears in our life.
  2. Shadow of sundial moves clockwise only in Northern Hemisphere. In Southern Hemisphere shadow of sundial moves counter-clockwise. If mechanical clock would be invented in some place to the south of the equator clock scale and clock hand movement would be opposite of what we have now. This picture of a backward clock shows us how southern invented timepiece may look.
  3. Apart of clockwise and counter-clockwise movement Neil in this episode discusses how invention of digital clock changed human perception of the time. Mechanical clock makes human think about time from geometrical perspective. Angles between axis and clock hands correspond to the time which passed. Recent invention of digital clock creates illusion of precision but deprives us from this geometric association.

LED clock presented here is a hybrid. It works partially as a regular (like invented in Northern Hemisphere) clock and partially as backward (aka invented in Southern Hemisphere) clock. And I want to think that it is a hybrid in other aspect: while be digital it still gives some geometrical perspective.

Next four steps provide the explanation how this clock works and teach you how to use it to tell the time.

The Clock Model. Sample 1

ezgif.com-animated-gif-maker.gif

To explain this timepiece interface I invite you to play with the web model which I presents here:

Sixteen LEDs Clock Model

In case you don't want to click unknown link you can play with model locally. Here is my GitHub repository

https://github.com/jumbleview/Clock16

You need to copy content of directory p5model to your computer and open file index.html with browser of your choice.

Model has five clocks, which all synchronized and show the same time.

  1. First clock at the left is the regular analogous clock. Nothing to comment here.
  2. Second clock works similarly to the first, apart of the fact that in place of clock hands there are circular arches. Normally clock shows time by angles between vertical axis and hands . This arch clock shows time by angles occupied by arches (outer arch for minutes, inner arch for hours ). Arches start at twelve mark and grows clockwise.
  3. Third model is a half-dial version of arch clock. For hours less than six and minutes less than thirty reading the time is not different of the previous clock: arches start at twelve mark and grows clockwise. But when hours are in the range 6..12 or minutes are in the range 30..60 there is the change. Hands of the regular clock under these conditions are positioned at the left side of dial. But for this half-dial clock there is no left side. Arches here occupy the same right side, but there is change of starting points and direction where arches grow. Under these conditions arches start at the six mark and they grow counter-clockwise. That way clock shows hours from 6 till 12 and minutes from 30 till 60. In other words this clock works closer to normal clock for hours from 12 till 6 and minutes from 0 till 30. Otherwise it works closer to backward (Southern Hemisphere) clock.
  4. Fourth clock is similar to the previous model but arches are dotted not solid. There is no need in dial marks: dots itself are marks. White dots of inner half-dial shows hours, green dots of outer half-dial show time with five minutes precision. Additional one minute precision achieved by a color of the last dot of minute arc. Just add color reading to the time provided by green dots (for cyan add +1, for purple add +2, for red add +3, and for blue add +4 ). This last clock model is very close to the real LED based clock (just substitute dots with LEDs).
  5. And in the second row you can find the digital clock.

Model allows to play with clocks dynamically. Three time modes exist:

  1. Manual mode. Top slider allows to change clock time.
  2. Real time mode. Clock shows current local time on the machine where browser is running.
  3. Simulated mode. Time change is simulated (bottom slider allows to increase or decrease simulation speed).

Clock on the picture here are in the state when clock works closer to the regular clock

The Clock Model. Sample 2

ezgif.com-animated-gif-maker (1).gif

Clock on the picture here are in the state when clock shows hours as the regular clock, but minutes as the backward clock.

The Clock Model. Sample 3

Screenshot-2025-10-11-181611.jpg

Clock on the picture here are in the state when clock shows hours as the backward clock, but minutes as the regular clock.

The Clock Model. Sample 4

Screenshot-2025-10-11-181706.jpg

Clock on the picture here are in the state when clock shows hours and minutes as the backward clock.

This clock has seven lighted dots on the hours scale and seven lighted dots on the minute scale. There is known psychology phenomenon: "Magic Number Seven, Plus or Minus Two". Invented by psychologist George A. Miller, it argues that seven is number of items human can keep in short-term memory to operate. Anything significantly more is out of cognitive capabilities of average person. In this regard clock presented here looks just right. I believe it is easy enough to get used to its interface.


Real clock in place of lighted dots has LEDs. Hours are shown by white LEDs and minutes by multi-coloreed LEDs.

Real clock is different of dot half-dial model by having two more lighting elements.

  1. Central LEDs changes color each fifteen seconds (cyan, purple, red, and blue). When clock is in set mode this LED is dark.
  2. LED on the left part of the clock is AM/PM flag. This LED is OFF during AM half of the day and ON during PM half.

Supplies

PXL_20251007_165222012_web.jpg

Here is list of project components.

  1. Atmega328p Microchip processor.
  2. Five 10mm tri-color common cathode LEDs.
  3. Three 10mm tri0color common anode LEDs.
  4. Seven 10mm white LEDs.
  5. 5mm white LED.
  6. Sixteen 75 Ohm/0.125 W resistors.
  7. Eleven silicon diodes 1N4148.
  8. Schottky diode 1N5817.
  9. Three micro buttons.
  10. Super Capacitor 0.5 MF 5.5 V.
  11. Power down supply LM2596.
  12. Crystal 32768 KHZ.
  13. Opto-pair NTE3042.
  14. Resistor 220 Ohm/ 0.125 W.


Circuit Diagram and Code

clock.jpg
Atmel_Sudio_Prj.jpg

Each multi-color LED consists of three color LEDs, so overall there are 32 LEDs. Single pin in this circuit controls two LEDs.

Circuit has power down supply, which converts 5V power to ~4 v. It is needed to avoid weak LED lighting when chip pin takes in-no-pull-up mode (program set it when LED should be off). Super-capacitor and Schottky diode allows to keep clock running in case of occasional power loss. Opto-pair delivers signal of the power loss to the microchip and program may switch all LEDs off to prolong clock work while power is down.

To program device I used Microchip Studio. Program written in C language and complied by XC8 compiler. AVRISPII interface device allows to upload compiled code to the microprocessor memory.

Code you can find in GitHub repository

https://github.com/jumbleview/Clock16


Some additional information regarding how I built the clock you can find in the project with the description of the previous version of the clock .