Lesson 25: Car-3 Smart Car Avoids Obstacle Using Infrared Sensors | SunFounder Robojax @robojax
Lesson 25: Car-3 Smart Car Avoids Obstacle Using Infrared Sensors | SunFounder Robojax  @robojax
Uploaded December 2022 | Updated September 2026, 2 weeks ago
In this lesson, we will explore how to integrate and utilize the Infrared (IR) Obstacle Avoidance module with your SunFounder Smart Car. This module, an essential component of the Arduino Kit from SunFounder, allows your smart car to detect objects in its path and react accordingly, enabling it to autonomously navigate and avoid collisions. We will cover the principles behind IR obstacle detection, the necessary wiring, and the Arduino code required to implement this functionality.

Initially, we will explain the foundational code, illustrate the correct wiring, and then demonstrate the code's immediate effect. This will show how, when an object is detected in front of the car, the corresponding IR sensor (either on the right or left) will trigger, prompting the car to move in the opposite direction to avoid the obstacle. Following this, the code will be modified to incorporate a 'stop' function, allowing the car to halt when an obstacle is detected, rather than just changing direction. Finally, the complete project will be demonstrated, showcasing the smart car's ability to autonomously detect and react to obstacles.
In this lesson, we will explore how to integrate and utilize the Infrared (IR) Obstacle Avoidance module with your SunFounder Smart Car. This module, an essential component of the Arduino Kit from SunFounder, allows your smart car to detect objects in its path and react accordingly, enabling it to autonomously navigate and avoid collisions. We will cover the principles behind IR obstacle detection, the necessary wiring, and the Arduino code required to implement this functionality.

We will begin by thoroughly explaining the initial code, followed by a clear depiction of the wiring connections. Subsequently, the code will be demonstrated to illustrate how the IR sensors on the right or left of the car detect an object, prompting the car to move in the opposite direction to avoid the obstruction. We will then modify the code to incorporate a "stop" function, allowing the car to halt when an obstacle is detected in certain scenarios. Finally, the complete project will be demonstrated, showcasing the smart car's ability to autonomously detect and avoid obstacles.


Required Lessons for this lesson:
1-Introduction to IR Obstacle Avoidance youtu.be/yXpjd279T6g
2-Car-1 assembly and simple move youtu.be/OgYb53HWPAo
3-Car moves forward, left, right and backwards and speed control youtu.be/QzcUig2L3dM

Robojax Resources page for this video: robojax.com/course2/lecture25

Purchase this kit from SunFounder website robojax.com/L/?id=367

This lecture is part of Robojax Arduino Course based on SunFounder kit with lesson 1 starts here: bit.ly/sunfouder

The best thank you for me is to not to skip ads and Subscribe 🔔 to my channel, like 👍 the video It is greatly appreciated. 🔔 😊.
I will reply to all Subscriber's 🔔 questions. So make sure to Subscribe.😊 .

**** Purchase this SunFounder Arduino Learning kit from Affiliated Stores ***
Amazon USA:amzn.to/3iAYIh7
Amazon Canada:amzn.to/3Fm76cV
Amazon Germany :amzn.to/3UtVOYG
Amazon UK: amzn.to/3VuRNV1
Amazon France: amzn.to/3iCKfko
Amazon Spain: amzn.to/3Vu7uvA
Amazon Italy: amzn.to/3EYGu0v
Amazon Japan: amzn.to/3h0nbf1
SunFounder website: robojax.com/L/?id=367
eBay: ebay.us/xYb1lT
AliExpress: https://s.click.aliexpress.com/e/_DlS0a0F


Download Arduino Code: docs.sunfounder.com/projects/3in1-kit/en/latest


Use Chapters from timeline or click on the time
00:00 Introduction
1:23 Introduction to IR obstacle Avoidance
3:45 Wiring explained
5:39 Code explained
9:09 Code demonstration
10:27 Stop the car Added
11:40 StopTheCar code demonstration
12:12 Smtar Car Infrared Obstacle Avoidance Demonstration


Tutorial by Ahmad Shamshiri form Canada


If you found this tutorial helpful, please support me so I can continue creating contents like this. Here is PayPal link bit.ly/donate-robojax


Power Supply I use:
DC 30V 60A Power supply: https://s.click.aliexpress.com/e/_98Ah5c
DC 60V 30A Power supply: https://s.click.aliexpress.com/e/_APyPJ0


Follow me on Facebook fb.me/robojaxTV
Follow me on Twitter: twitter.com/robojaxTV
Follow me on Instagram: instagram.com/robojax
Follow me on TikTok : tickTok.com/@robojaxtv


Tutorial by Robojax.com
Get other projects code and learn Arduino
robojax.com
#SunFounder #robojaxSunFounder #robojaxSmartCar


**** AFFILIATE PROGRAM ****
We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites.
Lesson 25: Car-3 Smart Car Avoids Obstacle Using Infrared Sensors | SunFounder RobojaxESP32-S3 RGB LED Matrix Projects (Tilt Game, Text, Arrow, WiFi Demo)Lesson 96: Barometric Pressure, Temperature, Approximate Altitude Sensor BMP390 with LCD - RJT454Course Lesson 8 of 10: Follow Hand project with Raspberry Pi Pico 4WD Smart Car KitESP32 Tutorial 46 - Remote Temperature Monitoring using HiveMQ MQTT | SunFounders ESP32 kitLesson A3: Calibration and Robot HAT exaplined | PICAR-X Raspberry Pi Smart Robot car by SunFounderLesson 1: What is Arduino? Types of  Arduino Boards and SunFounder Kit | SunFounder Robojax - RJT584Lesson 9:  Reading Voltage Using Arduino, Potentiometer AnalogRead SunFounder Kit- RJT592Course Lesson 5 of 10: Controlling RGB LED WS2812B Using Raspberry Pi PicoLesson 58: Multidimensional Array and example with RGB LED - RJT494Face Recognition With NO Internet — $15 XIAO ESP32-S3 CameraESP32 Tutorial 9 - Using Push button to Toggle LED, Push ON, Push OFF -SunFounder ESP32 IoT kit
Robojax |

Lesson 25: Car-3 Smart Car Avoids Obstacle Using Infrared Sensors | SunFounder Robojax

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER