IR Infrared Obstacle Avoidance Sensor With ATOM Matrix ESP32

by RonFrtek in Circuits > Arduino

142 Views, 1 Favorites, 0 Comments

IR Infrared Obstacle Avoidance Sensor With ATOM Matrix ESP32

IR Infrared Obstacle Avoidance Sensor With ATOM Matrix ESP32

In this tutorial we are going to use a Infrared IR Obstacle Avoidance Sensor with ATOM Matrix ESP32. If there is no obstacle detected a Green light will be visible and if the sensor detects an obstacle a Red light will be visible.

Watch the Video!

What You Will Need

2022-07-27_11-05-19.jpg
2023-04-22_17-30-16.jpg
VisuinoAdvrtisemenESPNowESP32C3-1.jpg
F5OFEUQJJ4ZYFKY.LARGE.jpg


The Circuit

2023-04-22_10-00-37.jpg
  • Connect IR Obstacle Avoidance Sensor pin [VCC] to Atom Matrix pin [5V]
  • Connect IR Obstacle Avoidance Sensor pin [GND] to Atom Matrix pin [GND]
  • Connect IR Obstacle Avoidance Sensor pin [Out] to Atom Matrix pin [G25]


Start Visuino, and Select the Atom Matrix Board Type

select-board-uno.jpg
FYF2EGQLDZYXBQX.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 "Atom Matrix" as shown on Picture 2

In Visuino Add Components

2023-04-22_9-44-53.jpg
2023-04-22_9-46-03.jpg
  • Add "Obstacle Avoidance Sensor" component
  • Add "Digital To Color" component

With "Digital To Color" component we are going to set the Color based on the Digital input (True or False)

In Visuino Set Components

FN235MHLDZYXC0M.jpg
FTWU23BLDZYXC1E.png
FTMRQH6LDZYXC1F.png
2023-04-22_9-49-51.jpg
  • Select "M5 Stack ATOM Matrix" board in the properties window expand "Modules">"RGB Matrix">"Elements" and click on the 3 dots button
  • In the "Elements" window drag "Fill Screen" to the left side and in the properties window select "Color" and click on the Pin Icon and select "Alpha Color SinkPin"
  • Close the "Elements" window


  • Select "DigitalToColor1" and in the properties window set "False Value" to clRed and "True Value" to clGreen

In Visuino Connect Components

2023-04-22_9-53-32.jpg
atom-obstacle.png
  • Connect "M5 Stack ATOM Matrix" pin [GPIO 25] to "ObstacleAvoidance1" pin [In]
  • Connect "ObstacleAvoidance1" pin [Out] to "DigitalToColor1" pin [In]
  • Connect "DigitalToColor1" pin [Out] to "M5 Stack ATOM Matrix" > "Fill Screen1" pin [Color]
  • Connect "DigitalToColor1" pin [Out] to "M5 Stack ATOM Matrix" > "Fill Screen1" pin [Clock]


Generate, Compile, and Upload the Arduino Code

F2AQ3KPLDZYXENP.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 ATOM Matrix module The Display will start to show Green color and you can put an obstacle in front of the Obstacle IR sensorthe the display will show a Red color.

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