Building a Bluetooth-Controlled Robot Car With ESP32 and PS3 Controller | DIY

by Amit_innovates in Circuits > Arduino

88 Views, 1 Favorites, 0 Comments

Building a Bluetooth-Controlled Robot Car With ESP32 and PS3 Controller | DIY

my final (1).png
Amit20240624_225015_lmc_8.4.jpg
IMG_20240312_230041.jpg

In the exciting world of college robotics competitions, precision and quick thinking are key. Whether you’re ready for a thrilling robot race or a strategic game of robo-soccer, the right control system can make all the difference. While mobile phone apps and drone controllers are convenient, they often have limitations like slow response times, poor accuracy, and lack of durability.

Test Run: Youtube

This project shows you why using a PS3 controller to control an ESP32-powered robot car is a great idea. PS3 controllers are a well-known gaming device that has many advantages:

  1. Low Latency:PS3 controllers are designed for real-time gaming, so you won’t have to wait long for your actions to be reflected in the robot’s movements. This is especially important in fast-paced competitions where quick decisions can make a big difference.
  2. Comfort and Precision: The PS3 controller has a familiar layout and provides good tactile feedback, making it easy to control the robot. The analog sticks are precise, so you can easily navigate obstacles and execute moves with accuracy.
  3. Durability: PS3 controllers are built to last and are usually more durable than mobile phones or drone controllers, so you don’t have to worry about them breaking during the competition.
  4. Affordability:PS3 controllers are easy to find and not too expensive, so they’re a good option for college robotics teams.

This Instructable will show you how to build a Bluetooth-controlled robot car using an ESP32 microcontroller and a PS3 controller. By doing this project, you’ll learn about electronics, programming, and robotics, and you’ll also get a head start on your college team’s next robotics event.

Supplies

IMG_20240303_180258.jpg
IMG_20240308_141815.jpg
Amit20240302_200756_lmc_8.4.jpg
IMG_20240311_210922.jpg
Amit20240304_180253_lmc_8.4.jpg
IMG-20240304-WA0029.jpg
IMG_20240307_130321.jpg

Parts Used:

  1. ESP32 Dev Board Amazon
  2. PS3 Controller Amazon
  3. L298 Motor Driver Amazon
  4. Type C Trigger Board Amazon
  5. 4 Wheel Drive Chassis Amazon
  6. 4 BO Motor Amazon
  7. 18650 Battery (12v-18v) Amazon
  8. 3-4 Cell Holder Amazon
  9. Jumper Wire Amazon

If you can buy the component from amazon.


#Advice:

  1. Yes, you can make your own chassis Click to watch Tutorial
  2. I used a MDF board box as the base (wallet box)
  3. I made bo motor clamp using aluminum channel
  4. you only use Power bank with PD/QC then only you need type c trigger board

Preparing the Chassis My Version

vlcsnap-2024-12-30-18h32m15s303.png
vlcsnap-2024-12-30-18h32m33s832.png
vlcsnap-2024-12-30-18h32m48s042.png
vlcsnap-2024-12-30-18h33m32s836.png
vlcsnap-2024-12-30-18h33m51s493.png
vlcsnap-2024-12-30-18h34m00s961.png
vlcsnap-2024-12-30-18h34m42s107.png
vlcsnap-2024-12-30-18h37m29s721.png
vlcsnap-2024-12-30-18h38m02s393.png
vlcsnap-2024-12-30-18h42m23s824.png
  1. Take a small MDF box make nessary hole for mounting bo cramp and wires
  2. Stick bo motor with glue gun or DST
  3. Add the Cramps and screw them
  4. Make connections to motors and pass the wires inside the box
  5. Connect left Motors in parallel
  6. Connect right Motors in parallel too (you can change polarity later)
  7. Add the wheels firmly

Optional: you can add fan for long runs because motor driver heats easily there is chance for burning

I m using laptop internal fan due to its low profile connected it to the motor driver 5v output

Connections

Using type C trigger board and Powerbank.png
Using 18650 battery.png
vlcsnap-2024-12-30-18h40m36s692.png
vlcsnap-2024-12-30-18h41m19s406.png
vlcsnap-2024-12-30-18h42m34s308.png
vlcsnap-2024-12-30-18h45m13s842.png
vlcsnap-2024-12-30-18h45m25s819.png
  1. Identify L298n Motor driver
  2. Connect the Left wire to out 1 and 2
  3. Connect the Right wire to out 3 and 4
  4. Connect the Type C Trigger Board (12v) as main power to motor driver
  5. Connect Esp32 using the Diagram
  6. Connect Type c and Micro USB cable to trigger board and Esp32 to power bank
  7. If you are using 18650 batteries follow the other diagram

Coding PreSetup

Screenshot (2).png
Screenshot 2024-12-31 150217.png
Screenshot (3).png

ESP32 board URL:

https://dl.espressif.com/dl/package_esp32_index.json

  1. Open Arduino IDE
  2. Click on files then Preferences Or Ctrl + Comma
  3. In Additional Board Manager URLs: Paste the above link ↑

Esp32 library:

  1. Go to Tool
  2. Then Board
  3. Then Board Manager
  4. Search for 'esp32'
  5. Then install it.

Ps3Controller Lib:

  1. Go to Tool
  2. then Manage Libraries
  3. Search for 'Ps3 Controller Host'
  4. Then install it

Additional Information:

  1. Board: ESP32 Wrover Module
  2. Upload Speed: 115200
  3. Flash Frequency: 80Mhz
  4. Flash Mode: QIO
  5. Select the port after connecting the esp32 to PC

Upload the Code

dittor image_18.png
dittor image_19.png
dittor image_32.png
  1. Connect the Esp32 to to PC
  2. Open the PS3_Code.ino file
  3. then Upload the Code


Downloads

Get MAC Address of Esp32

Esp32-enable-and-the-boot-button.jpg
dittor image_20.png
  1. Connect the Esp32 to to PC
  2. and upload this code
  3. the go to tool
  4. the serial Monitor or Ctrl + Shift + I
  5. select baudrate to 115200
  6. then press enable button on esp32 as shown in digram
  7. In output you will get Mac address copy the Mac address



Set PS3 Controller Master Address

Screenshot 2024-12-31 160701.png
  1. Download and Install SixaxisPairTool Link
  2. Open the application
  3. Paste Mac Address of Eps32
  4. Connect your PS3 Conroller to PC
  5. Click Update


Test

  1. Connect the batteries
  2. Turn on the Controller
  3. Wait for 5sec it will be connected
  4. Blinking Led will be stable after Connection
  5. Test Run: Youtube