In this post we are going to construct a proper real time countdown timer circuit using 7 segment display and Arduino.
We will see:
- What is a countdown timer?
- Stopwatch vs. Countdown Timer
- Design of the proposed circuit
- Pin configuration of IC4026
- How to decrement digits on 7 segment display using IC4026
- Full Circuit Diagram
- Program Code
- How to Operate this Countdown Timer
What is a Countdown Timer?
A countdown timer is a digital or an analogue or a software timer which counts the time in backwards to show the amount of time left, a countdown timer stops counting when the counts reaches zero.
Stopwatch vs. Countdown Timer:
We are going to compare between stopwatch and countdown timer in this section.
In a nutshell main difference between the two is:
In countdown timer we set a pre-determine time to accomplish a task, but in stopwatch we measure the time how long the task took to complete.
We use a stopwatch at numerous points of our life to measure the progression of time of many events, for example: In a party game or during a sport event or during cooking to avoid food to overcook or undercook.
Stopwatch starts from zero count and increments. The count is stopped manually when the task is completed. It shows the amount of time it took to accomplish the task from start. When you reset the stopwatch, it settles at zero.
We also use countdown timer numerous points of our life knowingly or unknowingly, for example: Timer on microwave oven.
In countdown timer the amount of time is pre-determined to accomplish a task. For example we set 2:00 min to heat some food item, once the timer counts zero it stops its operation.
By now you would have got an idea about stopwatch and countdown timer and when to use these two timers.
Design of Proposed Circuit:
Now let’s dive in to the design explanation of the countdown timer.
We will be utilizing 7-segment display to show the counts in combination with IC 4026 display driver. The proposed circuit will have two digits for minute count and two more digits for seconds count.
The minute digits can be set maximum of 99 minutes and second’s digit can be set maximum of 59 seconds. When the time is set, the timer’s digits will count in reverse.
To set time two push buttons are provided, each digit can be set individually. A buzzer is provided to beep alarm when the counts reach zero.
Now let’s see the pin diagram of IC 4026 which drives the 7 segment display.
Pin configuration of IC 4026:
- Pin #1 is clock-in where you will input the clock signal.
- Pin #2 is clock inhibit, if this pin connected to high, the IC will ignore the clock pulses and will not increment the digit. It should be connected to GND to enable the count increment.
- Pin #3 is display enable, making this pin high will light-up the 7 segment display, if this pin is low you can’t see the digits, but it will internally count the digit.
- Pin #4 is not used here.
- Pin #5 is carry out, for every 10 pulses pin #5 gets high or we can say this pin as divided by 10 output. We are utilizing this pin’s output as input to another IC4026’s clock-in.
- Pin #6, #7, #9, #10, #11, #12, #13 are output for 7 segment display.
- Pin #8 is ground supply.
- Pin #15 is reset, if this pin is connected to high the IC will reset the count to zero, it should be connected to ground while counting.
- Pin # 16 is Vcc (3 to 15V maximum)
NOTE: The IC 4026 is designed to increment the digits on 7 segment display (and don’t decrement numbers)
How to decrement digits on 7 segment display using IC4026:
We know that IC 4026 will always increase the count on the 7-segment display when we apply a clock pulse to clock pin but, how can we decrement digits using IC 4026? Well this is accomplished by using a microcontroller and programming it in a smart way. Let’s explore this now.
Usually IC4026 is used in applications where the numbers need to be incremented. To increment digit from “0” to “1” we apply one pulse, to increment from “1” to “2” we apply another pulse, to increment to next digit we apply another pulse; this is same till digit “9” and the cycle continues.
To count the digit in reverse is possible only with help of a microcontroller which should be programmed as described below.
Arduino controls the rest pin and clock pin of the all four IC 4026s, to show digit “9” on 7-segment display the arduino will apply nine pulses to clock pin quickly, to show digit “8” the Arduino will apply one pulse to reset pin that will bring the count to zero and applies 8 pulses to IC quickly, to show digit “7” the Arduino will apply one pulse to reset pin and apply 7 pulses to clock pin quickly.
The pulses are applied to reset pin and clock pin so quickly that we won’t see any transition of numbers while it counts backwards from 9 to 0.
By now you would have understood how we able to count in backwards with an IC that is primarily designed for incrementing digits.
Circuit Diagram of Countdown Timer:
Above schematic shows how to connect a common cathode display to IC 4026’s output pins.
Download high resolution image of circuit diagram: click here
The circuit is self-explanatory; just connect the circuit as per the diagram.
Program Code: Verified and error free
That concludes the circuit diagram and program code.
How to operate this circuit:
- Turn on the circuit, the Arduino will run a display test in which all the four displays will count from “9” to “0” simultaneously. You should look and verify that all the segments are connected properly, if not check and fix the connection(s).
- After the display test, right most digit (second’s unit place) will be illuminated and rest of the digits will be off. Now press S1 to increment the seconds and press S2 (OK).
- After pressing S2, the tens place of the seconds digit will illuminate and rest will stay off. Now press S1 to increment the seconds and press S2 (OK).
- Now, minute’s unit place will illuminate and press S1 to increment minutes and press S2 (OK).
- Now, minute’s tens place will illuminate. Press S1 to increment and press S2 (OK), now the timer starts.
- Once the timer counts all the digits zero, buzzer will beep and the display will flash.
If you have any questions regarding this project, feel free to comment, you will get a guaranteed reply from us.