Led Clock

Created by @aaruni29

Title: 7 segment LED clock Author: AAruni Description: A OLD STYLE CLOCK created_at: 2025-07-06 Total time spent: 21


July 5 – Ideation, Schematic Design & Core Logic (7 hours)

image

This whole idea began when I was browsing some retro LED displays online. I saw those large-format wall clocks and thought, Why not build my own digital clock with bold 7-segment digits? I didn’t want to use the typical TM1637 or MAX7219 modules – they felt too generic. I wanted to build every segment myself, bit-by-bit, and design the full custom PCB, schematic, and enclosure. This would give me full control over the aesthetics and the logic.

image

I started by finalizing the display layout – a 4-digit 7-segment clock showing HH:MM, separated by two dots in the centre. Each digit had 7 LED segments plus a decimal/dot, and each segment was essentially a bar-shaped LED board controlled via a transistor or direct GPIO through multiplexing. This meant a total of 7Γ—4 + 2 = 30 LEDs, each requiring control logic.

image

image

At the heart of the circuit lies the ATmega328PB-AU microcontroller, selected for its Arduino compatibility and ease of programming via UART. The chip was set up on a custom PCB, powered through a clean +5V rail. A pair of 100nF decoupling capacitors stabilized the VCC and AVCC lines, and the AREF pin was also filtered using a capacitor to suppress noise. For timing, I used a 12MHz crystal oscillator with two 22pF capacitors, connected to the XTAL1 and XTAL2 pins. This ensured accurate clock cycles needed for real-time clock polling and multiplexing refreshes.

The reset circuitry involved a 10kΞ© pull-up resistor and a 100nF capacitor connected to the DTR line. This allows firmware upload via USB-to-serial converter modules by automatically triggering a reset when flashing code from the Arduino IDE or PlatformIO.

image

For timekeeping, I interfaced an I2C-based RTC sensor, likely the DS3231 module. The SDA and SCL lines from the RTC were connected to pins PC4 and PC5 on the ATmega328PB. The microcontroller polls the time regularly and updates the display in real time.

Three push buttons were included β€” one to increment hours, another for minutes, and a third to toggle LED color modes. These buttons connect to PD2, PD3, and PD4, with either internal pull-ups or external resistors as per layout. The input detection was debounced in code to ensure reliable switching.

image

For the visual aspect, I added a WS2812 RGB LED chain, connected to pin PD7. These addressable LEDs would add ambient underglow or animated effects behind the digits. Since WS2812s need a clean 5V logic signal, I connected them directly to the ATmega’s I/O without level shifting, keeping the track short to avoid signal issues.

image

Lastly, UART pins (TX/RX) were routed for firmware updates and serial debugging. Everything was built as a standalone system no Arduino boards involved giving me a compact, powerful, and easily programmable digital clock setup.

image

After reviewing the full schematic in EasyEDA and checking all labels, nets, and power filtering, I finalized the design. The combination of robust microcontroller logic and clean power design laid the perfect foundation for the rest of the build.

image

By the end of this session, I had a full schematic ready: RTC timekeeper, USB-C interface, and transistor-driven 7-segment LEDs. All symbols, labels, and nets were double-checked.

July 6 – PCB Layout, Segment Placement & Enclosure Design (9 hours)

image

With the schematic complete, the next phase was the PCB layout and segment arrangement. I opened the layout editor and placed each of the 7-segment components in a clean 4-digit format, leaving proper space for wiring and dot indicators. I aligned each segment module precisely to maintain consistent digit spacing. Two centre dots were added to separate hours and minutes.

image

I began routing the control signals one pin for each segment per digit, using MOSFETs for current sinking and multiplexing logic. The digit select lines were grouped separately, and every segment had a 220Ξ© series resistor for current limiting. Screenshot 2025-07-07 224607

BRUHH easyeda is baaaad so imported into easyeda pro so i can design case too

Routing the PCB was like solving a puzzle. The top layer handled horizontal signal paths while the bottom managed vertical routes. I used thick traces for power lines and ensured solid ground planes across both layers to minimize noise. GND vias were generously placed to connect planes and stabilize return paths.

Screenshot 2025-07-07 222436 Screenshot 2025-07-07 222512

Screenshot 2025-07-07 222519

Once routing was done, I exported the board as a .step file and imported it into Fusion 360. There, I created a custom enclosure β€” a black PLA case with mounting holes and a faceplate cutout to expose only the segments. The faceplate was designed in white for contrast, with tight tolerances to avoid light bleed. I also left room for USB, buttons, and side vents for future expansion.

Screenshot 2025-07-07 220132

Screenshot 2025-07-07 221834

Screenshot 2025-07-07 215344

Screenshot 2025-07-07 220140

Screenshot 2025-07-07 221844

To visualize everything together, I created 3D renders β€” top view, angled views, and even an exploded render showing the layers. The assembly started feeling like a real product, not just a DIY hobby.

Screenshot 2025-07-07 230028

Screenshot 2025-07-07 230017

Screenshot 2025-07-07 230008

July 7 – BOM, Firmware Setup & Final Touches (5 hours)

Today was mostly focused on wrapping up the project and preparing it for production. I began the day by finalizing the Bill of Materials (BOM).

Screenshot 2025-07-07 233036

With the BOM ready, I exported the Gerber files from EasyEDA and uploaded them to JLCPCB. I opted for five boards with a black soldermask and HASL finish to match the visual aesthetic I had in mind. For convenience, I selected partial assembly (PCBA) for two of the boards β€” getting the ATmega328PB, USB port, oscillator, and passive components soldered directly at the factory. This decision saved me from the tedious and error-prone process of hand-soldering fine-pitch QFN parts. The total cost came to around β‚Ή2,000 for the bare PCBs and β‚Ή2,800 for the partially assembled units, excluding shipping. I chose mail for delivery

I shifted focus to firmware development. I used the Arduino core for ATmega328PB, which made setting up the code straightforward. The microcontroller was programmed to fetch the current time from the DS3231 real-time clock (RTC) module every second and convert it to HH:MM format. This information was then sent to the display via multiplexing logic. Each digit was refreshed rapidly using a timer interrupt, so that only one digit was active at a time, but all appeared to be constantly illuminated due to persistence of vision.

image

tried out code given by random yt it kinda kinda worked

For user interaction, I implemented input handling for three buttons. One button incremented the hours, another adjusted the minutes, and the third toggled between RGB color modes for the WS2812 LEDs. All button inputs were debounced in software to ensure smooth performance. The colon LEDs between the hour and minute digits were programmed to blink every second, mimicking the behavior of commercial digital clocks and adding a bit of life to the display. I also integrated simple animations for the WS2812 RGB LEDs, allowing subtle transitions based on the selected color mode.

HOPE IT GETS APPROVED :)