Introduction
In this lesson we are going to learn how to create a timer. A timer can be simply described as a type of clock that starts measuring time from specified duration , eg. 10 seconds and once 10 seconds are up it signifies that the specified time is up.
To build this project we will need:
- Unda Xplora Kit
- 2 Pushbuttons (pick any 2 colors of your choice)
- 2 10 Kiloohm resistors
- Buzzer
- Jumper Wires and Breadboarding Jumper Wires
We have already covered Pushbuttons and resistors but what about buzzers?
A buzzer is an electrical device that makes buzzing noise that is used to signal a message, for example in the timer project it is used to signal that the set time is completed/time is up. There are two types of buzzers: active and passive buzzers. Active buzzers make use of Direct Current(DC) signals and passive buzzers make use of Alternating Current(AC) Signals.
For the buzzer we will be using, the longer pin is the positive pin and it is connected to any digital pin. The shorter pin is the negative terminal and it is connected to the negative terminal or Ground (GND).
Let’s build the Timer Project
Before you build this project:
- Pushbutton1 will be used to start the Timer . So once you set the time, press the button1 to start the timer.
- Pushbutton2 will be used to stop the timer. It can stop the timer at any point in time, and thus no need of waiting for the timer to get to zero.
Place two pushbuttons, two 10kiloohm resistors and a buzzer on the breadboard. Take note of the negative and positive pin of the buzzer; the positive pin has the longest lead.
Connect a jumper wire from 5V to breadboard positive rail. Using breadboarding jumper wires connect from breadboard positive rail to one pin of each pushbutton.
Connect a jumper wire from GND to breadboard negative rail. Using breadboarding jumper wire connect from breadboard negative rail to one side each resistor placed next to the pushbuttons.
Connect a jumper wire from digital pin D12 to the other side of resistor R1 which is placed next to pushbutton1. Connect a jumper wire from digital pin D13 to the other side of resistor R2 which is placed next to pushbutton2.
Connect a jumper wire from digital pin D2 to the positive side of the buzzer and then connect using breadboarding jumper wire from breadboard negative rail to the negative pin of the buzzer.
Return to the project window and then run the project. Once the project has been uploaded, go to the Play Section. On the Play Section press on SET (every single time that you press the SET option, you increase the time by 5 seconds) and set the number of seconds you want. Once you have set the time, press pushbutton1 to start the timer.
What did you observe?
Once you set the time to a specified period (for example 10 seconds) and when you press the start pushbutton (pushbutton1), the timer begins counting down from 10 seconds to zero. Once the time is up, you will hear a buzzing noise coming from the buzzer just like how timers work. The buzzing sound is used to signal that the set time is up or has reached zero.
What happens when we press the stop button(pushbutton2) when the timer reaches halfway (at 5 seconds) ?
When you press the stop button at 5 seconds, you realize that the timer stops counting and the buzzer creates a buzzing sound.
Feedback is closed.