Purchasing link

Buy from OSOYOO Buy from US Buy from UK Buy from DE Buy from IT Buy from FR Buy from ES Buy from JP

Content


1Objective

In this lesson, you will transform your OSOYOO V3 Robot Car into an intelligent object-following robot. By using two infrared distance sensors mounted at the rear of the vehicle, the robot can detect nearby objects and automatically adjust its movement to follow them.

This project introduces the fundamentals of sensor-based autonomous navigation and demonstrates how robots can interact with their environment using real-time sensor feedback.
Before starting this lesson, please make sure you have successfully completed Lesson 1: Basic Robot Car Assembly.

After completing this lesson, you will learn how to:


2Parts and Devices:

For the initial assembly phase, the following components are required. Please ensure all parts are accounted for prior to commencing the build

No. Picture Device Qty. Accessories Link
1 IR distance Sensor 2 M3 Plastic Screw x 2
M3 Plastic Nut x 2
M3 Plastic Pillar x 2
Click here to buy
3 20Pin jumper wire Male to female 20cm some Click here to buy
3 Philips screwdriver 1 Click here to buy
4 Hex Screwdriver 1 Click here to buy
5 M3 plastic screw 2
6 M3 plastic pillar 2
7 M3 plastic nut 2

 

3How It Works

The robot uses two infrared distance sensors to detect objects positioned behind the vehicle.
Each sensor continuously checks whether an object is within its detection range. The Arduino controller reads the sensor outputs and determines how the robot should move:

Left Sensor Right Sensor Robot Action
Detected Detected Move Forward
Detected Not Detected Turn Left
Not Detected Detected Turn Right
Not Detected Not Detected Stop

Because the sensors are installed at the rear of the robot, the vehicle appears to “follow” your hand or another object as you move it.

4Hardware Installation

Step 1: Assemble the basic robot car according to Lesson 1. If your robot has already been assembled, no additional disassembly is required.


Step 2: Remove the M3 hex screen on upper chassis. Attach two infrared distance sensors to the rear section of the lower chassis using M3 plasic screws, plastic pillars, and plastic nuts.

Important:

Step 3: Connect the two IR distance sensors according to the wiring diagram provided below:

⚠️ 1. Do not disconnect any existing wiring installed in Lesson 1.
      2. Insert the sensor wires securely to prevent intermittent signal loss during operation.

Step 4: Reinstall the upper chassis and tighten all mounting screws.


5Software Installation

Open-source Arduino
Software(IDE)
Download software here:
https://www.arduino.cc/en/Main/Software?setlang=en
7 zip is a free zip
utility that unzips zip files
Download 7zip here for free
https://www.7-zip.org/

1. Arduino IDE Setup: Download and install the latest version of the Arduino Integrated Development Environment (IDE) from https://www.arduino.cc/en/Main/Software?setlang=en.


2. Code Acquisition: Download the provided sample code for Lesson 3 from here. Extract the contents and you will get a v3car-lesson3.ino in the folder v3car-lesson3.

3. Board and Port Selection: Connect the OSOYOO Basic Board (compatible with Arduino UNO) to your computer via a USB cable(Crucially, ensure the robot car’s power switch is OFF and the battery is disconnected before connect the board to your PC). Launch the Arduino IDE. Navigate to Tools > Board and select Arduino Uno. Then, go to Tools > Port and select the appropriate serial port. If unsure, check your operating system’s device manager for the assigned port.

4. Code Upload: Open the v3car-lesson3.ino sketch in the Arduino IDE. Click the “Upload” button (right arrow icon) to compile and transfer the sketch to OSOYOO Basic Board.


6Sensor Calibration

Before testing, adjust the sensitivity of both IR distance sensors.

Calibration Procedure

  1. Power on the robot, and hold your robot car.
  2. Place your hand approximately 10 cm in front of the sensor.
  3. Rotate the onboard potentiometer slowly.
  4. Observe the indicator LED.

Correct Adjustment

 

7Test the Car

After calibration, turn on your robot, place an object or your hand behind the robot. Slowly move the object and Observe the robot’s response.

Expected Behavior

Note:
1. Since the IR sensors are mounted at the rear of the vehicle, the robot’s movement logic is opposite to many other lessons.

2. This project only supports: Forward movement, Left turns, Right turns. Reverse movement is not implemented in this lesson


8Troubleshooting

1. Robot Does Not Move
Check:

2. Robot Always Moves Forward
Possible causes:

Try recalibrating the sensors.

3. Robot Turns Randomly

Check:

Both sensors should be adjusted to similar detection distances.