In this tutorial, we are going to explain the pinout of the ESP32 CAM Module in detail. The ESP32 CAM pinout consists of a total of 16 pins. The creativity of these pinouts provides many different options such as driving LEDs, motors, LEDs, reading sensors, video recording, face recognition, and so many other things. ESP32 CAM has a Single-core Xtensa LX7 CPU, up to 240 MHz. The ability of pinout provides many functions such as LED, driving motors, reading sensors, and many more. In this discussion, we will cover the capabilities of the ESP32 CAM pinout.
The following image shows the pinout diagram for the ESP32-CAM Pinout in detail.
The following image shows the schematic diagram of the ESP32-CAM pinout and reference.
The ESP32-CAM has three GND pins and two power pins 3.3V and 5V. You can power the ESP32-CAM through the 3.3V or 5V pins but it is better to use a 5V pin when powering the ESP32-CAM.
A pin labeled on the silkscreen as VCC on ESP32 CAM. You can not use this pin to power the ESP32-CAM. This pin is out pin so be careful you should not use it for power in. Keep in mind that ESP32-CAM outputs 3.3V even if you are powered with 5V or 3.3V. Ather the VCC pin, there are two pads. One was labeled as 3.3V and the other as 5V. After the VCC pin, You see two pads. One was labeled as 3.3V & the other as 5V. You will see a jumper on the 3.3V pads. To get the output of 5V on the VCC pin, you need to unsolder that connection and solder the 5V pads.
ESP32-CAM does not have a built-in programmer which is why there are GPIO 1 and GPIO 3 pins are given (serial pins) you need to use these pins to communicate with the board and upload code. You should use the FTDI programmer to upload code to the ESP32-CAM pinout. You can use GPIO 1 & GPIO 3 to connect external devices (peripheral devices) like outputs or sensors after uploading the code.
GPIO 0 is the most important pin of ESP32 CAM. It determines whether or not the ESP32 is in flashing mode. GPIO 0 is used to determine whether the ESP32 cam is in flashing mode or not. This GPIO is internally connected to a pull-up 10k Ohm resistor. When GPIO 0 is connected to GND, the ESP32 goes into flashing mode and you are able to upload code to the board. GPIO 0 connected to GND » ESP32-CAM in flashing mode To make the ESP32 run “normally”, you just need to disconnect GPIO 0 from GND.
Shown below are the pins used to interface with the microSD card when it is in operation. If you’re not using the microSD card, you can use these pins as regular inputs/outputs.
The ESP32-CAM has a built-in LED. This flash when the cam taking photos this LED is internally connected to GPIO 4. GPIO 4 is also connected to the microSD card slot, so you may have trouble when trying to use both at a time.
Near the RST button, there is an onboard red LED that is connected to GPIO 33. This LED is used to indicate that something happening.
for the experiment with the code uploading the flowing codes can be used for LED glowing.
void setup() {
pinMode(33, OUTPUT);
}
void loop() {
digitalWrite(33, LOW);
}
The connection between the camera and the esp32 cam pinout is given below the table in detail.
OV2640 CAMERA | ESP32 | Variable name in code |
D0 | GPIO 5 | Y2_GPIO_NUM |
D1 | GPIO 18 | Y3_GPIO_NUM |
D2 | GPIO 19 | Y4_GPIO_NUM |
D3 | GPIO 21 | Y5_GPIO_NUM |
D4 | GPIO 36 | Y6_GPIO_NUM |
D5 | GPIO 39 | Y7_GPIO_NUM |
D6 | GPIO 34 | Y8_GPIO_NUM |
D7 | GPIO 35 | Y9_GPIO_NUM |
XCLK | GPIO 0 | XCLK_GPIO_NUM |
PCLK | GPIO 22 | PCLK_GPIO_NUM |
VSYNC | GPIO 25 | VSYNC_GPIO_NUM |
HREF | GPIO 23 | HREF_GPIO_NUM |
SDA | GPIO 26 | SIOD_GPIO_NUM |
SCL | GPIO 27 | SIOC_GPIO_NUM |
POWER PIN | GPIO 32 | PWDN_GPIO_NUM |
So, the pin definition for the ESP32-CAM AI-Thinker on the Arduino IDE should be as follows:
#define PWDN_GPIO_NUM 32
#define RESET_GPIO_NUM -1
#define XCLK_GPIO_NUM 0
#define SIOD_GPIO_NUM 26
#define SIOC_GPIO_NUM 27
#define Y9_GPIO_NUM 35
#define Y8_GPIO_NUM 34
#define Y7_GPIO_NUM 39
#define Y6_GPIO_NUM 36
#define Y5_GPIO_NUM 21
#define Y4_GPIO_NUM 19
#define Y3_GPIO_NUM 18
#define Y2_GPIO_NUM 5
#define VSYNC_GPIO_NUM 25
#define HREF_GPIO_NUM 23
#define PCLK_GPIO_NUM 22
On the ESP32 CAM module, only ADC2 pins are broken out.
The ESP32-CAM has 7 capacitive touch-sensing GPIOs. When a little load (such as a human finger) is in close proximity to the GPIO, the ESP32 CAM detects the change and can react as you want. You can make a touchpad by attaching any conductive object to these pins, such as aluminum foil, conductive cloth, conductive paint, and so on. Additionally, these capacitive touch pins can be used to wake the ESP32 from a deep sleep.
SPI features are listed below:
The PWM output is used for driving digital motors and LEDs. ESP32 cam board has 10 channels of PWM pins controlled by a PWM controller.
The GPIOs that are routed to the RTC low-power subsystem are referred to as RTC GPIOs.