DIY ESP32 Powered RC Car

About Us:

Hello, we are Cody Carter and Ethan Fenton, Computer Engineering students at Louisiana State University. Using skills we gained through EE 3752 labs and lectures, we decided to apply our arm assembly knowledge to microcontrollers and create a fully functional RC car and controller powered by the ESP32. This project connects to ARM assembly and microprocessors by applying embedded system principles like GPIO/ADC handling, I/O, and real time communication. Skills we used in the labs including registers, loops, low-level debugging, and I/O helped us design and fabricate a functional project using the ESP32. This project is very important because it allowed us to take what we learned in class, and apply to a real world application. This connection is like what one would see in a job where you must think outside of the box using your technical skills to solve an issue.


Background Information and Design Process:

When we decided to take on this project, we started researching and deciding on what we need to make the RC car reliable, low cost, and fully functional.


We chose the ESP32 microcontroller as our processor due to low cost, form factor, adaptability, and Bluetooth and Wi-Fi capabilities. The Xtensa dual-core 32-bit LX6 microprocessor, operating at 240 MHz adds a lot of capability compared to a normal Arduino UNO. The ESP32 also includes peripherals we need without having to buy WI-FI/Bluetooth modules to interface between the car and transmitter externally.



Our first iteration of the prototype involved a toy RC car kit on Amazon for our base. 




 Our goal was to have a finished RC car kit that we can place all our electronics on so we would not have to design a chassis. To get this iteration working, we would have to buy an ESP32, and two H-bridge motor drivers for steering and throttle. For the controller we wanted to use a phone app and use ESP32’s Bluetooth capability to control the RC car. This iteration would have worked fine for the scope of this project, but after seeing how fast we would finish the project we came up with a new idea. We wanted to take the RC car a step further and make a faster, more durable, and more custom RC car with a fabricated controller. 


After research on Thingiverse, we settled on the platform called Carduino V2 and applied our own electronic design using the ESP32 Microcontroller and a brushless motor system. This design did not include any code files so this made it a perfect opportunity to design a system from scratch.



With the use of a personal 3D printer, we were able to fabricate our own parts without relying on our college’s printers.


When we started developing this prototype, we first had trouble with the brushless motor and ESC interface with the ESP32 board. Getting a signal going to the ESC was tricky, the motor would power on and begin beeping in 1 second intervals. Per the instructions for the motor indicated to us that it wasn’t receiving a control signal from the board. Further troubleshooting indicated that the problem was the ESC was waiting for certain throttle calibration steps involving full, low, and neutral throttle. Once we built that functionality into our code, we were able to interface and control the ESC. Thankfully, the steering servo worked right away, it gave us no issues since no calibration is needed. 


Parts List:

All of the physical car parts were 3D printed using plans from the Carduino V2 project on Thingiverse using black PLA with 80% infill for durability. Below is the complete list of parts we used in our project.


Compiled Parts List:

·       2x ESP32

·       1000kv A2212 Brushless Motor 30 amp ESC combo

·       2s 7.4 Volt LIPO

·       SG90 Servos

·       8x12x3.5 Bearings

·       A959 Tire

·       Screws

·       Joysticks and Wires

·       Headers

·       2x Blue LEDs

·       100 Ohm resistor

·       2x Clear White LEDs (For Headlights)

·       68 Ohm resistor


Method:

Chassis Construction:

Chassis construction was relatively simple, the instructions provided with the Carduino 3Dprint files were fairly thorough. The build was broken down into 3 sections; base, steering rack, and rear assembly.

The rear assembly went together first, this component holds in 4 bearings which support the rear axle and reduce friction when its powered. The brushless motor sits on a mount above the rear assembly, it powers a gear that connects to the rear axle providing motion for the vehicle. The entire construction is held together by 20 M3x10 screws. The rear assembly also supports the wing. The entire assembly is held onto the base with 2 screws forming a hinge-like mechanism, this functions as the suspension for the rear wheels.

The steering rack was slightly more complex. Each wheel is held by a hub that can rotate left or right depending on the servo mounted in the middle, the hubs are connected to suspension arms that allow for up-and-down movement. Tension is provided to both the front and rear suspension via a set of rubber bands tightly bound around hooks on the suspension arms.

The base is one single piece with a series of pegs that hold in the battery and the ESP32 board itself. Overall, the chassis went together decently well, the print didn’t include threads for the screws, this made it troublesome to screw everything together as we didn’t have a drill or any other means of forming our own threads. The chassis proved very sturdy and without fault during our testing, it has apt space for all the wiring and saved us a lot of time during the build since we didn’t have to fabricate our own chassis from the ground up.


Circuit Design:

For our RC car, this was the circuit diagram that we made that shows our wiring.





For our LEDs, we used Ohm’s law to calculate what resistors we needed to use to prevent the LED from burning out.




Arduino Code:

For the RC car and transmitter, we tailored our code to be able to successfully and reliably operate the system. The code took a lot of trial and error, but we are happy with how the product turned out.


Code Overview:

Below is a state chart that we wrote up to be able to clearly see the function of the code for specific parts of the program execution. 



Testing and Design Improvements:

·       During the debugging process, we added various serial monitor outputs at critical parts of the code to see logically why our code was not working. Such techniques, for example, were used to discover what values our joysticks outputted when we moved them.

·       During our prototyping, we first used WI-FI connectivity for communication between the car and controller. Due to noticeable input lag, we decided to use Bluetooth as the latency is 1-3ms. The disadvantage is the decreased range, but for the safety and reliable use of the system we opted for Bluetooth.

·       During testing, there were cases where the RC car would run away when there was a controller disconnection. As a result, we added in logic to always check for connection from the controller before each iteration. If there was no connection, the ESP32 would send a neutral throttle PWM value to prevent the car from running away.

- One issue we ran into was the A959 tires we used non compatible rims to work with our design. After printing out the supplied rims on the Carduino V2 instructions, the rims were slightly too small to fit the tires. So, we made the rim a 2mm bigger diameter on each side and add a small bit of material to the screw hole using a CAD program to account for the screw hole being slightly bigger after increasing rim size.  


Conclusion:

Overall, this was a very challenging but fun project that was very beneficial in applying our lab knowledge to a real-world application. This project connected to ARM assembly and microprocessors by applying embedded system principles like GPIO/ADC handling, I/O, and real time communication. This project took a lot of trial and error to get the car working safely and reliably but using skills we used in the labs involving low level debugging we were able to get a solution. This connection is like what one would see in a job where you must apply prior knowledge to solve an issue. In the future we hope to develop this RC car to be even more reliable and useable and see where this sort of idea can take us. 


I appreciate how PCBWay has provided professional solutions to students and electronics enthusiasts, and I believe that their sponsorship would be essential to easy and reliable construction of ESP32 breakout boards. Such boards will allow for removability in case of ESP32 failure or programming, as well as options for different pin assignments. With this breakout board, we could apply to more projects as a easy and reliable way to add a more permanent setup for the ESP32. It would be an honor to share the results with the PCBWay community and contribute my project to their platform, as well as inspire more hobbyists like me to experiment with electronics.


I will up and will make assembly so much easier.


Whether it’s school or personal projects, We are driven by the desire to create technology that makes a difference and improve our skills. If you’re interested in collaborating or discussing anything further, lets connect to talk about it.


Thank you very much for your time and consideration!


Apply for sponsorship >>
13800+ Projects Sponsored
Dec 05,2024
116 viewsReport item
  • Comments(0)
  • Likes(0)
Upload photo
You can only upload 5 files in total. Each file cannot exceed 2MB. Supports JPG, JPEG, GIF, PNG, BMP
0 / 10000