Assembly instruction of the Elegoo Smart Robot Car is quite simple and the assembly procedure can be obtained from Elegoo website https://www.elegoo.com/download/ and select "Elegoo Smart Robot Car Kit V3.0 Plus." The Elegoo's assembly instruction is also provided here.
When you open the Smart Car kit, you will find all the hardware in designated plastic bags. Follow the instruction above and enjoy the assembly process. Just one advice, DO NOT assemble the top and bottom "Base Plates" together on page 16 of the assembly manual. The illustration on page 16 is deceiving that it looks like those Plates are assembled on step 16; however, these Plates should be assembled on step 19 after all the electrical wires are connected to the motor driver that is mounted onto the bottom Plate. Other than this, the assembly process is quite easy and intuitive.
Once the Smart Car is fully assembled, the next step is testing all the functions and operations of the car. The Smart Car comes fully loaded with the "SmartCar Multi functions" software that allows the car to be operated in four mode of operations: Bluetooth Mode, Line Tracking Mode, Obstacle-avoidance Mode, and IR-Remote Control Mode. However, all these basic codes for the Smart Car are also provided by Elegoo and these codes can be downloaded from Elegoo's website. The downloaded Zip file has six sections for tutorial purpose. We will start form the AUTO_GO.ino sketch that moves the car in all directions. We will also need Arduino IDE to compile and run these codes.
Smart Robot Car – Initial Test
The Smart Robot Car has the following functions:
1. Bluetooth Mode
2. Line Tracking Mode
3. Obstacle-avoidance Mode
4. IR-Remote Control Mode
Make the Car Move
We will try to make the car move automatically: go forward 0.4s - back up 0.4s - turn left 0.4s - turn right 0.4s. First of all, let's see the connection of the motor and the L298N board. We will use Arduino pins 5, 6, 7, 8, 9, and 11 to control the car using the motor controller. Pin 9 and 11 control the right wheel and pin 7 and 8 control the left wheel. The remaining two pins, 5 and 6 are used to control ENA and ENB respectively.
After the "Auto Go" sketch is uploaded to the Arduino UNO, place the Smart Car on a level surface. Turn on the battery switch and observe the test. The Smart Car moves forward for one second and then reverses for one second. It then turns left for one second and then right for one second. This sequence repeats forever. The "Auto Go" test verifies the motors operation and the overall performance of the Smart Car.
Once you verified the assembly and motor operation of the Smart Car using the "Auto Go" sketch, you can use the "Bluetooth Car" Sketch form the downloaded files to perform the Bluetooth operational test. First, install the Elegoo Bluetooth App, "Elegoo BLE Tool", on your smartphone from Google Play Store for Android or from App Store for an iPhone.
Then, upload the "Bluetooth Car" Sketch to your Smart Car Arduino board. A copy of the "Bluetooth Car" Sketch is also provided here.
Line Tracking Mode
In this mode of operation, you will need a black tape (provided in the kit). Make your own closed path similar to the image provided here. It is recommended that you make the closed path as smooth as possible.
In order to test the Line Tracking Module, download the Arduino sketch, "Line_tracking_car.ino" to your Smart Car and position the Smart Car on the closed path. Turn on the power switch and then the Smart Car will start to navigate along the black line until you stop the car by turning the power switch off. The Arduino sketch is also provided here for convenience.
Elegoo’s collision avoidance mode uses HCSR04 ultrasonic sensor which is mounted at the front of the smart car. The ultrasonic sensor is mounted on the servo motor allowing to sweep for about 180 degrees. The ultrasonic sensor uses sonar to determine distance to an object. It offers excellent range detection with high accuracy from 2cm to 400 cm or 1” to 13 feet.
The timing diagram of HCSR04 is shown the figure below. To start the measurement, Trig of SR04 must receive a pulse of high (5V) for at least 10us, this will initiate the sensor to transmit 8 pulses of ultrasonic burst at 40kHz and wait for the reflected ultrasonic burst. When the sensor detected ultrasonic from the receiver, it will set the Echo pin to high (5V) and delay for a period which is proportion to a distance based on the object detection.
To obtain the distance, measure the width (Ton) of Echo pin.
Time = Width of Echo pulse, in uS (micro second)
- Distance in centimeters = Time / 58
- Distance in inches = Time / 148
- Or you can utilize the speed of sound, which is 340m/s
The ultrasonic module can be tested using Arduino microcontroller and the following sketch function.
Obstacle Avoidance – Operation
The principle of obstacle or collision avoidance is as simple as “if – else if – else” statement in C++ or any other programing languages. The ultrasonic sensor module will detect the distance between the car and an obstacle in front of it and sending the data to the microcontroller. Then, the microcontroller sends a corrective action to the smart car and this process continues repeatedly.
The algorithm follows the following sequence.
Now, we have the basic understanding of the obstacle avoidance system, let us start the fun part.
After uploading the above sketch to the Arduino board, disconnect the cable, put the vehicle on a flat surface and power on the Smart Car battery switch. Then, you will see that the vehicle will move forward while the ultrasonic sensor measures the distance continuously. If there are obstacles ahead, the Smart Car will stop, and it will change its direction to bypass the obstacle ahead. This process will continue until the Smart Car is turned off.
»»» END of Elegoo Smart Car »»»
Have a question or comments?
- click here to ping me