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

In this lesson, we will add a servo motor, an ultrasonic module and a buzzer onto Lesson 1 framework. With these new devices, the car can “see” obstacle through ultrasonic sensor and measure the distance. If the distance is less than predefined threshold value, the buzzer will beep and the car will turn around from the obstacle automatically.
You must complete lesson 1 (assembling the car) before you continue on with this lesson.

TR300 tank car chassis x1 +Acrylic board chassis x1
OSOYOO UNO R3 board fully compatible with Arduino x1
OSOYOO V1.3 WIFI shield x1
OSOYOO Model X motor driver x1
OSOYOO Battery box x 1
OSOYOO Voltage meter x1
OSOYOO SG90 Micro Servo Motor x1
OSOYOO Ultrosonic avoidance module x1
18650 batteries(3.7V) x 2
some screws and jumper wires

Step 1: Install the smart car basic frame work as per Lesson 1 .If you have already completed installation in Lesson 1 , Everything keep it as is except move ENA from D9 to D3(we need D9 for Servo control).

Step 2: Install Ultrasonic Module to mount holder with 4pcs M1.4*8 screw and M1.4 nuts.

Step 3:Remove screws on copper pillars and install servo motor at the front of car chassis with 2pcs M2.2*8 Self Tapping Screws.

Step 4: Install mount holder for Ultrasonic Module on servo motor with M2*4 Self Tapping screw (Please note: please upload code to adjust servo motor direction before fixing this screw).

Step 5: Install Buzzer module at the back of upper chassis with 1pc M2.5 plastic screw, M2.5 plastic pillar and M2.5 plastic nut.

Step 6: Install the smart car basic frame work as per Lesson1(2). If you have already completed installation in Lesson 1, Everything keep it as is except move ENA from D9 to D3 .

Connect OSOYOO  wifi shield and OSOYOO MODEL X motor driver module  as following graph.

Step 7: Connect Ultrosonic sensor GND to GND,Echo to D2,Trig to D10 and VCC to 5v in UNO board.

Connect OSOYOO wifi shield and ultrsonic sensor module as following graph.

Step 8:Connect SG90 servo GND to GND, 5v to 5v and S to S in model X. Then use 1 pin jumper wire to connect S in model X to PIN 9 in UNO Board.

Connect OSOYOO model X board and  SG90 servo  as following graph.

Step 9: Connect buzzer sensor GND to GND,I/O to D13,VCC to 3.3V in UNO board.

Connect OSOYOO wifi shield and  buzzer sensor module as following graph.

Step 1: Install latest Arduino IDE (If you have Arduino IDE version after 1.1.16, please skip this step)Download Arduino IDE from https://www.arduino.cc/en/Main/Software?setlang=en , then install the software.

Step2 :Download Lesson One sample code from https://osoyoo.com/driver/TR300_tank/arduino_tank_carV2.0/tankcarV2.0-lesson5.zip , unzip the download zip file, you will see a folder called tankcarV2.0-lesson5.ino.

Step 3: Connect Arduino UNO to PC with USB cable, Open Arduino IDE -> click file -> click Open -> choose code “tankcarV2.0-lesson5.ino” in folder, load the code into arduino. (Notice: Shut off your battery or Unplug your power adapter when upload sketch code to Arduino.)

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

Step 5: Ultrasonic sensor servo initial direction alignment.

After turning on the battery, you will hear a long beep sound, then the servo will make some movement and finally stops at a direction for 5 seconds.

During this first 5 seconds, you must make sure the Ultrasonic sensor(two eyes) is facing straight forward.

If it is not straight forward, you should turn off battery immediately and remove the sensor from servo, reinstall it and make it facing straight forward direction as following picture. Otherwise the obstacle avoidance program will not work properly.

After adjusting sensor direction, turn on battery again. After hearing the long beep, the sensor should face front same as following picture. If its direction is not straight forward, turn off battery and do direction alignment again.

Final Testing :

After Turning on the battery switch on the battery box, if the ultrasonic module turn to front view position, that means you no need adjust sensor position anymore. Just wait 5 seconds. If no obstacle is detected, the car will go forward. If any obstacles is detected, the car will stop, the ultrasonic module will turn from right to left to detect surrounding obstacle. The robot car will decide to make left turn, right turn or backward according to obstacle sensor data and our obstacle avoidance algorithm.

Sometimes your car might have collision and make your Ultrasonic sensor position change, you must remember to do sensor direction alignment again as per Ultrasonic sensor servo initial direction alignment.