Arduino Tank Car Kit Lesson 2: Install tank car control board

Byamber

Arduino Tank Car Kit Lesson 2: Install tank car control board


Authorized Amazon Seller:

Robot Tank Car Chassis

Buy from US Buy from CA 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 CA Buy from UK Buy from DE Buy from IT Buy from FR Buy from ES

Objective:

In this lesson, we will install the most important framework in the tank car and program the car to do some simple movements. If you have passed the test movement in this lesson, it means Arduino UNO board, voltage meter,motor control driver module, motors, batteries,chassis and wire connections between these parts are all functioning well.

As your experiments in future lessons are all based on frame work of Lesson 1 and lesson 2, it is very important to test the installation and sample code in this Lesson properly.

II. Parts and Devices

Package Listing

III. Hardware Installation

I. Adjust the sensitivity of tracking sensor and Install the tracking sensor.

Before assemble the control board, we need to adjust the sensitivity of tracking sensor.

Connect expansion board to tracking sensor as the following graph. Put the expansion board on UNO R3 board and connect Arduino UNO to PC with USB cable.Then adjust the potentiometer on the tracking sensor with cross screwdriver until you get the best sensitivity status: the signal indicate LED light will turn on when sensor is above white ground, and the signal LED will turn off when the sensor is above black track.

II.Install electronic board on tank car chassis

(1)Install Arduino UNO,Expansion board,Driver board,Voltage meter and Buzzer Module on upper acrylic chassis with M3 x 10 philip’s head screws, Install IR receiver with M2.5*8 philip’s head screws.

Install the ultrasonic sensor on black acrylic board with M1.6*12 philips head screws, then install it on servo arm with philip’s head sharp screws.

(2) Assemble the Neccessary Components

Install bracket (from servo motor package) on mount holder for Ultrasonic Module with 2pcs M1.5*4 Self Tapping Screws.

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

Install the LED lights at the front of tank chassis;

Install the tracking sensor in the lower tank chassis with 2pcs M3x20 copper pillars;

Install the ir infrared obstacle avoidance sensor in the upper tank chassis with 2pcs M3x10 screws and nuts;

Install the battery box on tank car chassis with M3*10 screws.

Install the acrylic board on tank car chassis with 4pcs M3x20 copper pillars and 4pcs M3 nuts.

Install the SG90 servo motor at transparent acrylic with 2pcs M2.2*8 self-taping screws.

Install the SG90 servo motor at transparent acrylic with 2pcs M2.2*8 self-taping screws.

Install ESP8266 Expansion Board on UNO R3 board.
lesson2-HW-1

Turn the switch of esp8266 to “1” and “2” position, as the following photo shows.
lesson2-HW-2

(3)Connection Diagram

Connect Driver board K1 (or K2) and K3 (or K4) sockets to 2 motors as per the following graph.

L298N-motors

Connect the 2 LED light to expansion board as per the following graph.

LED-ESP8266 Board

Connect the right and left tracking sensors as the following graph.

II-Tracking_sensor-ESP8266

Connect the Uno board, battery box, Voltage Meter and driver board according below connection diagram.

II-Battery_box-UNO

Connect Voltage Meter to driver board as below connection diagram.

II-L298N-voltage

Connect buzzer sensor, IR receiver,Ultrasonic Sensor and SG90 servo motor to driver board as below connection diagram.

II-Buzzer-ESP8266

II-IR_Receiver-ESP8266

II-Ultrasonic_sensor-ESP8266

II-SG90_Servo-L298N

Connect D5,D6,D8,D9,D10,D12 Pins to driver board 6 control pins as per following graph (these pins are defined in sample code configuration.h file)

II-L298N-esp8266

Now hardware installation is almost down, you need to put the 18650 batteries inside the holder.Both flat top and button top 18650 battery can be put inside the holder. The button top battery is recommend because it is easier to figure out positive pole of the battery.If you buy flat top battery, you must make sure the positive pole of the battery is put on the + side of the holder.if you make put battery on wrong direction, it will damage the car.Before we install 18650 batteries into the box, we need burn the sample code into Arduino First.

IV. 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 https://www.arduino.cc/en/Main/Software?setlang=en , then install the software.

Step2 :The SG90 Servo can rotate approximately 180 degrees. Firstly we make the servo motor go to 90 degree position(middle position), then manually adjust the ultasonic sensor to straight forward direction. Thus to make sure the ultrasonic module can rotate to the left 90 degrees and also can rotate to the right 90 degrees. Find the servo_adjust.zip file in Tutorial/Lesson2/Code or download the servo adjust program from link:

http://www.kookye.com/download/Arduino_Tank_Car_Kit/servo_adjust.zip

Download and unzip, then upload the code to Uno board using Arduino IDE, turn on the power switch on the battery box. the servo motor will go to 90 degree position(middle position), At this time, if the ultrasonic sensor is not facing front direction of the car, you need manually adjust the sensor to straight forward direction.


Youtube link–https://youtu.be/t2kyK2RU0jU

Step 3: Download the libraries from http://www.kookye.com/download/Arduino_Tank_Car_Kit/IRremote.zip open arduino IDE  -> click sketch -> Include Libraries->Add .zip Libraries -> choose zip file “IRremote.zip”-> Upload the .zip files

Step 4: Download Lesson One sample code from http://www.kookye.com/download/Arduino_Tank_Car_Kit/tank_robot_lesson2.zip , unzip the download zip file tank_robot_lesson2.zip, you will see a folder called tank_robot_lesson2 .

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

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

V. Testing :

Connect Arduino from PC, put 2 fully-charged 18650 battery into battery pox(check the box instruction and make sure polar direction is correct). Open the power switch in the box and open arduino IDE, set the buat rate as 9600. You will find the information as follows:

welcome to use kookye tank robot car…
send :line follow/
send :led on/
send :led off/
send :servo/
send :distance/
send :buzzer/
send :go/
send :back/
send : stop/

When you put the car on the ground and send “line follow sensor”, the signal indicate LED light will turn on when sensor is above white ground, and the signal LED will turn off when the sensor is above black track.

When you send “turn on LED”, the LED light on car should turn on. “turn off LED”, the LED light should turn off.

When you  send servo, the SG90 servo motor should move.

When you send buzzer, the buzzer should beep.

When you send go ahead, it should go forward;send go back,it should go backward;send stop,it should stop.

If the car does not move as per above mentioned result, you should check your wire connection, battery voltage(must over 7.2v).

About the Author

amber administrator

You must be logged in to post a comment