AI-Thinker ESP32-CAM pin map
ESP32 board. Pick AI Thinker ESP32-CAM in the Arduino IDE.
The header order is not shown because AI-Thinker's documentation for it could not be checked. Read the labels printed next to each pin on your board.
Field notes
- There is no USB port. Flash it through a 3.3 V USB-to-serial adapter on U0T and U0R, with IO0 tied to GND, then remove that wire and reset.
- Power it from a solid 5 V supply. Brownout resets are the most common ESP32-CAM fault, and the adapter's 3.3 V pin is rarely strong enough.
- The camera uses almost every GPIO. With the SD card in 1-bit mode, GPIO 12 and 13 are the usual pins left for your own wiring.
- The bright LED on GPIO 4 shares a line with the SD card, so it flickers when the card is used.
- Enable PSRAM in the board settings, or the camera can only use small frame sizes.
Analog and Wi-Fi
Wi-Fi uses ADC2. While Wi-Fi is on, analogRead() on ADC2 pins fails, so use ADC1 pins (GPIO 32 to 39) for anything you read with Wi-Fi running.
GPIOs the board already uses
From Espressif's camera example and the ESP32's SD card pins.
| GPIO | Wired to | Chip functions |
|---|---|---|
| 0 | Camera XCLK. Also the boot pin: tie it to GND while flashing | ADC2_CH1, Touch T1, Deep-sleep wake |
| 5 | Camera data Y2 | — |
| 18 | Camera data Y3 | — |
| 19 | Camera data Y4 | — |
| 21 | Camera data Y5 | — |
| 36 | Camera data Y6 | ADC1_CH0, Deep-sleep wake, Input only |
| 39 | Camera data Y7 | ADC1_CH3, Deep-sleep wake, Input only |
| 34 | Camera data Y8 | ADC1_CH6, Deep-sleep wake, Input only |
| 35 | Camera data Y9 | ADC1_CH7, Deep-sleep wake, Input only |
| 25 | Camera VSYNC | ADC2_CH8, DAC1, Deep-sleep wake |
| 23 | Camera HREF | — |
| 22 | Camera PCLK | — |
| 26 | Camera SCCB data (SIOD) | ADC2_CH9, DAC2, Deep-sleep wake |
| 27 | Camera SCCB clock (SIOC) | ADC2_CH7, Touch T7, Deep-sleep wake |
| 32 | Camera power-down (PWDN) | ADC1_CH4, Touch T9, Deep-sleep wake |
| 4 | White flash LED, and SD card D1 | ADC2_CH0, Touch T0, Deep-sleep wake |
| 33 | Small red status LED | ADC1_CH5, Touch T8, Deep-sleep wake |
| 14 | SD card CLK | ADC2_CH6, Touch T6, JTAG MTMS, Deep-sleep wake |
| 15 | SD card CMD | ADC2_CH3, Touch T3, JTAG MTDO, Deep-sleep wake |
| 2 | SD card D0 | ADC2_CH2, Touch T2, Deep-sleep wake |
| 12 | SD card D2 | ADC2_CH5, Touch T5, JTAG MTDI, Deep-sleep wake |
| 13 | SD card D3 | ADC2_CH4, Touch T4, JTAG MTCK, Deep-sleep wake |
| 1 | UART0 TX, used for flashing and the serial console | UART0 TX |
| 3 | UART0 RX, used for flashing and the serial console | UART0 RX |
The ESP32 chip
| Feature | Value |
|---|---|
| CPU | Dual-core Xtensa LX6, up to 240 MHz |
| Radio | Wi-Fi 4 (2.4 GHz), Bluetooth Classic and Bluetooth LE 4.2 |
| GPIOs | 34 (GPIO 34 to 39 are input only) |
| Analog in | 18 channels on two 12-bit ADCs |
| Touch | 10 channels |
| Analog out | 2 channels, 8-bit (GPIO 25 and 26) |
| USB | None. Boards use a USB-to-UART bridge chip |
| SRAM | 520 KB |
Projects for this board
- Wi-Fi scanner List nearby networks with signal strength and channel every ten seconds. A quick radio health check.
- ESP32-CAM video stream Stream live video from an ESP32-CAM to any browser on your network. Joins your Wi-Fi and serves the camera at its own address.