Arduino Project: LED Countdown Clock
As mentioned in my previous hobby post I’ve been working on learning the Arduino micro controller. Up until now I’ve been doing small projects that would work with a single component or two working on their own.
My first attempt at bringing a few different sensors and controls together is an LED Count Down Clock. What does it do? It is a single 7 segment LED that when a button is pushed counts down to 0 and beeps. Pretty straight forward but a fun little learning project. Here’s a quick video that gives you an idea of what it does:
Pretty simple, here’s what’s involved:
You end up with something that looks like this:

The wiring is a bit interesting – figuring out how all 10 of the connections coming off of the LED map is an interesting exercise but with the datasheet isn’t terrible to figure out. Hooking up the buzzer and the button is two wires a piece and straight forward (one to power, one to a controller port on the Arduino).
The basic program is pretty straight forward. I wrote two libraries – one to control the rendering of numbers on the LED and one to drive the sound options. Here is what the main program looks like:
// Main Program
int val = 0;
int oldVal = 0;
int state = 0;void setup() {
// initialize the digital pin as an output:
pinMode(8, OUTPUT);
pinMode(1, OUTPUT);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(button, INPUT);
pinMode(speaker, OUTPUT);
}// the loop() method runs over and over again,
// as long as the Arduino has powervoid loop()
{
val = digitalRead(button);
renderClear;
if ((val == HIGH) && (oldVal == LOW)){
state = 1 – state;
delay(10);
}oldVal = val;
if (state == 1) {
renderCountdown();
buzz(speaker, 2500, 1000);
state = 0;
}
}
So there’s version 1.0 of my LED countdown clock. I’m already starting to plan for my second version of the project which will have the following feature set:
- Two 7 segment LEDs powered by a multiplexer
- Two buttons – one to start the countdown and one to allow you to select how much time you want on the countdown (I’m thinking of having it selectable by 5s or 10s)

I cannot wait to see what this year will bring…