LED Matrix Countdown Timer Using Visuino

by RonFrtek in Circuits > Arduino

163 Views, 1 Favorites, 0 Comments

LED Matrix Countdown Timer Using Visuino

LED Matrix Countdown Timer Using Visuino

In this tutorial we are going to build a simple Countdown timer using LED Matrix MAX7219 and Arduino.

By pressing on the button you can the Green LED will glow and the timer will countdown from 9 yo 0, once the 0 is reached a Red LED will glow. You can replace the LED with a relay or any other module.

Watch the Video!

What You Will Need

nanoesp32.jpg
8x8-LED-Matrix.png
VisuinoAdvrtisemenM5StackCoreS3.jpg
djownload.jpg
jumper-wires.jpg
redled.jpg
greenled.jpg
arduino-button.png
breadboard.png
  • Arduino (or any other board)
  • 8X8 LED Matrix MAX7219
  • Button
  • 3X 1K ohm resistor
  • Green LED
  • Red LED
  • Breadboard
  • Jumper wires
  • Visuino program: Download Visuino


The Circuit

2024-01-29_20-03-03.jpg
  • Connect Arduino pin [5V] to breadboard positive pin [Red line]
  • Connect Arduino pin [GND] to breadboard negative pin [Black line]
  • Connect Arduino Digital pin [7] to the Resistor2
  • Connect other side of the resistor2 to the Red LED positive pin
  • Connect Red LED negative pin to breadboard pin [GND]
  • Connect Arduino Digital pin [6] to the Resistor1
  • Connect other side of the resistor1 to the Red LED positive pin
  • Connect Red LED negative pin to breadboard pin [GND]
  • Connect Arduino Digital pin [2] to button on the breadboard and to the Resistor3
  • Connect other side of the resistor3 to the breadboard pin [GND]
  • Connect Other pin of the button to the breadboard positive pin [5V]


  • Connect LED Matrix pin[VCC] to Arduino pin[5V]
  • Connect LED Matrix pin[GND] to Arduino pin[GND]
  • Connect LED Matrix pin[DIN] to Arduino digital pin[11]
  • Connect LED Matrix pin[CS] to Arduino digital pin[10]
  • Connect LED Matrix pin[CLK] to Arduino digital pin[13]



Start Visuino, and Select the Arduino Board Type

Visuino-Select-Board.jpg
Visuino-Select-Board-UNO.jpg

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 or any other board.

In Visuino Add Components

2024-01-29_20-15-03.jpg
2024-01-29_20-15-27.jpg
2024-01-29_20-15-45.jpg
2024-01-29_20-16-05.jpg
2024-01-29_20-16-27.jpg
2024-01-29_20-16-47.jpg
2024-01-29_20-17-15.jpg
2024-01-29_20-17-44.jpg
  • Add "Debounce Button" component
  • Add "Toggle(T) Flip-Flop" component
  • Add "Pulse Generator" component
  • Add "Up/Down Counter" component
  • Add "Digital Multi Source" component
  • Add "Integer Multi Source" component
  • Add "Digital (Boolean) Inverter (Not)" component
  • Add "Maxim LED Display Controller SPI MAX7219/MAX7221" component

In Visuino Set Components

2024-01-29_20-19-25.jpg
2024-01-29_20-22-09.jpg
2024-01-29_20-22-27.jpg
2024-01-29_20-25-53.jpg
2024-01-29_20-27-15.jpg
2024-01-29_20-27-34.jpg
2024-01-29_20-28-44.jpg
  • Select "PulseGenerator1" and in the properties window select "Enabled" and set it to False, click on the pin icon and select "Boolean SinkPin"

Select "UpDownCounter1" and in the properties window set:

  • Initial Value to 9
  • Max > Roll Over to False
  • Max > Value to 9
  • Min > Roll Over to False
  • Min > Value to 9

Select "DigitalMultiSource1" and in the properties window set "Output Pins" to 3

Select "IntegerMultiSource1" and in the properties window set "Output Pins" to 3

  • Double click on the "LedController1" and in the "Pixel Groups" window drag "2D Graphics" to the left side
  • and in the properties window set "Mirror Horizontal" to True and "Reverse Horizontal" to True and set "Width" to 8 and "Height" to 8
  • also select "Elements" in the properties window and click on the 3 dots button

In the Elements window drag:

  • "Fill Screen" to the left side
  • "Text Field" to the left side and in the properties window set "Wrap" to False
  • Close the "Elements" Window
  • Close the "Pixel Groups" window

In Visuino Connect Components

2024-01-29_20-31-35.jpg
2024-01-29_20-32-03.jpg
2024-01-29_20-32-18.jpg
countdown-matrix.png
  • Connect Arduino digital pin [2] to "Button1" pin [In]
  • Connect "Button1" pin [Out] to "TFlipFlop1" pin [Clock]
  • Connect "Button1" pin [Out] to "UpDownCounter1" pin [Reset]
  • Connect "TFlipFlop1 pin [Out] to "PulseGenerator1" digital pin [Enabled]
  • Connect "PulseGenerator1" pin [Out] to "UpDownCounter1" pin [Down]
  • Connect "UpDownCounter1" pin [Min Reached] to "DigitalMultiSource1" pin [In]
  • Connect "UpDownCounter1" pin [Out] to "IntegerMultiSource1" pin [In]
  • Connect "DigitalMultiSource1" pin [0] to "TFlipFlop1" pin [Reset]
  • Connect "DigitalMultiSource1" pin [1] to Arduino digital pin [7]
  • Connect "DigitalMultiSource1" pin [2] to "Inverter1" pin [In]
  • Connect "Inverter1" pin [Out] to Arduino digital pin [6]
  • Connect "IntegerMultiSource1" pin [0] to "LedController1" > "Fill Screen1" pin [Clock]
  • Connect "IntegerMultiSource1" pin [1] to "LedController1" > "Text Field1" pin [In]
  • Connect "IntegerMultiSource1" pin [1] to "LedController1" > "Text Field1" pin [Clock]
  • Connect "LedController1" Pin Out SPI to Arduino Board pin SPI In
  • Connect "LedController1" Pin Chip Select to Arduino Board Digital pin [10]



Generate, Compile, and Upload the Arduino Code

FBR42I2KXBU01YW.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 board, the LED Matrix will show the countdown time, if you press the button you will be able to reset the time. When the countdown is active a Green LED will glow, once the countdown is finished a Red LED will glow.

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