Introduction: Arduino Countdown Timer With Setup Buttons

Picture of Arduino Countdown Timer With Setup Buttons

In this Instructables guide I will show you how to make your own Arduino two digit countdown timer. I made my own circuit by using the ATmega328 micro controller but this is an optional step. In this guide I will help you to make it easily on breadboard by using the Arduino uno board!

We will be able to set the timer by pressing the setup buttons. We will use two digits seven segment display, so the maximum countdown time will be 99 seconds.

Operation video:

So, let's get started!

Step 1: About 7 Segment Displays

Picture of About 7 Segment Displays

A Seven Segment Display, is a form of electronic display device for displaying decimal numerals that is an alternative to the more complex dot matrix displays. Seven segment displays are widely used in digital clocks, electronic meters, basic calculators, and other electronic devices that display numerical information.

The 7 segment display consists of seven LEDs (hence its name) arranged in a rectangular fashion as shown (see first image above). Each of the seven LEDs is called a segment because when illuminated the segment forms part of a numerical digit (decimal numbers and some letters) to be displayed. An additional 8th LED (right corner) is sometimes used within the same package thus allowing the indication of a decimal point, (DP) when two or more 7-segment displays are connected together to display numbers greater than ten.Each one of the seven LEDs in the display is given a positional segment with one of its connection pins being brought straight out of the rectangular plastic package. These individually LED pins are labelled from 'A' through to 'G' (see second image above) representing each individual LED. The other LED pins are connected together and wired to form a common pin.The displays common pin is generally used to identify which type of 7-segment display it is. As each LED has two connecting pins, one called the “Anode” and the other called the “Cathode”, there are therefore two types of 7 segment display called "common cathode - cc" and "common anode - ca" (see third image above).In this tutorial we will use a common cathode 7 segment display.

Find here an Arduino tutorial for the 7 segment display

Step 2: What We Will Need

Picture of What We Will Need

For this project we will need:

  • Arduino uno
  • breadboard
  • 2 digits 7 segment displays*
  • 3x button sw
  • some breadboard cables

(*you can use common cathode or common anode type)

You can buy them from, low prices and free shipping.

Step 3: The Circuit

Picture of The Circuit

The connections are pretty easy, see the image above with the breadboard circuit schematic.

(if you want you can connect one 220 Ohm resistor to each pin - except "CC" or "CA")


  • The segments A-G: A, B, C, D, E, F, G -->10,9,8,7,6,11,12
  • CC or CA pins of them connected to Arduino pin 4 & 5
  • Start/stop button pin 2
  • Change button pin 3
  • Set button pin13


  • dot pin of right digit at pin A0
  • dot pin of left digit at pin A1

Step 4: ​The Code

Here's the code, embedded using Codebender!

  • SevenSeg disp (10,9,8,7,6,11,12); //Defines the segments A-G: SevenSeg(A, B, C, D, E, F, G);
  • numOfDigits = 2 We have two digits 7 segment
  • display.digitPins [numOfDigits] = {4,5} CC or CA pins of them connected to Arduino pin 4 and 5.
  • disp.setDutyCycle(60) Control brightness of the display - "60" is 60% of led

Try downloading the codebender plugin and clicking on the Run on Arduino button to program your Arduino with this sketch. And that's it, you've programmed your Arduino board! If you want to make any changes in the code below just click the "Edit" button.

(if you have common anode 7 seg display type just delete the line 24 "disp.setCommonCathode();")

Note: If you will not use the Codebender IDE for programming your Arduino board you will need to manual install the SevenSeg library in your Arduino IDE. Where to find it? Search the web, don't ask me... Or just use the easy and simple way of Codebender.

Step 5: Well Done

That's it! You have successfully completed this guide and now you have your own Arduino countdown timer. If you want to restart the timer, just press the reset button.

You can find more Arduino tutorials and cool projects here.

I hope you liked this, let me know in the comments!


TheodorosC (author)2017-11-19

Hi! How do you make a buzzer play when the countdown is equal to "00"?

cgrrty (author)2016-05-22

good job i was made simlar like this.

Paul JervinF (author)cgrrty2017-10-22

sir did you finish these ? can u help me out i put the circuit diagram and upload the code but it always display random

Paul JervinF (author)2017-10-22

good day sir, i put the circuit correctly and use codebender to upload the code but why it keeps displaying random

ImamM18 (author)2017-08-13

Nice Tut!, But how to add 2 leds blink alternatly while count down is running?.


dancopy (author)2017-04-07

Hi friend!
What should be changed / added in the code to a 4-digit display? Thank you

Jaya SandhyaM (author)2016-09-26

Nicely done!

But I have a query here. Wont the pins 4 and 5 of arduino be required to source(CA) or sink(CC) more than 40mA of current when all the segments is ON(display number 8).

Lets take one segment current ~ 10mA All 7 segments + Decimal point ~ 8*10mA =80mA

Wont the I/O pins fail at this point???

gm280 (author)2016-05-19

Nice setup. If or when you install your project into a project box, make sure you use a filter for the readouts. Because it is hard to see the changes without the filter sheet over the seven segment displays. Otherwise you could use LCD displays in the exact same fashion. I use to make these without a microcontroller. Thumbs up!

miah77 (author)2016-05-19

Great 'ible! But let's say I needed the timer to work like an hourglass that started with an equal amount of sand in each side of the glass. Once the timer was started I could press a button to flip the hourglass without resetting the timer; it just started counting in the other direction until "all the sand was in one side of the glass". What would the code look like for that? Again, nice 'ible.

About This Instructable




More by Ardumotive_com:MIKE - Arduino Line Following Robot for Beginners "GRECO" - Arduino Object Avoiding Robotfor BeginnersArduino 3D Printed Digital Thermometer With DHT-22 Sensor
Add instructable to: