Simple, low power Arduino countdown timer.

76 views

I’ve a requirement for a easy, battery operated countdown timer.

It might have quite a lot of makes use of, on this use, it simply must depend down from a preset variety of minutes to zero, and sound a bleeper.

I might exit and purchase one thing for little cash, however the place’s the enjoyable in that?

I am additionally fascinated with Arduino sleep modes, so it’s going to be attention-grabbing to play about with that too, to extend battery life.

The sketch may be discovered at https://github.com/andydoswell/Timer
I’ve additionally included the library for driving the TM1637 show, which is by Bram Harmsen
and will also be downloaded from  https://github.com/bremme/arduino-tm1637

Let’s have a fast have a look at the {hardware}…

Electronic Repairing
A momentary push button is linked to D2. A BC337 (or virtually any normal objective NPN transistor)  is linked to A3, which is used to change energy on by grounding the GND pin of the TM1637 “gentle tube” 7-segment LED show. DIO and CLK of the TM1637 are linked to pins 10 and 11. The output of the pot is linked to A0, and the “scorching” finish linked to D13. Energy by the use of Three AA cells, is provided to the VCC pin of a pro-mini. A piezo beeper is linked to D3.
How the sketch works…
In regular use, the microcontroller is asleep. It is woken up from it is slumber by an interrupt going low on D2. Energy is then switched on to the show, by taking A3 excessive, which switches on T1, and connects the show GND pin. D13 is then taken excessive, which switches on energy to the pot. The pot place is sampled by A0, and used to outline the variety of minutes the timer is  required to run. After a couple of seconds, D13 goes low, saving us a couple of treasured uA! The timer begins to depend down, displaying the worth in remaining minutes and seconds on the show. As soon as the timer will get to zero seconds remaining, the show flashes and the beeper sounds to alert the consumer the time has expired. As soon as that is full, A3 goes low, disconnecting the show, and the micro goes again to sleep.
Energy consumption is about 45mA when it is operating… and a super-low 200uA when asleep. The batteries ought to have an excellent life.
I did take away the voltage regulator on the pro-mini, as initially I used to be going to make use of a 3.3V unit, and the regulator burns a couple of mAs even when the micro is asleep, however it’s pointless. There isn’t any distinction within the microcontroller, so why hassle? Simply feed our 4.5V into VCC… Regardless of the light-tube stating it wants 5v, it appears pleased proper down to three.3.
In the mean time this undertaking meets my necessities to be used. I will construct a brand new ultra-violet gentle publicity field shortly, and I am going to modify this to drive a relay to routinely management publicity time.

Leave a reply "Hello world!"

Author: 
    author