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.
| Name | Direction | UART | I2C | SPI | ADC | Touch | Note |
|---|---|---|---|---|---|---|---|
| 5V | input | 5 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 | – | ||||||
| GPIO12 | input/output | ADC2_CH5 | T5 | microSD 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. | |||
| GPIO13 | input/output | ADC2_CH4 | T4 | microSD DATA3 – must be logic 1 during card initialization. Free in 1-bit SD mode. | |||
| GPIO15 | input/output | ADC2_CH3 | T3 | microSD CMD. Strapping pin – logic 0 at boot disables bootloader output | |||
| GPIO14 | input/output | ADC2_CH6 | T6 | microSD CLK | |||
| GPIO2 | input/output | ADC2_CH2 | T2 | microSD DATA0. Strapping pin – logic 0 or unconnected for download mode | |||
| GPIO4 | input/output | ADC2_CH0 | T0 | microSD 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 | – | ||||||
| GPIO1 | input/output | TX | UART0 TX (U0T) – upload and log output; connect to RX of the converter | ||||
| GPIO3 | input/output | RX | UART0 RX (U0R) – upload; connect to TX of the converter | ||||
| VCC | output | Power 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 | – | ||||||
| GPIO0 | input/output | ADC2_CH1 | T1 | Camera 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. | |||
| GPIO16 | input/output | PSRAM chip select. The camera needs PSRAM for higher resolutions – use this as a GPIO pin only if you disable PSRAM. | |||||
| 3V3 | input/output | 3.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:
| Pin | Function on the board |
|---|---|
| GPIO32 | Camera power (PWDN) – logic 0 = camera on |
| GPIO26 | Kamera SIOD (SCCB SDA) |
| GPIO27 | Kamera SIOC (SCCB SCL) |
| GPIO5 | Kamera Y2 |
| GPIO18 | Kamera Y3 |
| GPIO19 | Kamera Y4 |
| GPIO21 | Kamera Y5 |
| GPIO36 | Kamera Y6 |
| GPIO39 | Kamera Y7 |
| GPIO34 | Kamera Y8 |
| GPIO35 | Kamera Y9 |
| GPIO25 | Kamera VSYNC |
| GPIO23 | Kamera HREF |
| GPIO22 | Kamera PCLK |
| GPIO33 | Red LED on the module side (lit at logic 0) |
| GPIO17 | PSRAM 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/:
- Lower ESP32-CAM power consumption – why the board draws so much in sleep and how to modify it
More pinouts
See all pinouts on the Pinouts page.