Wednesday, January 11, 2023

Rebuild broken Remote Control Toy Car and upgrate with a Camera using ESP32-CAM - Ai-Thinker

 
Rebuild broken RC car using  ESP 32 cam module

Parts Required

  1. ESP32-CAM with OV2640   (  ESP32-CAM - Ai-Thinker )

  2. FTDI programmer

  3. Old RC car to make a chassis of car

  4. L298N Motor Driver Unit  

Introducing the ESP32-CAM

The ESP32-CAM is a very small camera module with the ESP32-S chip that costs approximately $10. Besides the OV2640 camera, and several GPIOs to connect peripherals, it also features a microSD card slot that can be useful to store images taken with the camera or to store files to serve to clients.
 
 
The ESP32-CAM doesn’t come with a USB connector, so you need an FTDI programmer to upload code through the U0R and U0T pins (serial pins).

 

ESP32-CAM Pinout

 https://i0.wp.com/randomnerdtutorials.com/wp-content/uploads/2019/03/ESP32-CAM-pinout-1.png?quality=100&strip=all&ssl=1

    

Video Streaming Server for testing your first code

first, let's test our video streaming server, then go to project back, 

1. Install the ESP32 add-on 

  • Open the Arduino IDE (Integrated Development Environment).

  • Go to "File" and select "Preferences."

  • In the "Additional Boards Manager URLs" field, add the following URL: https://dl.espressif.com/dl/package_esp32_index.json

  • Click "OK" to save the changes.

  • Go to "Tools" and select "Board: " and then "Boards Manager."

  • In the "Boards Manager" window, search for "esp32" and select "esp32 by Espressif Systems" from the results.

  • Click the "Install" button to install the ESP32 add-on.

  • Once the installation is complete, close the "Boards Manager" window.

  • Go to "Tools" and select "Board: " and then "ESP32 Dev Module" from the list of boards.

  • You're now ready to use the ESP32 with Arduino!

2. Camera Web Server from Example Code 


 

 

Don't froget to update your WIFI Username and Password, and select proper cam module.

3. ESP32-CAM Upload Code using FTDI programmer

Upload Code with Arduino IDE

To upload code to the ESP32-CAM (AI-Thinker) using Arduino IDE, follow the next exact steps.

Connect the ESP32-CAM board to your computer using an FTDI programmer. Follow the next schematic diagram:

 

 

Many FTDI programmers have a jumper that allows you to select 3.3V or 5V. Make sure the jumper is in the right place to select 5V.
 
 
Important: GPIO 0 needs to be connected to GND so that you’re able to upload code.
 
ESP32-CAMFTDI Programmer
GNDGND
5V                                VCC (5V)
U0RTX
U0TRX
GPIO 0GND       

 

To upload code to the ESP32-CAM using Arduino IDE,

1) Go to Tools Board and select AI-Thinker ESP32-CAM. You must have the ESP32 add-on installed. Otherwise, this board won’t show up on the Boards menu.

2) Go to Tools Port and select the COM port the ESP32-CAM is connected to.

3) For demonstration purposes, you can upload a blank sketch to your board:

void setup() {
  // put your setup code here, to run once:
}

void loop() {
  // put your main code here, to run repeatedly:
}

4) Then, click the Upload button in your Arduino IDE.

Program ESP32-CAM with Arduino IDE

5) When you start to see some dots on the debugging window, press the ESP32-CAM on-board RST button.

Program and upload code to ESP32-CAM with Arduino IDE
ESP32-CAM Press RESET RST on-board button to restart
After a few seconds, the code should be successfully uploaded to your board.
ESP32-CAM AI Thinker Module Arduino IDE Done Uploading Success Message
6) When you see the “Done uploading” message, you need to remove GPIO 0 from GND and press the RST button to run your new code.
 
But Now you must upload final code before removing programmer.

 7) Now you can upload final code to control RC car.

download the code form GitHub and upload as same as above
https://github.com/almorawaka/ESP32-CAM-RC-car-with-camera.git
Go to my git hub and download code and update SSID and PW in the code. Select proper Module and Upload the code

8) Solder the circuit connections as follows 

 

Start by connecting the ESP32-CAM to the motor driver as shown in the schematic diagram. You can either use a mini breadboard or a stripboard to place your ESP32-CAM and build the circuit.

The following table shows the connections between the ESP32-CAM and the L298N Motor Driver.

 

Finally, apply power with a power bank as shown in the schematic diagram. You need to strip a USB cable. In this example, the ESP32-CAM and the motors are being powered using the same power source and it works well.

4. Getting the IP address of your server

When you upload this code to your ESP32-CAM module and open the Serial Monitor in the Arduino IDE, you should see the module connecting to your Wi-Fi network and obtaining an IP address. The IP address will be printed in the Serial Monitor.

Open a browser on the ESP32-CAM IP address, and you should be able to control your robot. The web server works well on a laptop computer or smartphone.

5. Accessing the Video Streaming Server

Check your WiFi router and get the IP of ESP-32 CAM module and log into that IP

 

Wrapping Up

Thanks for https://randomnerdtutorials.com/esp32-cam-car-robot-web-server/  for open source code sharing.... :)

 

 

 

No comments:

Search This Blog