
This project builds a digital countdown timer that can be set to any duration the user chooses, instead of a fixed, pre-programmed duration like the basic timer project covered earlier.
Components needed
An Arduino Uno board, a 16x2 LCD screen, a 4x4 membrane keypad for entering the time, a push button to start and stop, and a buzzer to alert when the countdown ends.
Wiring it up
The keypad connects to its usual digital pins via the Keypad library, the LCD connects using its dedicated pins or through an I2C module, and the buzzer and push button each connect to their own digital pin.
How it works
The system asks the user to enter hours, minutes, and seconds via the keypad, then the code converts these combined values into a total second count. After pressing the start button, a loop decrements this total by one second every real second, recalculating the remaining hours, minutes, and seconds from the new total and displaying them immediately on the LCD in HH:MM:SS format. When the counter reaches zero, the buzzer plays repeated tones until the user manually stops it, and the remaining countdown can also be stopped early by pressing the same button again at any time.
You can find LCD screens and membrane keypads at Juthour Tech.
اترك تعليقا