Introduction: OSOYOO Arduino Robot Car

Please follow us on facebook, find our new released item and share your idea and Video on how to creatively use our products. You can get cash back or giveaway from us!

Facebook: https://www.facebook.com/pg/OsoyooProducts
Youtube: https://www.youtube.com/channel/UCZsnf-n1TR1MGQT-...

OSOYOO robotic car learning kit is designed for beginners to learn Arduino programming and get hands-on experience on robot design and assembly.
We have developed a step-by-step tutorial which evolves from a simple car without any control to a multi-function robotic car controlled by mobile APP.

Every lesson has detailed sample code with comments,circuit graph, assembly instruction and video. Even if you have no programming experience, you can follow the step-by-step instruction and gradually become a master.

Our robotic car is 100% open source. If you are an intermediate player and have time to read our code comments, you can easily customize this robotic car to make your own project for science fair, college home work or even commercial applications.

This kit contains module parts including L298NPro motor driver module(*), Ultrasonic Sensor module, Tracking module, Infrared Remote Control, Bluetooth module and ESP8266 Wifi shield, etc. With these modules, the robot car can work in multiple modes such as auto-go, infrared control, obstacle avoidance and line tracking. You can use our Android APP to change working mode through Wifi or Bluetooth.

*L298NPro motor driver module is an improved L298N module which has newly designed wiring sockets and can greatly simplify the assembly procedure and wire connection stability.

You can buy this Arduino robot car from Amazon:

https://www.amazon.co.uk/dp/B074YXCVFM

https://www.amazon.com/dp/B074Z6DMYP

https://www.aliexpress.com/store/product/OSOYOO-Sm...

Packing list:

  • 1x UNO R3 board with USB cable
  • 1x ESP8266 Expansion Board
  • 1x Bluetooth module
  • 1x L298N MOTOR driver module
  • 5x Tracking sensor module
  • 1x SG90 servo Motor
  • 1x Ultrasonic Sensor module
  • 1x Buzzer sensor module
  • 1x IR Receiver
  • 1x IR Remote controller
  • 1x voltage meter
  • 1x Box for 18650 3.7V battery
  • 1x DC power connector with wires
  • 1x lower chassis
  • 1x upper chassis
  • 4x Wheel
  • 4x Gear Motor with wires
  • 4x Velocity encode
  • 8x Acrylic fastener for Gear Motor
  • 1x Mount Holder for SG90
  • 1x Mount Holder for Ultrasonic Sensor
  • 5x 8pin Jumper wires female to female 20cm
  • 1x 20pin Jumper wires male to female 15cm
  • 2x 1pin male to 5pins female Jumper wire
  • 1x Cross Screwdriver5x Copper pillar 10x M3*5 screw
  • 8x M3*30 screw and nuts
  • 25x M3*10 screw and nuts
  • 4x M2.5*10 screw and nuts
  • 3x M2*10 screw and nuts
  • 6x M1.5*12 screw and nuts

Step 1: Install UNO R3 Board and Motors on Chassis

1)Connect 4 motors on lower chassis with screw M3 x 30

2)Install L298N motor driver module to lower chassis with screw M3 x 10, connect L298N N1 to N4 sockets to 4 motors as per connection graph

3)Install Arduino UNO on upper chassis with screw M3 x 10
4)Install Battery Box on upper chassis with screw M3 x 10 5)Install Voltage meter on upper chassis with screw M3 x 10

6) Connect the Uno board, battery box, Voltage Meter and L298N according connection diagram:

7)Connect Voltage Meter to L298N as below connection diagram.

8)Connect Arduino UNO D2,D4,D5,D6,D7,D8 to L298N module 6 control pins as per following graph (these pins are defined in sample code configuration.h file) 9)Connect upper chassis to lower chassis with five copper pillar screw supporters, then install 4 wheels onto the motors.

Now hardware installation is almost down. Before we install 18650 batteries into the box, we need burn the sample code into Arduino First.


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=e... , then install the software.

Step 2: Download Lesson One sample code from https://www.arduino.cc/en/Main/Software?setlang=e... , unzip the download zip file smartcar-lesson1.zip, you will see a folder called smartcar-lesson1 .

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

Step 2: Control Robot Car Through Infrared Remote

Add an IR receiver module onto the car. Install the IR receiver module with M2.5*10 screws and nuts, washers at the front of upper chassis.

Connect the S pin in IR receiver to D3 pin in UNO board, GND to GND, VCC to 5V, as the connection graph.

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=e... , then install the software.

Step 2: Install IRremote library into Arduino IDE (If you have already installed IRremote library, please skip this step)Download IRremote library from http://osoyoo.com/wp-content/uploads/samplecode/I... then import the library into Arduino IDE(Open Arduino IDE-> click Sketch->Include Library->Add .Zip Library)

Step 3: Download Lesson 2 IRremote smart car sample code from http://osoyoo.com/driver/smartcar-lesson2.zip and unzip the download zip file smartcar-lesson2.zip, you will see a folder called smartcar-lesson2.

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

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

Step 3: Obstacle Avoidance Robot Car

we will add a servo motor, an ultrasonic module and a buzzer now. 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.

Hardware:

  1. Connect the SG90 servo motor to the holder with screw M2 x 10
  2. Connect the servo motor arm to brakect with 2 x screws which comes with the servo motor, Connect the Ultrasonic Module to bracket with M1.5 x 12 screws and nuts
  3. Fix the mount holder for servo motor on upper chassis with M3 x 10 Screws and nuts.
  4. Put the arm with ultrasonic module on SG90 servo motor
  5. Fix the Buzzer module with M3 X 10 screw and nut on upper chassis.

Connect the buzzer module, ultrasonic module and servo motor as per below connection diagram:

  • Uno R3 Board GND-> Buzzer Module GND
  • Uno R3 Board 3.3V-> Buzzer Module VCC
  • Uno R3 Board I/O->Buzzer Module D13
  • Ultrasonic Module GND->Uno R3 Board GND
  • Ultrasonic Module Echo->Uno R3 Board D11
  • Ultrasonic Module Tr1g->Uno R3 Board D12
  • Ultrasonic Module VCC->Uno R3 Board 5V

  • Uno R3 Board D2 L298NPro IN1

  • Uno R3 Board D2 L298NPro IN1

  • D4IN2D5ENAD6ENBD7IN3D8IN4D9

  • SSG90 Servo MotorL298NProBrownGNDRed5vYellowS

  • Uno R3 D2 -> Board L298NPro IN1
  • Uno R3 D4 -> Board L298NPro IN2
  • Uno R3 D5 -> Board L298NPro ENA
  • Uno R3 D6 -> Board L298NPro ENB
  • Uno R3 D7 -> Board L298NPro IN3
  • Uno R3 D8 -> Board L298NPro IN4
  • Uno R3 D9 -> Board L298NPro S
  • SG90 Servo Motor Brown -> L298NPro GND Red5vYellowS
  • SG90 Servo Motor Red -> L298NPro 5V
  • SG90 Servo Motor Yellow -> L298NPro S

4) Software
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.

Download the servo adjust program from link: http://osoyoo.com/driver/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. Then fix the ultrasonic module on sg90 servo motor with M2 x 10 screw

Software Installation:

Step 1:Download Lesson One sample code fromhttp://osoyoo.com/driver/smartcar-lesson3.zip , unzip the download zip file smartcar-lesson3.zip, you will see a folder called smartcar-lesson3 .

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

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

Final Testing :
Turn on the power switch on the battery box, the ultrasonic module turn to front view position. If no obstacle is detected, the car will go forward. If any obstacles is detected, the car will go backward first, then the ultrasonic module will turn from right to left to detect surrounding obstacle. If obstacle is found on the left, the car will turn right and vice versa. If both right and left side have obstacles, the car will go backward.

Step 4: Tracking Robot Car

Now we will add 5 black/white tracking sensors. The software will read data from these 5 black/white tracking sensors and automatically guide the smart car to move along the black track line in the white ground.

  1. Fix tracking sensor module on lower chassis with 5pcs M3*10 screw and M3 nuts. Make sure that every sensor head is over the gaps at the front side of lower chassis so that the sensor can detect black lines in white ground.
  2. Fix tracking sensor module on lower chassis with 5pcs M3*10 screw and M3 nuts. Make sure that every sensor head is over the gaps at the front side of lower chassis so that the sensor can detect black lines in white ground.
  3. From left to right, connect the D0(D zero) pin in tracking sensor module to D3, A1, A2, A3, D10 pin in UNO board. Remember: DO NOT remove any existing wires installed in Smart Car Lesson 1 . Use 1pin male to 5 pins female jumper wires to connect VCC and GND of 5pcs tracking sensor modules. Connect VCC of tracking sensor module to 5V in UNO board, GND to GND. As the photo shows.

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=e... , then install the software.
Step 2: Download Lesson 4 tracking smart car sample code from http://osoyoo.com/driver/smartcar-lesson4.zip , unzip the download zip file smartcar-lesson4.zip, you will see a folder called smartcar-lesson4 . Step 3: Connect UNO R3 board to PC with USB cable, Open Arduino IDE -> click file -> click Open -> choose code “smartcar-lesson4.ino” in smartcar-lesson4 folder, load the code into arduino. Step 4: Choose corresponding board/port for your project,upload the sketch to the board.

Testing:
Prepare a black track (the width of the black track is more than 20mm and less than 30mm) in white ground. Please note, the bend angle of track can’t be larger than 90 degree. If the angle is too large, the car will move out of the track. Turn on the car and put the middle of tracking sensor module facing over black track, and then the car will move along the black track.

Step 5: Control Robot Car Through Wifi and Bluetooth

Now, we learn how to control the Robot car mobile APP through WiFi and Bluetooth

Hardware Installation:

Step 1) Install ESP8266 Expansion Board on UNO R3 board:

Step 2) Move every wire connected to digit ports(D2 to D13 , A1-A3)) in UNO R3 board to its counterpart digit pin in ESP8266 Expansion Board. please see connection graph

Step 3) Turn the switch of esp8266 to “1.2” position

Step 4)Load Sample code: http://osoyoo.com/driver/smartcar-lesson1.zip into Arduino Uno

Step 5) Turn the switch of esp8266 to “on” position

Step 6) Turn on switch in the battery box. If there car can make movement as described in Lesson 1 (go forward 5 seconds, then go backward 5 seconds, then left turn for 5 seconds, then right turn for 5 seconds, then stop), it means wire connection with ESP8266 Expansion Board and R3 UNO board are all correct. Otherwise please check the each Digital Pin connection in ESP8266 Expansion Board and UNO R3.

Software Installation:
Step 1: Before upload code in esp8266, please turn the switch of esp8266 to “1.2” position

Step 2: Download Lesson 5 sample code from http://osoyoo.com/driver/smartcar-lesson5.zip , unzip the download zip file smartcar-lesson5.zip, you will see a folder called smartcar-lesson5.
Step 3: Connect Arduino UNO to PC with USB cable, Open Arduino IDE -> click file -> click Open -> choose code “smartcar-lesson5.ino” in smartcar-lesson5 folder,, load the code into arduino.

Step 4: Choose corresponding board/port for your project,upload the sketch to the board.
Note: Bluetooth module and Arduino board communicate with each other through UART serial port. Please remove bluetooth module before uploading sketch in Arduino board, or the sketch will be uploaded unsuccessfully.

Step 5: Turn the switch of esp8266 to “on” position

Step 6: Download app. in Android phone from the link: http://osoyoo.com/driver/car.apk.

Note: Android APP Source code: http://osoyoo.com/driver/BTcar-master.zip(Please note: the APP is just compatible with Android OS)

Testing:
Step 1: Turn on switch in the battery box

Step 2:If you want to control the robot car through WIFI, please scan WiFi hotspot with your Android phone which you have installed APP and search for wifi named” DoitWIFI_Config”, Click connect(no password needed).

Step 3: Open app>> select WiFi mode>> then you can controller the robot car through wifi

Step 4: If you want to control the robot car through Bluetooth, please turn on bluetooth of your Android phone which you have installed APP and scan bluetooth(different bluetooth module will scan different bluetooth name), Click connect and enter password “1234” or “0000” if no change (You can change wifi or bluetooth settings in Android phone to switch to control car through wifi or bluetooth):

Step 5) Open app>> select bluetooth mode>> then you can controller the robot car through bluetooth:

Comments

About This Instructable

2,039views

8favorites

License:

More by osoyooproduct:Arduino IoT Project - Reading a Photoresistor Sensor dataArduino IoT Project - Remote Control a LEDArduino IoT Project - Connect Arduino to Cayenne IOT Platform
Add instructable to: