Opens in a new tab

ESP32-CAM Pinout (AI-Thinker)

ESP32-CAM from AI-Thinker is a cheap board with an ESP32 module, an OV2640 camera, a microSD slot and a flash LED. It is used for home cameras, wildlife cameras, reading water meters or monitoring a 3D printer.

It has no USB – it is programmed with a USB-UART converter or the ESP32-CAM-MB base board. The camera and the card take up most of the pins, so the most common question is which GPIO remain free.

Specifications

  • ESP32 (ESP32-S module): 2× Xtensa LX6 up to 240 MHz, 520 kB SRAM
  • 4 MB flash + PSRAM (4 or 8 MB)
  • Wi-Fi 4 and Bluetooth 4.2, PCB antenna + IPEX connector
  • OV2640 camera (2 MP), microSD slot (4-bit SDMMC), flash LED
  • 10 GPIO on the headers, most of them taken by the camera and microSD
  • 5 V power (AMS1117 regulator), no USB
  • 27 × 40 mm

To upload, connect IO0 to the adjacent GND, connect the converter (U0R to TX, U0T to RX, 5V, GND) and reset. With the ESP32-CAM-MB base board, a USB cable is all you need. After uploading, remove the IO0–GND jumper and reset again.

The camera internally uses GPIO0 (XCLK), 5, 18, 19, 21, 22, 23, 25, 26, 27, 32, 34, 35, 36 and 39. GPIO33 is the red LED on the module side (lights up at logic 0); GPIO16 and GPIO17 are taken by the PSRAM.

Pinout and pin table

Hover over a pin in the diagram or a table row; use the filter to highlight a bus. You can download the pinout as PNG or SVG.

ESP32-CAM (AI-Thinker) – pinoutESP32-CAM (AI-Thinker) – pinoutchiptron.eu · CC BY 4.0microSDFLASHESP32-CAMthe ESP32-S module and antenna are on the other side 5V → Power 5 V (supply at least 1 A) GND GPIO12 SD DATA2 GPIO13 SD DATA3 GPIO15 SD CMD GPIO14 SD CLK GPIO2 SD DATA0 GPIO4 SD DATA1 · blesk LED 3V3 ↔ 3.3 V from the regulator GPIO16 PSRAM CS GPIO0 kamera XCLK · BOOT GND VCC → 3.3 V or 5 V output (depending on R1/R2) GPIO3 RX U0R GPIO1 TX U0T GND GPIO UART Power Ground (GND) Strapping pin
Download:PNGSVG
Pin table – ESP32-CAM (AI-Thinker)
NameDirectionUARTI2CSPIADCTouchNote
5Vinput5 V power to the AMS1117 regulator. The camera with Wi-Fi peaks above 300 mA – size the supply for at least 1 A; a weak supply or a long cable causes resets (brownout).
GND–
GPIO12input/outputADC2_CH5T5microSD DATA2 (no pull-up on the board). Strapping pin – must be logic 0 at power-up, otherwise the flash gets 1.8 V and the board does not boot. Free in 1-bit SD mode.
GPIO13input/outputADC2_CH4T4microSD DATA3 – must be logic 1 during card initialization. Free in 1-bit SD mode.
GPIO15input/outputADC2_CH3T3microSD CMD. Strapping pin – logic 0 at boot disables bootloader output
GPIO14input/outputADC2_CH6T6microSD CLK
GPIO2input/outputADC2_CH2T2microSD DATA0. Strapping pin – logic 0 or unconnected for download mode
GPIO4input/outputADC2_CH0T0microSD DATA1 in 4-bit mode. Also drives the white flash LED via a transistor (logic 1 = on), so it flickers while the card is being read. Free in 1-bit SD mode (SD_MMC.begin("/sdcard", true)).
GND–
GPIO1input/outputTXUART0 TX (U0T) – upload and log output; connect to RX of the converter
GPIO3input/outputRXUART0 RX (U0R) – upload; connect to TX of the converter
VCCoutputPower output for peripherals: 3.3 V or 5 V depending on which of the resistors R1/R2 (0 Ω) is fitted – usually 3.3 V. Measure it before use.
GND–
GPIO0input/outputADC2_CH1T1Camera clock (XCLK) – cannot be used as GPIO with the camera. Strapping pin: shorting it to the adjacent GND at boot puts the board into download mode; after uploading, remove the jumper and reset.
GPIO16input/outputPSRAM chip select. The camera needs PSRAM for higher resolutions – use this as a GPIO pin only if you disable PSRAM.
3V3input/output3.3 V from the AMS1117 regulator. The board can also be powered directly with regulated 3.3 V into this pin (bypassing the regulator).

Pins used on the board

These chip pins are used by parts on the board and are not broken out:

PinFunction on the board
GPIO32Camera power (PWDN) – logic 0 = camera on
GPIO26Kamera SIOD (SCCB SDA)
GPIO27Kamera SIOC (SCCB SCL)
GPIO5Kamera Y2
GPIO18Kamera Y3
GPIO19Kamera Y4
GPIO21Kamera Y5
GPIO36Kamera Y6
GPIO39Kamera Y7
GPIO34Kamera Y8
GPIO35Kamera Y9
GPIO25Kamera VSYNC
GPIO23Kamera HREF
GPIO22Kamera PCLK
GPIO33Red LED on the module side (lit at logic 0)
GPIO17PSRAM SCLK

What to watch out for

  • With both the camera and the card in 4-bit mode, no pin is left free except the UART (GPIO1/3).
  • The card in 1-bit mode frees GPIO4, GPIO12 and GPIO13; without a card, GPIO2, 4, 12, 13, 14 and 15 are free.
  • GPIO12 must not be at logic 1 at boot, otherwise the board won’t start.
  • GPIO4 drives the flash LED – it flickers while the card is being read.
  • A weak power supply or a thin cable causes restarts (brownout) – power it with 5 V from a supply rated at least 1 A.
  • The analog inputs on the headers are ADC2 only, and those don’t work while Wi-Fi is on.
  • On some units, the GND pin next to U0T is GND/R (reset) – for ground, use the GND next to 5V or next to IO0.

ESP32-CAM projects on chiptron.eu/

Projects and guides on chiptron.eu/:

More pinouts

See all pinouts on the Pinouts page.

Related Articles