This article describes a simple timer using Arduino.
- User can set time by rotating a knob on the printed dial.
- User will start the switch (spst) which powers up the ckt.
- The ckt will start counting time, a red LED glows.
- When the time is over, LED is OFF and a buzzer sounds for 2 seconds.
- Power supply: 9V flat battery (non rechargeable)
- CPU power: Through +5V regulator
- CPU: Atmega 8
- Clock frequency: 16 MHz
- Maximum time: 20 minutes
Arduino language is used
Because, Arduino is user friendly, it is very easy to make a quick prototype.
Steps to implement the program:
- Sense the potentiometer voltage at A0
- Map the number at the output of adc, in 20 parts.
- Outcome of mapping is used as an input to the delay function.
- Make the red LED ON to show timer running.
- When delay is complete, turn OFF the LED and sound buzzer for 3 seconds.
- Run an empty “while loop”.
The source code
You can easily modify the program to cover larger timer range. The source code considers time up to 20 seconds. It is easy to test it quickly. Then to extend the range, from seconds to minutes you can change the “time” variable by multiplying it by 60. The source code is here.
For calibration, you can use this pdf file and print the dial for the potentiometer.