top of page

Arduino based countdown Timer using Atmega328 microcontroller and 7 segment LED display

Apr 28, 2020
4 min read

Updated: Jun 3, 2020

Motive to create the project:

I decided to make this project when i visited to my farmhouse after long time where my grandparents live which is also the place where i was born and brought up.



When i was a small kid i used to see my grandmother fighting with grandfather for forgetting to turn off the curd churning machine and letting it run for hours melting down the butter formed initially. So i thought why don't i put a timer in which grandma can set time easily and the timer will automatically turn off the motor when the times up.











Working and features of the timer:

The timer has 3 buttons, in which 2 are used as upward and downward arrow buttons and 3rd one for start/play and pause function.

The upward arrow also works as a stop or reset button when the timer is in paused condition and is pressed continuously for more than 3 seconds. It also has an onboard LM35 based ambient temperature sensor and will display the accurate ambient temperature for 3 seconds during startup.

I have also given 3 LED indicators (red, green, yellow) for indicating the stages of operation.

1) Initially when the supply turned on the ambient temperature is displayed in centigrade along with YELLOW LED on for a duration of 3 seconds and turns off after 3 seconds moving on to next stage.

2)Then the default time setting of 5 minutes will be displayed along with RED LED on, allowing the operator to set the time in minutes as per requirement up to 60 minutes (can be easily changed to 99 minutes if required while programming).

3)After setting the time, when the play/pause button is pressed the countdown timer starts displaying the remaining time in minutes along with relay and GREEN LED turning on and red led turned off.

4) While running, if the play/pause button is pressed the timer pauses, relay and Green LED turns of also the red led starts blinking with a duration of 250 milliseconds.

5)If the timer completes countdown till 0 then the timer and relay stops, blinking Green LED with duration of 500 milliseconds.

6)During paused condition if the upward arrow button is pressed continuously for more than 3 seconds, relay turns off and all 3 led's will turn on for 3 seconds resetting the timer going to first stage of displaying temperature.


APFDS&R Function:

The APFDS&R (Auto Power Failure Detection Save & Resume) function is the special feature of this timer which stores the values of exact minute and seconds in the EEPROM memory of the microcontroller If the power failure occurs during timer operation, microcontroller detects the power failure and APFDS&R function is called, then the timer resumes it's operation when the power is restored.


Use of this Timer:

It can be used not only for curd churning purpose but also can be used for water pumping, irrigation systems and sports event etc. where timing is required.


Softwares used :

I have used Arduino IDE version 1.8.9 to write the program and added SevSeg, CountupDownTimer and VertualDelay library to it which saved a lot of time for me to code.


I would like to specially thank the creators of libraries which I have used in my code SevSeg, CountupDownTimer and VertualDelay.


In order to design the circuit i have used DipTrace (free version) software which has all the features to design and develop all kind of circuits (single layer or multi layer) including 3D view option. But in a free version you can design up to 300 pins 2 layered pcb, which will be sufficient for smaller circuits.


List of material to make the project :

(All the components are of Through Hole Package)

  1. General purpose PCB/perfboard - 1

  2. Atmega328P 28 pin microcontroller - 1

  3. 28 pin IC base/ic holder - 1

  4. BC547 transistors - 10

  5. 7 segment LED display - 2 (Any colours can be selected)

  6. 16Mhz Crystal - 1

  7. 22pf (22) CD capacitor - 2

  8. 0.1uF (104) CD capacitor - 2

  9. 1N4007 Diodes - 3

  10. 220uF polarised electrolytic capacitor - 1

  11. 100uF polarised electrolytic capacitor - 1

  12. 1000uF polarised electrolytic capacitor - 1

  13. 7805 (5V) linear positive voltage regulator - 1

  14. push button switches - 3

  15. Red LED (3mm) - 1

  16. Greed LED (3mm) - 1

  17. Yellow LED (3mm) - 1

  18. LM35DZ (TO92) temperature sensor - 1

  19. 12v SPST or DPDT or SPDT relay 10Amp - 1

  20. 1/4 W 6K8 resistors - 7

  21. 1/4 W 470 Ohm resistors - 7

  22. 1/4 W 100 Ohm resistors - 2

  23. 1/4 W 1K Ohm resistors - 3

  24. 1/4 W 47K Ohm resistor - 1

  25. 7/36 gauge wires - few as per requirement (single stranded also can be used)

Circuit Diagram :

Pinout of Atmega328 microcontroller


Full circuit diagram made in diptrace to download

Power consumption :

In the circuit which i made, instead of using a 7805 linear regulator for powering microcontroller I have used adjustable DC-DC buck converter having LM2596 switching power IC since I didn't had one 7805.

When i tested the circuit by supplying it with a 13V SMPS I observed that during standby or let's say when the relay is in off condition the timer circuit drew about 21.8mA of current @ 13V that is 0.2834 W of power.

When the relay turned on, the circuit drew about 68.5mA @ 12.98 V which is about 0.889W of power.

(If you use 7805 linear regulator, the power consumption will slightly increase)


Thank You

1 Comment


Sajadh Km
Sajadh Km
Nov 27, 2021

Nice work..


Like
Post: Blog2_Post

Subscribe Form

Thanks for submitting!

  • LinkedIn
  • Twitter

©2020 by Json Electronics. Proudly created with Wix.com

bottom of page