Arduino Countdown Timer With Settings

by RonFrtek in Circuits > Arduino

1226 Views, 5 Favorites, 0 Comments

Arduino Countdown Timer With Settings

Arduino Countdown Timer With Settings

In this tutorial we will learn how to make a Countdown Timer, where you can set time with one button and start the timer with another button. When timer reaches the zero the LED will start to flash. Instead of the LED you can connect anything else like a relay or any other module.

Watch the Video!

What Will You Need

68747470733a2f2f692e696d6775722e636f6d2f6c46573361784a2e6a7067.jpg
button module red 2-1000x1000.jpg
led-2023979_640.png
resistor-1k-ohm-14w-5.jpg
FNLOD2CKEY93G5N.jpg
VisuinoAdvrtisementNewDesign1.jpg
FMT2X9VKEY93G5P.jpg
FMMM5N5KEY93G5M.jpg

  • Arduino UNO (or any other board)
  • LED Display TM1637
  • 2X button modules
  • 1K ohm resistor
  • LED
  • Jumper wires
  • Breadboard
  • Visuino program: Download Visuino

The Circuit

2021-08-26_22-52-36.jpg

  • Connect LED Display pin[CLK] to Arduino digital pin[10]
  • Connect LED Display pin[DI0] to Arduino digital pin[9]
  • Connect LED Display pin[GND] to Arduino pin[GND]
  • Connect LED Display pin[VCC] to Arduino pin[5V]
  • Connect button module1 and button module2 pin [Vcc] to Arduino pin [5V]
  • Connect button module1 and button module2 pin [GND] to Arduino pin [GND]
  • Connect button module1 pin [Out] to Arduino digital pin [4]
  • Connect button module2 pin [Out] to Arduino digital pin [5]
  • Connect Arduino digital pin [7] to 1Kohm resistor
  • Connect other side of the resistor to LED positive pin [+]
  • Connect LED negative pin [-] to Arduino pin [GND]

Start Visuino, and Select the Arduino UNO Board Type

2021-08-25_10-59-08.jpg
F311FBVK5AHN5HJ.LARGE.jpg

The Visuino: https://www.visuino.eu also needs to be installed. Download Free version or register for a Free Trial.

Start Visuino as shown in the first picture Click on the "Tools" button on the Arduino component (Picture 1) in Visuino When the dialog appears, select "Arduino UNO" as shown on Picture 2

In Visuino Add Components

F7B2SNCKK76UC74.jpg
FQ8MNO2KK76UC70.jpg
FZIGNLQKK76UC6Z.jpg
FTVCQ6CKK76UC71.jpg
FV7WVPDKK76UC72.jpg
FX26M6LKK76UC73.jpg
2021-08-29_14-58-04.jpg
2021-08-29_14-57-40.jpg
2021-08-29_14-57-22.jpg
2021-08-29_14-56-51.jpg
  • Add "TM1637 7 Segment Display 4 Digits Module + 2 Vertical Points (CATALEX)" component
  • Add "Up/Down Counter" component
  • Add "Pulse generator" component
  • Add "Divide Integer By Value" component
  • Add "Multiply Integer By Value" component
  • Add "Subtract Integer Value" component
  • Add "Counter" component
  • Add "Toggle(T) Flip-Flop" component
  • Add 2X "Debounce button" components
  • Add "Compare Integer Value" component

In Visuino Set Components

FVPZRNIKK76UCNH.jpg
FO9UZNSKK76UCNA.jpg
F9280USKK76UCND.jpg
FGRUOTUKK76UCNC.jpg
FSZXIK8KK76UCNB.jpg
FSDW5V7KK76UCNF.jpg
F3TZ36MKK76UCNG.jpg
2021-08-29_15-03-29.jpg
2021-08-29_15-03-45.jpg
2021-08-29_15-06-48.jpg

  • Select "Display1" and in the properties window set "Points" to True
  • Double click on "Display1" component and in the "Digits" window
  • drag "Integer Display 7 Segments" to the left side
  • On the left side of the "Digits" window select "Integer Display 7 Segments1" and in the properties window set "Count Digits" to 2
  • drag another "Integer Display 7 Segments" to the left side
  • On the left side of the "Digits" window select "Integer Display 7 Segments2" and in the properties window set "Count Digits" to 2 and "Leading Zeroes" to True
  • Close the "Digits" window
  • Select "UpDownCounter1" and in the properties window setlect:"Initial Value" and click on the pin icon and select "Integer SinkPin"
    Max > Roll Over" to False"
    Min > Roll Over" to False
    and Min Value to 0.

  • Select "DivideByValue1" and in the properties window set Value to 60
  • Select "MultiplyByValue1" and in the properties window set Value to 60
  • Select "SubtractValue1" and in the properties window select Value and click on the Pin Icon and select "Integer SinkPin"
  • Select "PulseGenerator1" and in the properties window
    Select "Enabled" and click on the pin icon and select "Boolean SinkPin" and set "Enabled" to False

In Visuino Connect Components

cc1.png
2021-08-29_15-10-04.jpg
2021-08-29_15-09-47.jpg
2021-08-29_15-09-30.jpg
2021-08-29_15-09-14.jpg
  • Connect "PulseGenerator1" pin Out to "UpDownCounter1" pin Down
  • Connect "UpDownCounter1" pin Out to "DivideByValue1" pin In and "SubtractValue1" pin In
  • Connect "DivideByValue1" pin Out to "MultiplyByValue1" pin In and "Display1" > "Integer Display 7 Segments1" pin In
  • Connect "MultiplyByValue1" pin Out to "SubtractValue1" pin Value
  • Connect "SubtractValue1' pin Out to "Display1" > "Integer Display 7 Segments2" pin In
  • Connect "Display1" pin Clock to Arduino digital pin 10
  • Connect "Display1" pin Data to Arduino digital pin 9
  • Connect Arduino digital Out pin [4] to "Button1" pin [In]
  • Connect Arduino digital Out pin [5] to "Button2" pin [In]
  • Connect "Button1" pin[Out] to "Counter1"pin [In] and to "TFlipFlop1" pin[Reset]
  • Connect "Button2" pin[Out] to "TFlipFlop1" pin[Clock]
  • Connect "TFlipFlop1" pin[Out] to "PulseGenerator1" pin[Enabled]
  • Connect "Counter1" pin[Out] to "UpDownCounter1" first to pin[Reset] and then also to pin[Initial Value]
  • Connect "UpDownCounter1" to "CompareValue1" pin[In]
  • Connect "CompareValue1" pin[Out] to "Arduino" digital pin[7] , this pin will be used to turn the LED On
  • Connect "CompareValue1" pin[Out] first to "Counter1" pin[Reset] and also to "UpDownCounter1" pin[Reset]

Generate, Compile, and Upload the Arduino Code

FOQOHC1KLWB8FIX.jpg

In Visuino, at the bottom click on the "Build" Tab, make sure the correct port is selected, then click on the "Compile/Build and Upload" button.

Play

If you power the Arduino module the LED Display will Show 00:00, if you start pressing .a Button (Connected to pin 4) the time on the display will increase by 1second each time, once you set your time, press the other button to start the countdown. On the Countdown zero a LED will turn On.

Congratulations! You have completed your project with Visuino. Also attached is the Visuino project, that I created for this Instructable, you can download it and open it in Visuino: https://www.visuino.eu