Plan the LED count, choose between BCD and pure binary layouts, then wire the circuit to keep accurate time. The steps below cover the decisions to make before soldering a single joint.

Choose Your Display Layout BCD vs Pure Binary

Decide how to represent the time. Two layouts exist: BCD (binary coded decimal) and pure binary. Each needs a different number of LEDs and a different wiring plan.

BCD Layout

A BCD clock shows each decimal digit of the time as a separate binary number. For a clock that displays hours, minutes, and seconds (HH:MM:SS), buy 20 LEDs. The breakdown: hours tens 2, hours units 4, minutes tens 3, minutes units 4, seconds tens 3, seconds units 4. Omit seconds and a BCD clock needs 13 LEDs.

Pure Binary Layout

A pure binary clock treats each time component as one binary number. Hours (0 to 23) need 5 bits. Minutes (0 to 59) need 6 bits. Seconds (0 to 59) need 6 bits. That totals 17 LEDs. Without seconds, a pure binary clock needs 11 LEDs. The maximum binary values are hours 23 = 10111 and minutes 59 = 111011.

Your choice sets the LED count and the wiring complexity. BCD is easier to read at a glance because each decimal digit is separate. Pure binary is more compact and uses fewer LEDs.

Count the LEDs You Need

Use this table as a quick reference after choosing a layout.

  • BCD clock with seconds (HH:MM:SS): 20 LEDs
  • BCD clock without seconds (HH:MM): 13 LEDs
  • Pure binary clock with seconds (HH:MM:SS): 17 LEDs
  • Pure binary clock without seconds (HH:MM): 11 LEDs

Each LED represents one bit. In a BCD clock, bits group by decimal digit. In a pure binary clock, bits group by time component (hours, minutes, seconds).

Wire the LEDs and Add Resistors

Put a current limiting resistor on every LED unless you use a dedicated driver chip. Without one, the LED draws too much current and burns out or damages the controller. Connect one resistor per LED between the LED and the power source.

Wire the LEDs in rows that match the bit positions. In a BCD layout, each decimal digit gets its own row. In a pure binary layout, hours, minutes, and seconds each get one row.

  1. Assign each LED a bit position (bit 0 is the least significant bit).
  2. Connect the positive side of each LED through a resistor to a digital output pin on the controller board.
  3. Connect the negative side of all LEDs to a common ground.
  4. Test each LED individually to confirm it lights when the corresponding pin is high.

Using a driver chip? Follow its datasheet for resistor values. For a direct connection to the controller, pick a resistor value that limits current to a safe level for both the LED and the output pin.

Keep Time with a Real Time Clock Module

Internal clocks on microcontrollers drift. A battery backed real time clock (RTC) chip fixes this. The RTC keeps correct time even when power is off, so the clock shows the right time after an outage.

Connect the RTC to the controller using its communication protocol, usually I2C or SPI. Write code that reads the current time from the RTC on startup and updates the LEDs. Set the RTC once, either with buttons on the clock or by programming it from a computer during assembly.

Assemble the Circuit and Test

Layout chosen, LEDs counted, resistors wired, RTC connected. Now assemble the full circuit.

  1. Mount the LEDs in a panel or enclosure in the correct order for your layout.
  2. Solder or connect the resistors to the LEDs and the controller board.
  3. Connect the RTC module to the controller.
  4. Upload the firmware that reads the RTC and lights the appropriate LEDs.
  5. Power the circuit and check that the displayed time matches the real time.

LED not lighting? Check the resistor, the connection, and the pin assignment. Time wrong? Verify the RTC is set correctly and the code converts time to binary properly.

Consider Enclosure and Power

Build the enclosure last. Wood, acrylic, or a 3D printed case all work. Keep the LEDs visible and the RTC battery accessible. Power the clock with a USB cable or a wall adapter. On battery power, the RTC keeps time during a loss, but the LEDs stay dark until power returns.

The controller board runs from the same USB cable that powers the LEDs. Check the total current draw of all LEDs and add margin so the power supply is not overloaded.