Easy Countdown With Buzzer
About the project
How to make an easy and adaptable countdown.
Estimated time: 2 hours
Items used in this project
This project consists in an easy countdown with three buttons and a buzzer. I wanted to do this because often I need a countdown for different things, so I ask myself: "Why don't I build one?"
In this project there are three buttons:
- The first button sets the time.
- The second button starts up the countdown.
- The third button reset the time.
I use the technique of the Multiplexer to display the numbers. The two displays are connected by connecting together the segments identified by the same letter. The correct view of the digit is available by activating one at a time the display. The command on each display saturates the transistor so turns on the display.
The user doesn't see one display at time but the whole digit. This is possible because the human eye fix what he sees for 25 ms, but all the cycle lasts less than 25 ms, so the two images are fix in the retina.
I have used an unsigned long variable for not having 'overflowing' problems. This variable doesn't contains negative numbers and goes from
With an '
int' variable, I would had only 32 seconds before overflowing. But with an unsigned long the problem is solved.
-32,768 to 32,767 32,767 * 1ms → 32 seconds
4,294,967,295 * 1ms→ 4,294,967 seconds →71,582 minutes → 1,193 hours → 49 days.
Then, 49 days must pass before overflowing.caption (optional)