ESP32 Camera 4WD Robot Car Kit DOCS
ESP32 Camera 4WD Robot Car Kit DOCS
Packing List
Acrylic case - a protective and structural enclosure made from acrylic material of the chassis with a
various cut-out for different parts of the robotic car.
Aluminum block motor holder – The aluminum blocks have multiple holes and indentations to
ensure the motors are firmly attached to the chassis, preventing any movement during
operation.
Antenna - allows the ESP32 to connect to a Wi-Fi network, enabling remote control of the robotic
car via a web-based interface or a mobile app to transmit signals by sending commands to the
esp32.
Battery case – it is used to provide a portable power source holds AA batteries, which supply the
necessary voltage and current to power the ESP32 microcontroller and other components of
the robotic car.
ESP32 camera - a compact camera module that features an ESP32-S chip. It combines Wi-Fi and
Bluetooth capabilities with camera functionality, for capturing real-time images or video to
help the robot navigate its environment.
L298N - a dual H-bridge motor driver integrated circuit, commonly used in robotic cars to control
the motors or one stepper motor, allowing for both speed and direction control. It connects to
the microcontroller Arduino to receive control signals and translate them into motor
movements.
Micro USB cable - can provide power to the ESP32 board, which in turn powers the entire robotic
car setup allows you to upload code to the ESP32 board and monitor its performance. This is
essential for programming the car’s movements and behaviors.
Motor - component that converts electrical energy into mechanical motion, enabling the robot car
to move.
Philip screwdriver - a screwdriver is to tighten screws properly through the holes to secure the
other component especially with acrylic to secure the components properly aligned and
function correctly.
Screws, Nuts and bolts - it can help attach the camera to a robotic arm or other structures properly
installed components to reduce vibrations and movement, leading to clearer images and more
reliable operation.
Tie – it secure components to the chassis of the robotic car, ensuring that everything stays in place
during movement.
Tire - the movement and control of the robotic car providing straightforward forward and backward
movement.
Velcro - allows for flexible placement of sensors, motor drivers, and other modules, which can be
adjusted or replaced without the need for screws or permanent adhesives.
Wire dupont – it can connect the ESP32 microcontroller to sensors, motors, and other modules.
The wires have male or female connectors that fit into the pins of the ESP32 and other
components.
Content
◆ Step 1:Assembly Tutorial........................................................................................1
◆ Step 2:Wiring..........................................................................................................2
◆ Step 3:Upload Main Code.......................................................................................5
◆ Step 4:Mobile Device Connects to the ESP32-Cam Robot....................................6
◆ Step 5:Web Remote Control ESP32-Cam Robot Car...........................................10
◆ How to Upload Main Code...................................................................................12
➢ Install Arduino IDE........................................................................................... 12
➢ Installing ESP32Add-on in Arduino IDE......................................................... 13
➢ Install CH340 Driver.........................................................................................17
➢ Upload Code......................................................................................................25
L298N Motor Driver.....................................................................................................31
ESP32-CAM Specifications..........................................................................................36
◆ Step 1:Assembly Tutorial
For more details refer to Assembly Tutorial Video.mp4
◆
◆
1/38
◆ Step 2:Wiring 2/38
3/38
4/38
◆ Step 3:Upload Main Code
Tip:Since the program has been uploaded to the ESP32Cam before the factory, you
can just skip this step and no need to upload it repeatedly.
Learn more about How to Upload Main Code
5/38
Mobile device connects to the wifi hotspot:ESP32-Cam Robot
6/38
7/38
Type and access the address "192.168.4.1" on your browser
8/38
Tip:If the remote control web page fails to load,
The possible reasons are:
1) The battery is low. Make sure the total battery voltage is >11.1V
3)Because some mobile devices have the network assistant turned on by default. This may
cause control instructions to be routed incorrectly. It is recommended that you turn off the
mobile data network and only turn on the wifi network.
9/38
Step 5:Web Remote Control ESP32-Cam Robot Car
◆
10/38
The robot car is not moving? There may be the following reasons:
①It must be powered by 18650*3 batteries. Make sure the total battery voltage>11.1V.
Due to air transportation, the battery may not be included in the kit, you need to buy the
battery yourself.
If none of the above is the case. Press the RST button and the four motors will run.
You can use the RST button to verify whether the motor and drive circuit wiring are correct.
11/38
◆ How to Upload Main Code
➢ Install Arduino IDE
Tip:Before starting this installation procedure, make sure you have the latest version of the Arduino IDE
installed in your computer. If you don’t, uninstall it and install it again. Otherwise, it may not work.
12/38
➢ Installing ESP32 Add-on in Arduino IDE
①Open the Boards Manager. You can go to Tools > Board > Boards Manager… or you can simply click the
13/38
②Search for esp32 and select 2.0.11 ,click the INSTALL button for esp32 by Espressif Systems.
14/38
③Installing, this will take a while
15/38
④Successfully installed platform esp32:2.0.11
16/38
➢ Install CH340 Driver
CH340 is a TTL (serial) to USB converter and vice versa. This chip has been used in some boards such as
Arduino boards, ESP8266, etc. The boards using the CH340 chip,need a programmer in order to access the
processor or to program them.But there is a downside. An extra driver must be installed before starting to work
So before uploading the code, you need to install the CH340 driver. Otherwise you won't be able to find the
correct COM port in the Arduino IDE.If your computer has already installed the CH340 driver, you can skip
this step.
17/38
If you connect your board to the computer before installing the driver, your computer will not recognize the
board correctly and you will see following image in Device Manager.
18/38
Follow the steps below to install the CH340 driver:
You can also download the latest version of the driver directly from the manufacturer’s site google link
19/38
② Installing the driver
After downloading the driver, open it and click Install.
20/38
After successful installation you should see this message
Note:In some cases, you may need to reset Windows after the driver installation is complete.
21/38
③ Checking Correct Driver Installation in Device Manager
If your driver has been installed correctly, and if you connect your board to a computer, then you can see its
name and port number in the Port section. For example, my Arduino board is connected to COM28.
22/38
④ Checking Correct Driver Installation in Arduino IDE
Open the Arduino IDE software. Go to the Tools->Port: menu , select the COMx.
Note that this port number must be the same as the number you saw in the previous step.
23/38
24/38
➢ Upload Code
25/38
②Use USB cable to connect the ESP32CAM board to the computer.(It may be that the power supply of the
USB interface of the computer is insufficient, you can turn on the power switch of the robot car at the same
time.)
26/38
③Select your Board in Tools > Board menu>esp32>AI Thinker ESP32-CAM
27/38
④Select the Port (if you don’t see the COM Port in your Arduino IDE, you need to Install the CH340
Drivers)
28/38
⑤Click the Upload button in the Arduino IDE. Wait a few seconds while the code compiles and uploads
to your board.
29/38
If everything went as expected, you should see a “Done uploading.” message.If the Arduino IDE reports
errors maybe you missed some steps. Arduino getting started guide is as follows
30/38
L298N Motor Driver
There are many ways to control a DC motor. The method we’ll use here is suitable for most hobbyist motors, that require
6V or 12V to operate.
We’re going to use the L298N motor driver that can handle up to 3A at 35V. Additionally, it allows us to drive two DC
31/38
L298N Motor Driver pinout
Let’s take a look at the L298N motor driver pinout and see how it works.
The motor driver has a two terminal block in each side for each motor. OUT1 and OUT2 at the left and OUT3 and OUT4 at the
right.
32/38
At the bottom you have a three terminal block with +12V, GND, and +5V. The +12V terminal block is used to power up the
motors. The +5V terminal is used to power up the L298N chip. However, if the jumper is in place, the chip is powered using the
motor’s power supply and you don’t need to supply 5V through the +5V terminal.
Note: if you supply more than 12V, you need to remove the jumper and supply 5V to the +5V terminal.
It’s important to note that despite the +12V terminal name, with the setup we’ll use here (with the jumper in place) you can
supply any voltage between 6V and 12V. In this tutorial will be using 4 AA 1.5V batteries that combined output approximately
6V, but you can use any other suitable power supply.
In summary:
▪ +12V: The +12V terminal is where you should connect your power supply
▪ GND: power supply GND
▪ +5V: provide 5V if jumper is removed. Acts as a 5V output if jumper is in place
▪ Jumper: jumper in place – uses the motors power supply to power up the chip. Jumper removed: you need to provide 5V
to the +5V terminal. If you supply more than 12V, you should remove the jumper
At the bottom right you have four input pins and two enable terminals. The input pins are used to control the direction of your
DC motors, and the enable pins are used to control the speed of each motor.
33/38
Control DC motors with the L298N
Now that you’re familiar with the L298N Motor Driver, let’s see how to use it to control your DC motors.
Enable pins
The enable pins are like an ON and OFF switch for your motors. For example:
▪ If you send a HIGH signal to the enable 1 pin, motor A is ready to be controlled and at the maximum speed;
▪ If you send a LOW signal to the enable 1 pin, motor A turns off;
▪ If you send a PWM signal, you can control the speed of the motor. The motor speed is proportional to the duty cycle.
However, note that for small duty cycles, the motors might not spin, and make a continuous buzz sound.
▪ If you apply LOW to input1 and HIGH to input 2, the motor will spin forward;
▪ If you apply power the other way around: HIGH to input 1 and LOW to input 2, the motor will rotate backwards. Motor B
can be controlled using the same method but applying HIGH or LOW to input 3 and input 4.
34/38
Controlling 2 DC Motors – ideal to build a robot
If you want to build a robot car using 2 DC motors, these should be rotating in specific directions to make the robot go left, right,
forward or backwards.
For example, if you want your robot to move forward, both motors should be rotating forward. To make it go backwards, both
should be rotating backwards.
To turn the robot in one direction, you need to spin the opposite motor faster. For example, to make the robot turn right, enable
the motor at the left, and disable the motor at the right. The following table shows the input pins’ state combinations for the
robot directions.
35/38
ESP32-CAM Specifications
36/38
37/38
The ESP32-CAM is based upon the ESP32-S module, so it shares the same specifications. It has the following features:
⚫ 802.11b/g/n Wi-Fi
38/38