Arduino Counter Using TM1637 LED Display & Obstacle Avoidance Sensor

by RonFrtek in Circuits > Arduino

2934 Views, 5 Favorites, 0 Comments

Arduino Counter Using TM1637 LED Display & Obstacle Avoidance Sensor

2020-06-05_21-52-24.jpg

In this tutorial we will learn how to make a simple digit counter using LED Display TM1637 and obstacle avoidance sensor and Visuino.

Watch the video.

What You Will Need

s-lqw1600.jpg
images (2).jpg
VisuinoAdvrtisementM5Stack8.jpg
FZEK4WBK3XGYAP0.LARGE.jpg
jumper-wires.jpg
  • Arduino UNO (or any other Arduino)
  • Jumper wires
  • Obstacle avoidance sensor
  • LED Display TM1637
  • Visuino program: Download Visuino

The Circuit

LED-OBSTACLE-COUNTER.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 obstacle avoidance sensor pin[VCC] to Arduino pin[5V]
  • Connect obstacle avoidance sensor pin[GND] to Arduino pin[GND]
  • Connect obstacle avoidance sensor pin[D0] to Arduino digital pin[7]

Start Visuino, and Select the Arduino UNO Board Type

FBL8FPKK5H5EPPI.LARGE.jpg
FFNPRDUK5AHN5HH.LARGE.jpg

To start programming the Arduino, you will need to have the Arduino IDE installed from here: https://www.arduino.cc/.

Please be aware that there are some critical bugs in Arduino IDE 1.6.6. Make sure that you install 1.6.7 or higher, otherwise this Instructable will not work! If you have not done follow the steps in this Instructable to setup the Arduino IDE to program Arduino UNO! The Visuino: https://www.visuino.eu also needs to be installed. 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

2020-04-27_15-12-08.jpg
2020-04-27_15-11-46.jpg
2020-04-27_16-08-09.jpg

  • Add "TM1637 7 Segment Display 4 Digits Module + 2 Vertical Points (CATALEX)" component
  • Add "Counter" component
  • Add "Infrared(IR) Obstacle Avoidance Sensor" component

In Visuino Set and Connect Components

2020-04-27_15-14-45.jpg
2020-04-27_15-14-22.jpg
2020-04-27_15-13-55.jpg
2020-04-27_16-13-43.jpg
leddisp1.png

  • Select "Counter1" component and in the properties window set "Max>Value" to 9999
  • Select "Counter1" component and in the properties window set "Min>Value" to 0
  • 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 4
  • Close the "Digits" window
  • Connect Arduino digital pin[7] to "ObstacleAvoidance1" pin[In]

  • Connect "ObstacleAvoidance1" pin[Out] to "Counter1" pin[In]
  • Connect "Counter1" pin[Out] to "Display1">"Integer Display 7 Segments1" pin[In]
  • Connect "Display1" pin[Clock] to Arduino board digital pin[10]
  • Connect "Display1" pin[Data] to Arduino board digital pin[9]

Generate, Compile, and Upload the Arduino Code

FY569XHK54FYQH5.LARGE.jpg
F7PZ4XBK5H5ERJK.LARGE.jpg

In Visuino, Press F9 or click on the button shown on Picture 1 to generate the Arduino code, and open the Arduino IDE

In the Arduino IDE, click on the Upload button, to compile and upload the code (Picture 2)

Play

If you power the Arduino UNO module, the LED display should start counting numbers when obstacle avoidance sensor detects an obstacle, once it reaches 9999 it will restart to 0 and count again.

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