http://osoyoo.com/?p=9847
Objective | |
![]() | |
Welcome to the first lesson of Arduino smart car! | |
In this "Hello World" version lesson, we will install the most important framework in the smart car and program the car to do some simple movements. If you have passed the test movement of this lesson, it means Arduino, voltage meter,motor control 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 One, it is very important to test the installation and sample code in this Lesson properly. | |
Parts and Devices: |
Hardware Installation |
1)Connect 4 motors on lower chassis with screw M3 x 30 |
2)Install OSOYOO Model X motor driver module to lower chassis with screw M3 x 10, connect OSOYOO Model X motor driver module K1 to K4 sockets to 4 motors as per following 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 Model X motor driver module according below connection diagram: |
7)Connect Voltage Meter to Model X motor driver module as below connection diagram. |
Voltage Meter | motor driver |
GND | GND |
VCC | 12V |
Vt | VD |
8)Connect Arduino UNO D2,D4,D5,D6,D7,D8 to motor driver module 6 control pins as per following graph (these pins are defined in sample code configuration.h file) |
Uno R3 Board | Motor driver |
D2 | IN1 |
D4 | IN2 |
D5 | ENA |
D6 | ENB |
D7 | IN3 |
D8 | IN4 |
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=en , then install the software. |
Step 2: Download Lesson One sample code from Lesson 1 Sample code , unzip the download zip file smartcar-lesson1.zip, you will see a folder called smartcar-lesson1. (Or you can find the code directly from our CD user manual: OSOYOO Robot Car Starter Kit >> Code) |
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 4: Choose corresponding board/port for your project,upload the sketch to the board. |
Disconnect Arduino from PC, put 2 fully-charged 18650 battery into battery pox(check the box instruction and make sure polar direction is correct, otherwise it can destroy your device and cause fire hazard). Please intall insert your battery as per following instruction: |
Open the power switch in the box and your smart is RUNNING! |
When you put the car on the ground, it should go forward 5 seconds, then go backward 5 seconds, then left turn for 5 seconds, then right turn for 5 seconds, then stop. |
If the car does not move as per above mentioned result, you should check your wire connection, battery voltage(must over 7.2v). |
![]() ![]() |