Four Wheeled Smart Robot Car

1. Introduction

In this project we used an assembled Elegoo Smart Car Kit to control the car using the onboard sensors and an IR remote controller.  The onboard sensors included an ultrasonic distance sensor and IR sensors, and the car was controlled by four DC motors.

2. The Code and the Results

The car came fully assembled, so nothing was done for Task 1.


Figure 1 shows the code and results from Task 2. As readings were taken, an object was moved closer to the ultrasonic sensor to obtain these results.

  

Figure 1. Code and Results from Task 2

Figure 2 shows the code and results from Task 3. The servo is rotated while the car is in the 'Obstacle Avoider' mode to assess whether there are obstacles to the left or right.

Figure 2. Code and Results from Task 3

Figure 3 shows the code and results from Task 4. The DC Motors are used to control the car.

Figure 3. Code and Results from Task 4

Figure 4 shows the code and results from Task 5. We will use the IR sensors for the 'Line Tracking' mode  and this verify it works and displays the logic.

Figure 4. Code and Results from Task 5

Figure 5 shows the code that will be used for Task 6-8. They are all implemented together under differen't modes that can be entered from the IR remote.

Figure 5. Code for Tasks 6, 7, and 8

Figure 6 shows the results of pressing '1' on the IR remote to enter the 'Go Places' mode. Now the car is controlled by the IR remote.

Figure 6. The results from Task 6

Figure 7 shows the results of pressing '2' on the IR remote to enter the 'Line Tracking' mode. Now the car is using the IR sensors to follow the line.

Figure 7. The results from Task 7

Figure 8 shows the results of pressing '3' on the IR remote to enter the 'Obstacle Avoider' mode. Now the car is using the ultrasonic sensor to determine whether anything is in front of it, and actively turning to avoid crashing.

Figure 8. The results from Task 8

2. Discussion

This project was a great look into using a control loop and onboard sensors to implement differen't control strategies for the car. The background work we did with sensors really came together in this project to actually control the car using readings from the sensors.