This repository shows how to build a WLAN controlled RC Car with an ESP32-CAM. With a web interface you can control the car and the camera view is shown in the browser.
It is possible to move the camera up and down with a small servo attached to the housing. Here is a small Video.
All necessary parts are listed below in the parts section with links to order.
As chassis, I use the Joy-IT ROBOT CAR KIT 01. This is easy to mount. Just follow the assembling instructions.
On the chassis, you can screw the camera to the top plate using one of the pre-drilled holes. The motor driver and the battery, I simply connected with double sided tape.
The two motors left and right are connected (soldered) in parallel. Make sure that they move in the same direction when powered. As motor driver the L298N is used. The left/right motor is the connected to the two outputs on the motor driver. Make sure that direction is right for forward/backwards for both sides. If necessary change the cable connection.
The motor driver is also providing the 5 Volt for the ESP32CAM. The power supply for the servo is done with an extra 7805 voltage regulator. This was necessary due to stability problems, if ESP and Servo is supplied directly from the motor driver.
The ESP32CAM is located in a 3D printed housing. The files are available on Thingiverse. For mounting the housing to chassis you can either use the round bottom plate from Thingiverse or you can use my mount instead. The servo arm has to be connected with bottom part with metal wire. For the lenght of the connection wire you have to try a bit. For me, 20 mm worked well.
The 9g Micro Servo have to be placed and screwed into the 3D housing.
The components have to be connected as shown in the diagram. I'm using 20 cm jumper wires for the connection.
As battery you can use anything between 7.4 to 11.1 Volt. I'm using a 11.1 Volt lithium polymer accu from a RC helicopter.
The RC Car is prepared for the Arduino IDE. To install the sketch, download the whole repository and then open the file "ESP32CAM-RC-Car.ino" in the IDE. Then edit the code to adjust the WLAN credentials according to your local needs. That's it. As board please select the "AI Thinker ESP32-CAM" or "ESP32 Wrover Module" in the Arduino IDE. And please make sure you have the ESP32 board URL provided in the preferences (https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json). And select board version 1.0.6. Otherwise you will get compile errors regarding missing header files.
You need an external (FTDI) programmer to install the (initial) sketch on the ESP32-CAM module. You have to set the voltage of the adapter to 5 Volt.
For programming you have to connect IO0 to GND, RX/TX (crossed) and 5V/GND. If you have the power supply already connected, then do not connect the 5V cable from the adapter. Then press the "RST" button on the ESP32-CAM. After that, you can start the upload process within the Arduino IDE (with FTDI USB-Serial port selected). For normal start open IO0 from GND and press "RST" again.
After initial programming you can do uploads via OTA. Device name is "RC-Car".
The RC car can be controlled with a small web interface. Just power the car. The ESPCAM LED is flashing 5 times.
If your client is supporting MDNS, then you can simply enter "rc-car.local" in the address field. Otherwise you have to provide the IP-Address (shown in Serial Monitor after programming).
To start the stream, just press the "Start Stream" button. You can move forward/backward and left/right. With "Flash" you can set the power of the internal LED. With "Speed" you can adjust the speed of the car. With "Servo" you can move the camera view up and down. With "Quality/Resolution" you can define the camera settings for both options. With "Get Still" you can take a picture.