The ESP32-CAM is a device equipped with a built-in camera and Wi-Fi support. However, this module has a limited number of I/O pins. Some of them are shared with the SD card, which makes them unavailable when the card is in use. This can complicate project development.

It’s recommended to carefully study the ESP32-CAM pinout.

ESP32-CAM Pinout

The ESP32-CAM has a total of 16 pins, grouped by function.

ESP32-CAM Pinout Overview

[ESP32-CAM Pinout diagram]

GPIO Pins

The ESP32-S chip has 32 GPIO pins, but due to the use of the camera and PSRAM, only 10 GPIO pins are available on the ESP32-CAM. These pins can be used for various functions such as UART, SPI, ADC, and Touch, by setting the corresponding registers.

[GPIO Pins diagram]

Safe GPIO Usage on the ESP32-CAM

Although the ESP32-CAM has 10 GPIO pins with various functions, not all of them can be freely used. The table below shows which pins are safe to use and which ones require caution.

  • ✅ Priority pins: these pins are absolutely safe to use.
  • ❗ Pins requiring careful use: these pins may behave unpredictably, especially during boot. Some of these pins are shared with the microSD card, so they should be used with caution.
  • ❌ Not recommended: it’s recommended to avoid using these pins.
LabelGPIOSafe?Reason
D00❗Must be HIGH during boot and LOW for reflashing
TX01❌Tx pin, used for flashing and debugging
D22❗Must be LOW during boot, cannot be used with a microSD card present
RX03❌Rx pin, used for flashing and debugging
D44❗Connected to the onboard flash LED, cannot be used with a microSD card present
D1212❗Must be LOW during boot, cannot be used with a microSD card present
D1313❗Cannot be used with a microSD card present
D1414❗Cannot be used with a microSD card present
D1515❗Must be HIGH during boot, prevents logging from starting when low, cannot be used with a microSD card present
RX216✅—

The figure below shows which GPIO pins can be safely used.

[Safe GPIO pins diagram]

GPIO 0 Pin

The value of GPIO 0 is critical, since it determines whether the ESP32 enters flashing mode. This pin must be high during normal boot and low during reflashing, which is controlled by an internal 10 kΩ pull-up resistor. Connecting GPIO 0 to GND puts the ESP32 into flashing mode, allowing code to be uploaded. After flashing, GPIO 0 can be disconnected from GND. It will need to be reconnected to GND each time new code is uploaded.

GPIO 33 – Onboard Red LED

There’s a small red LED on the back of the board connected to GPIO 33, which can be used as a status indicator. This LED pin is user-programmable and works with inverted logic: it turns on when a low signal is applied and turns off when a high signal is applied.

GPIO 4 – Camera Flash

The ESP32-CAM is equipped with a bright white LED intended for use as a camera flash, though it can also be used as a regular light source. This LED is connected to GPIO 4.

microSD Card Pins

The following pins are associated with the microSD card. If you’re not using a microSD card, you can use these pins as general-purpose GPIO pins.

[microSD Card Pins diagram]

ADC Pins

Only ADC2 pins are available on the ESP32-CAM. However, since the ADC2 pins are used by the Wi-Fi driver, they cannot be used while Wi-Fi is enabled.

[ADC Pins diagram]

Touch Pins

The ESP32-CAM is equipped with 7 capacitive touch GPIO pins. These pins detect a change in capacitance when a capacitive load, such as a human finger, is near the GPIO. You can build a touch panel by connecting a conductive material, such as aluminum foil or conductive fabric, to these pins. Thanks to the circuit’s high sensitivity and low-noise design, even small touch panels are effective. These touch pins can also be used to wake the ESP32 from deep sleep.

[Touch Pins diagram]

SPI Pins

The ESP32-CAM supports one SPI interface (VSPI) in both slave and master modes, including:

  • 4 timing modes for SPI transmission
  • Clock speeds up to 80 MHz
  • Up to 64-byte FIFO

[SPI Pins diagram]

UART Pins

The ESP32-S chip has two UART interfaces: UART0 and UART2. However, only the RX pin (GPIO 16) of UART2 is available, which makes UART0 (GPIO 1 and GPIO 3) the primary UART interface used on the ESP32-CAM. These pins are used both for flashing the board and for connecting to UART devices such as GPS modules, fingerprint sensors, and distance sensors, since the ESP32-CAM has no USB port.

[UART Pins diagram]

PWM Pins

The board includes 10 PWM channels (all GPIO pins), controlled by the PWM controller. These channels can drive digital motors and LEDs. The PWM controller consists of PWM timers, a PWM operator, and a capture subsystem. Each timer can operate in synchronous or independent mode, and each PWM operator generates a signal for a PWM channel. The capture subsystem precisely records external timing events.

RTC GPIO Pins

RTC GPIO pins are routed to the low-power RTC subsystem and can wake the ESP32 from deep sleep mode when the ultra-low-power (ULP) coprocessor is active. Dedicated GPIO pins can be used for this purpose.

[RTC GPIO Pins diagram]

Power Pins

The ESP32-CAM is equipped with two power pins: 5V and 3.3V. You can connect the device to either of these pins. However, many users have experienced issues when using the 3.3V connector, so it’s recommended to always connect the ESP32-CAM via the 5V connector. Normally, the VCC connector receives 3.3V from the onboard voltage regulator. However, by setting a zero-ohm resistor near the VCC pin, it can be configured to output 5V instead.

[Power Pins diagram]

Original post

error: Content is protected !!
Scroll to Top