← Products & Projects

ArduinoClock

Arduino-based alarm clock with 7-segment display, buttons, and a buzzer — hardware and firmware together.

Visit site →

Story of the Project

On 2013, I got introduced to the electronics world by a teacher who enrolled us in some robot competitions. Although I didn’t get to learn much about the low-level part, I got familiar with Arduino, the programable board we used to control different peripherals, such as motors or sensors.

Later on, at college, I learnt more about circuits, filling the gap I had, and I decided to buy my own Arduino to build things. I was very excited, as all the projects I had work on previously were pure software running on a computer or phone.

I built two versions, one in 2015 that was a bit chaotic and a second version in 2018 with

Source, schematic, and setup notes live on GitHub.

Videos

2018 — Arduino Pro Mini

Four-digit display on a bakelite board.

2015 — Arduino Uno

Earlier build, with an LED that stays on while the alarm is armed.

Things I learnt

Multiplexation. Controlling 4 displays with a few pins.

Digital clocks have 4 7-segments displays. Each segment is controlled individually, for example, to produce a 1 in one of the displays, you’ll need to send 5 volts to the two segments that form the number 1. Having 4 displays with 7 segments each means that we have 28 segments in total that we need to give voltage or not in order to form all the numbers represented in the clock.

This job (sending voltage to the displays) is done by the Arduino, which is the brain of the project. However, Arduino just have 20 output pins. Therefore, we cannot control 28 segments directly, as we would need 8 additional pins. Even if we had those missing pins, we would need even more to control the buzzer and buttons.

To address this issue, I used a technique called “multiplexing”. At any given time, only one of the 4 displays is on, so we just need 7 pins to control the number. After a few milliseconds, we switch that display off, turn the next on and use the same 7 pins to determine the number rendered in the next display. Given the high frequency at which this happens, the human I doesn’t notice that only one display is on at any given moment.

With this technique, we just need 7 pins for the number, and 2 more to determine which of the 4 displays is on. Two transistors are the ones in charge of acting as switches that we control from the Arduino.

Tech Stack / Components

  • Arduino (Uno / Pro Mini)
  • C++ firmware (.ino + modules for display, buttons, chrono, tone)
  • CD4511BE BCD-to-7-segment decoder
  • Common-cathode 7-segment displays, buttons, buzzer, discrete passives
  • MIT licensed

Current Status

Open source on GitHub. A finished hardware project rather than something still shipping — useful as a reference build and for anyone recreating the schematic.