Arduino RC Car


We created an Arduino-based RC car that can parallel park itself, follow a line, and is easily controlled using the remote controller and the coding we developed. Below is what you will need and how to produce our RC car or a car of your design using our steps as a guideline!
Supplies

.jpg)





Here is a breakdown of the costs associated with creating our car. However, each team's car and project are subject to changes in price and materials used. Our team was able to receive all the parts through our university, except for the ELEGOO UNO kit. This kit was required for previous classes and you may already have the parts necessary.
Parts required from the kit:
- Arduino or ELEGOO Uno or equivalent
- An HC-SR04 Ultrasonic Sensor to have two in total
- An infrared module with a remote
- Assorted Wires
- L293D Motor Driver
Any missing components can be taken from the Toy RC car in step one.
Make sure you have the following equipment on hand:
- Computer with the Arduino IDE software and a 3D printing slicing
- Hot glue gun
- Small screwdriver set
- 3D printer
Take Apart the Toy Car

To access parts, including precisely made gears, look for any broken or dead RC car at your local thrift store. We used this flipping car found at our local Goodwill. From this car you will need the following:
- Two Wheels
- Two dc motors
- Gears
These parts are typically very accessible and allow your car to move accurately. It is preferable to use the gears from the car. 3D printing gears, especially small gears, can often lead to misaligning and nonfunctioning gears.
Create a Gearbox

Using the parts taken from the RC car, design a gearbox using CAD software (like SolidWorks). Take creative liberties as to how the gearbox looks and acts. The final case can then be 3D printed and assembled using screws from the toy car and hot glue.
By making your own gearbox, you have more control over the strength needed by the DC motor to start moving. This is a huge current issue for most circuits, by increasing the gear reduction, your gearbox becomes a lot stronger.
Design the Circuit (Possible PCB)





Following the given schematic, you can test your code with a breadboard to make sure that your motors move. The capacitors across the motors are 0.1μF to help balance the PWM signals from the motor driver. After making sure that this circuit works, you can also design a PCB where the Arduino is mounted to the back for easier wire management. Our board was designed on the free software KiCad and made through our university.
*Important note our original concept used nrf24l01 RF transmitters to be used for remote control. However, this was abandoned after one of the modules broke. As such, the RF receiver parts on the circuit can be removed because the IR sensor used the ports from one of the ultrasonic sensors (I/O Pin 4, 5V and Gnd).*
Create the Chassis

Use CAD software (like SolidWorks) to create a basic idea of what you want the car to look like. Be sure to take into account functionality and additional attachments that will be added later. Our chassis base was made with laser-cut acrylic; however, this can be any material you like. Be sure the final design has these properties:
- Line following sensors are close to the ground without touching for the best readings
- One ultrasonic sensor faces the front of the car and one faces the side
- Batteries are near the wheels to avoid losing control from the weight distribution
- Have access to the Arduino port to use Serial.prints to diagnose any issues
- Make sure there is enough openings for all wiring
Choose a Power Source



In this case, we decided to use 6 AA batteries (9V) to power the car. However, you can use any power source that you choose as long as it is between 5.5V 12V. Make sure that the Arduino is receiving power via the green light on the Uno.
Assemble Car





Put together the car and make sure that all mounts are secure. Now add any sensors, components, and necessary wiring to your RC car!
After assembling run some tests to make sure that all connections are good with proper feedback from sensors.
Upload Your Code
Upload the correct code and ensure that it runs smoothly before sending it to your car as a final product. Function check and test all controls before finalizing your code! (This is the code we used for our car)
These codes require the following libraries:
- SoftPWM.h
- Adjusts the speed of the motors for a smoother acceleration
- IRremote.h
- Reads and translates the IR sensor inputs
- HCSR04.h
- Reads and translates the ultrasonic sensor inputs
You're Off to the Races!




Your Arduino RC Car is complete! All that is left to do is to test, race and tweak any issues it may have but most importantly, its time to have fun! Don't forget to leave your rating and share photos!
For both parallel parking and line following, simply turn on the car using the power switch and place the car down in 2 seconds. The car will complete the required tasks autonomously. Once the task is completed, turn off the car before the looping code runs again.
When using the remote control, the following buttons control the car:
- 4: Left wheel - forward
- 7: Left wheel - backward
- 5: Both wheels - forward
- 8: Both wheels - backward
- 6: Right wheel - forward
- 9: Right wheel - backward
When making your car, these buttons can be changed with other functions. You can experiment by changing the loop in the RemoteControlCode.ino.
Video Examples

Here is the video of our RC car performing all the requirements for the courses in the given photo.