Authorized Amazon Seller

Robot Tank Car Chassis

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

Robot Tank Car Electronic Parts Kit

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

I. Objective:

In this lesson, we will install 2pcs IR Obstacle Avoidance modules on robot car and program the car to follow object movements. The principle of this experiment is based on IR detection object. The car receives the signal from the IR Obstacle Avoidance module, and then the program will drive the car to take actions.

II. How It Work:

About Obstacle Avoidance Sensor

IR Obstacle Detection Module Pin Outs

The IR transmitter sends an infrared signal that, in case of a reflecting surface (e.g. white color), bounces off in some directions including that of the IR receiver that captures the signal detecting the object.

When the surface is absorbent (e.g. black color) the IR signal isn’t reflected and the object cannot be detected by the sensor. This result would occur even if the object is absent.

III. Software Installation:

Step 1: Install latest Arduino IDE (If you have Arduino IDE version after 1.1.16, please skip this step)
Download Arduino IDE from , then install the software.

Step 2:Download Lesson 9 sample code from , unzip the download zip file, you will see a folder called tank_robot_lesson9.

Step 3: Connect UNO R3 board to PC with USB cable, Open Arduino IDE -> click file -> click Open -> choose code “tank_robot_lesson9.ino” in tank_robot_lesson9 folder, load the code into arduino.


Step 4: Choose corresponding board and port for your project,upload the sketch to the board.


IV. Understanding the Code:

Step 1: Define the pinout of left and right tracking sensor.

#define LFSensor_1 A0 //line follow sensor1
#define LFSensor_2 A1 //line follow sensor2

Step 2:Read the signal from tracking sensor and store the signal value.

V. Hardware Installation:

Step 1: Add 2pcs IR Obstacle Avoidance modules onto the car. Install the IR Obstacle Avoidance modules with 2pcs M3*10 plastic screws, M3 plastic pillars and M3 plastic nuts at the front of low tank chassis.

Step 2: Remove the wire connect to pinout of car LED and then move the wire connected to pinout(OUT,GND,VCC) in IR obstacle avoidance sensor to the counterpart pin in expansion Board as the following picture.

Step 3: Turn the switch of esp8266 to “1” and “2” position, as the following photo shows.

Step 4: Turn on the tank, put object about 10cm ahead of each IR Obstacle Avoidance modules and adjust potentiometer on IR Obstacle Avoidance modules to detect object or your hand.

Note: When these module detect objects, the power indicator and signal indictor are on. when you move object over detection distance, the power indicator is on. If the signal indictor is always on even though the object is over detection distance, you also need to adjust the potentiometer.

Final Testing:

Turn on the car, move object or your hand ahead of car, and then the car will move accordingly: looks like you pull it. It goes forward when both IR Obstacle Avoidance modules detect object or your hand; it turns right when the right IR Obstacle Avoidance modules detect object; it turns left when the left IR Obstacle Avoidance modules detect object. when object or your hand is over 10cm ahead, it will stop.