Tri-color LED Clock

by zjarrell in Circuits > Clocks

274 Views, 0 Favorites, 0 Comments

Tri-color LED Clock

Picture3-cover.png
Picture1.png

This is a simple spin on your typical LED binary clock. I'm a big fan of binary clocks in concept, but I don't like how they look. I realized that you could make this type of clock much more visibly pleasing and easier to incorporate into a design (no grid required) by using 4 tri-color LEDs instead of 13 LEDs. This build will be the third of these that I have built. I am not demonstrating how to make a housing, but I'll share the two that I have used. It's a very easy mechanism to get creative with how you're going to house it.

Supplies

Non-consumables for programming ATmega328p:

1 Arduino Uno (I think most Arduino's will work for this, but I always use an Uno)

serial cable

breadboard

PC

set of jumper wires


Consumables for clock:

1 prototyping board

1 5V 2A DC power supply

1 ATmega328p chip

4 tri-color LEDs (I used these)

3 tactile buttons

2 20 pF capacitors

1 16 MHz crystal

2-4 100 Ω resistors

7-8 10 Ω resistors

3-4 47 Ω resistors

Small gauge wire, preferably at least RGB and a fourth color. I use 24 gauge.

Bootload and Program ATmega Chip

IMG_8679.jpg
Screen Shot 2023-02-22 at 8.37.17 PM.png
IMG_8680.jpg

Prep the ATmega328p. There are several guides both on Instructables and elsewhere that will walk you through this. I follow the one provided by Arduino. Follow the "Burning the Bootloader" and "Uploading Using an Arduino Board" sections. In short, first you'll use your Arduino Uno and the Arduino IDE to burn the bootloader onto an ATmega328p chip. This will make the ATmega (with crystals and capacitors for the clock) function like a very "bare bones" Arduino. Second, you'll load your the program needed for the clock to your bootloaded ATmega. (Don't forget to remove your Arduino's own chip when loading the program!)


The program is the tricolor_led_clock.ino file below. I need to cite another Instructables user here. This program is just a modified version of a program written by Emiliano Valencia.

Solder Your Board

wiring-diagram.png
Picture2-wiring.png

Wire up and solder your board according to the diagram. The circuit, as written, will favor cool colors (the blue LEDs will be on more frequently than the red LEDs). This is my personal preference. You can easily reverse this. Just swap blue for red and red for blue in the diagram, and be sure that you use a 47 Ω resistor wherever you use red and a 10 Ω wherever you use blue and green. This difference in resistor use is because red LEDs have a much lower voltage drop than green and blue. This is why the count of resistors needed in the supply list are not exact, it may change to your preference and how you decide to lay out the board.

Create a Decorative Housing for the Clock

vase-design.png
mobile-design.png

There are a ton of possibilities for what type of housing you put this in. The most important part is that you mount the LEDs so that they shine into a refractive material. It will make the clock easy to read from far away. Here are pictures of the two designs I have come up with.

The first just used a dried tree branch. I planed down the bottom, used a drill press to make holes for six tall jars (I think they came from a wine sample subscription a friend had) to sit in, and then I carved out a cavity in the bottom of the branch to hide the board in. It had two jars for hours on the left, two unlit jars (meant for cut flowers to go into) and then two jars on the right for minutes. The four lit jars were filled with water with just a little bit of corn starch in it.

The second is what I settled on keeping in my apartment. It's a mobile that holds round jars filled with glass beads, and the wires for each LED are braided together and then braided into the string holding the jars, with the board mounted on top of the mobile. The two highest jars are hours, and the two lower are minutes.

Learn How to Read the Clock

F86GKZCLELEJ9C1.png
vase-design-labeled.png
mobile-design-labeled.png

Reading the clock requires knowing how a binary clock works and a understanding some basic theory. As it is designed, the LEDs have the following values when on:

Low value minute and hour LEDs:

B: 1

G: 2

R: 4

High value minute LED:

B: 8

G: 16

R: 32

High value hour LED:

B: 8

G: 16

16 is the highest value needed, so the R lead is not used.


You simply add up the value of each LED that is on to get your hour and minute values.

You may need to use the RGB color model to determine which LEDs are on. If the LED is red, blue or green, interpretation is simple. If it is yellow, both the red and green for the given LED are on. If it is cyan (light blue), blue and green are on. If it is magenta, red and blue are on. If it is white, all three RGB leads are on. I have several examples uploaded here. Values are listed for each color on each LED, and the bolded values are the ones currently engaged in the picture.

Hope you enjoy! After a few days practice, you'll get really quick at reading it. It's a great conversation starter to have hanging up in your home. I love it when guests notice that the lights are changing incrementally and ask me what they're looking at.