Picture of Arduino Countdown Timer
The Arduino Countdown Timer is a fun weekend project for beginners who wants to move on to something slightly more advanced. The timer controls two 7-segment displays which count down from 99 to 0, and can be stopped and started using a button. When the timer reaches 0, the display flashes and a buzzer beeps. This project is ideal for timing any life activity that happens in 99 seconds or less.

An interesting thing about this project is that the two displays collectively have 16 pins which are used, but the Arduino is able to control both using only 9 pins thanks to a technique called mulitplexing. This technique allows only one light to be on at any given time by connecting them together and then letting the Arduino control which display gets connected to ground. Even though only one light can be controlled at a time, thanks to the phenomenon of persistence of vision, if both lights are flickered on and off in series fast enough, we perceive them to both be on all the time. While this may seem complicated, this is actually a commonplace technique for controlling LED displays.

Get experimenting and see for yourself by building your own!

Step 1: Materials

Picture of Materials
You will need:

(x1) Arduino Uno (Radioshack #276-128)
(x2) 7-segment display (Radioshack #276-075)
(x1) SPST momentary pushbutton switch (Radioshack #275-646)
(x1) M-type coaxial power plug (Radioshack #274-1569)
(x2) 220 ohm 1/4 watt resistor (Radioshack #271-1313)
(x1) 10K ohm 1/4 watt resistor (Radioshack #271-1335)
(x1) Grid-Style PC Board (Radioshack #276-149)
(x1) Piezo element (Radioshack #273-073)
(x1) 9v snap connector (Radioshack #270-324)
(x1) 9V Battery (Radioshack #23-853)
(x1) 5" x 2.5" x 2" project enclosure (Radioshack #270-1803)
(x1) 22awg solid core wire (Radioshack #278-1221)
sumitsmt5 months ago

How can I modify the code to countdown from 99 min? and how to attache with relay????plz riply...

amielv6 months ago

how can i modify the code that countdown from 24? please help

abu_seif11 year ago
which language did you use for the programming part?
please dont laugh, but i have the timer all together and it just lights up with the number 99.
i copied and pasted the code then verified,went over my wiring but stiil the same outcome. can u tell me where ive made a mistake.

hello did you ever figure this out i built it and is doing the same

diytransistor7 months ago

How can I modify the code to countdown from 59? Also, nice 'ible. Thinking about making it.

micmac10 months ago

I just completed a version of this. Mine is AC powered and is designed to count down in six minute increments for six hours - it's for sleeping exactly six hours from the time you get in bed. It flashes an LED and activates a buzzer when the counter hits 00.

I used a toggle switch instead of a button to avoid all the debouncing nonsense and because mine only has two states - actively counting down or waiting to be activated. Thanks for the inspiration. When we stand on the shoulders of giants, we can reach amazing heights.

JánM310 months ago

Great counter! And what I suposed to change in code if I want to countdown other time? Like 40 second and so on?

steinie441 year ago

Need an on/off switch or your battery will be dead in about 24 hours. At least turn off the LEDs and put the Arduino to sleep when not in use.

jsuptic1 year ago

I wanted to leave a quick message about all the digitalWrite() commands that were done in the code. There is a better way! I am in no way knocking how you did it, I just learned this way a couple days ago. Arduino has what is called port manipulation (http://arduino.cc/en/Reference/PortManipulation). What this allows is a single line to control digital pins 0-7 and another for 8-13. The command to write is:

DDRD for 0-7 and DDRB for 8-13. For example:

DDRD = B10011011; //Set pins 0,1,3,4,7 to high and 2,5,6 to low.

The format is littleEndian meaning the right most bit is the 0 or 8 pin and left most bit is the 7 or 13.

By utilizing this technique two important actions happen. First: Each bit is set simultaneously, thus saving clock cycles and eliminated any possible flicker (which would not be noticeable to human eyes anyways). Second: In projects that deal with a lot of port/pin manipulation -- such as the one presented here -- it can eliminate literally tens to hundreds of lines of code/copy and paste. As well it can eliminate a lot of pin setup code since DDRD and DDRB are builtins

Once again I encourage everyone to read further on this, as I just learned it this week and as such cannot fully explain it.

Also @ranofo, again great project! I am utilizing your wiring scheme to make a life counter/virtual dice and had not thought of or understood multiplexing well before. Bravo Zulu for a job well done!


mmbasha1 year ago
hello cqn you please help me with the codes of
a counter down timer of 10min and 59 sec which will be running on a seven segment led
with two button for (stop/resume) also one for reset
it will count down until it reaches 00:00 when it reaches zero it has to gives a buzzer sound for just three second
Asics1 year ago
Thank you I had fun building this project. Nice directions and I'm nearing completion now. This is my 2nd instructable. I'm going to make the mystery book next!
techbitar1 year ago
dmacasae1 year ago
this is exactly what I was looking for for my archery timer... well kind of... is it easy to modify so it can count down for 3 digits? (more 999 seconds?) thanks in advance!
Needs an on/off switch, or add code to turn off the LEDs after a period of inactivity to save battery (turn back on when you hit the button). Good work on the multiplexing to make the most of your pins.
Aud1073cH1 year ago
Do you work for radioshack?
pimpdoubt1 year ago
Way cool, just dont leave it in public :P
Oh no! A clock! whatever will we do!!! -oh, look at the time.
or take it on a plane
Excellent Instructible! Great step-by-step details. A great tip on how to cut a square hole in a project box.
How do you get a perfectly white background?
randofo (author)  FoamboardRC1 year ago
A combination of shooting on a photo sweep, good lighting and photoshop.
Yes please!!!

randofo (author)  randofo1 year ago
I should post an Instructable one of these days.
carlos66ba1 year ago
Very nicely built and a good project. One suggestion for future improvements (in terms of learning new stuff, not in terms of functionality itself---which is fine with the device as-is) is to program most timing and events using timer interrupts and event interrupts (i.e. detect the button press). It is more challenging to do but very interesting to learn. I am still having trouble dealing with some interrupt calls but it is a very important programming skill.
randofo (author)  carlos66ba1 year ago
I figured this was more a beginner's project and did not want to make it more complicated than it already was. This is a good suggestion though for making the code a bit more robust.