AI Thinker ESP32-CAM
by AI-Thinker
ESP32 module with camera and microSD - perfect for surveillance, face detection, and image processing projects.

On this page
Pinout
24 pins · 2.54 mm pitch| Pin | GPIO | Labels | Status | Capabilities | Notes |
|---|---|---|---|---|---|
| 1 | 0 | A11T1 | strapping | adc · touch | |
| 2 | 1 | TXPWM | uart | uart | |
| 3 | 2 | A12T2PWM | strapping | adc · touch | |
| 4 | 3 | RXPWM | uart | uart | |
| 5 | 4 | A10T0PWM | strapping | adc · touch | |
| 6 | 5 | SSPWM | strapping | spi | |
| 7 | 12 | A15T5PWM | strapping | adc · touch | |
| 8 | 13 | A14T4PWM | strapping | adc · touch | |
| 9 | 14 | A16T6PWM | strapping | adc · touch | |
| 10 | 15 | A13T3PWM | strapping | adc · touch | |
| 11 | 18 | SCKPWM | safe | spi | |
| 12 | 19 | MISOPWM | safe | spi | |
| 13 | 21 | SDAPWM | safe | i2c | |
| 14 | 22 | SCLPWM | safe | i2c | |
| 15 | 23 | MOSIPWM | safe | spi | |
| 16 | 25 | A18DAC1PWM | safe | adc · dac | |
| 17 | 26 | A19DAC2PWM | safe | adc · dac | |
| 18 | 27 | A17T7PWM | safe | adc · touch | |
| 19 | 32 | A4T9PWM | safe | adc · touch | |
| 20 | 33 | A5T8PWM | safe | adc · touch | |
| 21 | 34 | A6 | strapping | adc | |
| 22 | 35 | A7 | strapping | adc | |
| 23 | 36 | A0 | strapping | adc | |
| 24 | 39 | A3 | strapping | adc |
Start with these
10 pins with no boot or system involvementFreely assignable - no strapping, flash, USB or JTAG duties. Ideal first picks for buttons, sensors and LEDs.
Fine - with a little care
sampled at boot or shared with debug/serial| Pin | Label | What to know | Role |
|---|---|---|---|
| A11 | GPIO0 | Must be HIGH during boot for normal startup; if held LOW on reset, forces flash programming mode. | Strapping |
| A12 | GPIO2 | If driven HIGH on reset (while IO0 is LOW), selects an unsupported SDIO boot mode, causing boot failure. | Strapping |
| A10 | GPIO4 | Sampled at reset for boot config; should not be driven at boot (affects boot mode timing). | Strapping |
| SS | GPIO5 | Must be HIGH during boot; if pulled LOW at reset, alters SDIO slave timing and may prevent normal boot. | Strapping |
| A15 | MTDI (GPIO12) | Keep LOW during boot (internal PD); pulling HIGH at reset selects 1.8V flash mode, causing flash brownout if 3.3V flash is used. | Strapping |
| A14 | MTCK (GPIO13) | Used for JTAG debugging (TCK); avoid using as GPIO if JTAG is needed. | Other |
| A16 | MTMS (GPIO14) | Used for JTAG debugging (TMS); driving it as GPIO may interfere with JTAG or produce spurious signals at boot. | Other |
| A13 | MTDO (GPIO15) | Keep HIGH during boot (internal PU); if LOW on reset, bootloader log is silenced and boot mode may change. | Strapping |
| A6 | GPIO34 | Cannot be used as output (no drive capability); only suitable for analog/digital input. | Other |
| A7 | GPIO35 | Cannot be used as output; only suitable for input. | Other |
| A0 | GPIO36 (SENSOR_VP) | Cannot be used as output; only suitable for input (e.g., analog read). | Other |
| A3 | GPIO39 (SENSOR_VN) | Cannot be used as output; only suitable for input. | Other |
Only if you know the tricks
wired to flash or USB - expect a fight| Pin | Label | What to know | Role |
|---|---|---|---|
| TX | U0TXD (GPIO1) | Connected to on-board USB-UART for uploading and logs; drives serial output at boot, so using as GPIO can disrupt programming or console. | USB |
| RX | U0RXD (GPIO3) | Used for receiving data from USB-UART (programming); also pulled HIGH at boot for console communication, so using as GPIO can disrupt uploads. | USB |
Pinout notes The AI Thinker ESP32-CAM pinout brings out 24 GPIO pins at a 2.54 mm pitch - every one of them usable in your project. For peripherals, I²C is mapped to SDA on…
The AI Thinker ESP32-CAM pinout brings out 24 GPIO pins at a 2.54 mm pitch - every one of them usable in your project.
For peripherals, I²C is mapped to SDA on GPIO21 and SCL on GPIO22; the SPI bus (MOSI, MISO, SCK, SS) is broken out in full; TX/RX on GPIO1 and GPIO3 cover serial logging and flashing.
On the analog side there are 16 ADC-capable pins for sensors and battery monitoring, 10 capacitive-touch inputs and 2 true DAC outputs.
If you want zero surprises, SCK, MISO, SDA, SCL and 6 more are free of any such role - the safest first picks. 12 of the exposed pins carry boot-time or system duties on the ESP32 (A11, A12, A10 and 9 more).
The ESP32-CAM pinout is designed to provide versatile functionality for camera-based IoT applications. It features essential power pins like 5V, 3.3V, and GND, ensuring stable power delivery for both the ESP32 chip and connected peripherals.
For communication, the ESP32-CAM (also written as ESP32CAM, ESP 32 CAM, or ESP-CAM) includes RX and TX for UART, making it easy to connect to external serial devices. Additionally, SDA and SCL support I2C communication, while SPI pins like MISO, MOSI, SCK, and SS enable high-speed data transfer for sensors, displays, and storage.
One of the key features of the ESP32-CAM is its dedicated camera interface, which includes multiple GPIOs for connecting the OV2640 camera module. It also has a microSD card slot, allowing you to store captured images and videos easily.
Since the ESP32-CAM does not have a built-in USB-to-serial converter, programming requires an external FTDI or USB-to-TTL adapter connected to the RX and TX pins. Proper boot mode selection is also necessary when flashing firmware.
Pins to Avoid or Use with Caution
| Pin Name | Label | Reason to Avoid |
|---|---|---|
| IO0 | BOOT | Must be pulled low to enter flash mode. Avoid using as a regular GPIO. |
| IO4 | CAM_D2 | Used by the camera module. Avoid using if the camera is in use. |
| IO12 | MTDI | Bootstrapping pin. Can cause issues if pulled high at startup. |
| IO13 | MTCK | Used for flash mode configuration. Avoid using if unsure. |
| IO14 | MTMS | Connected to the camera. Avoid using as a general GPIO. |
| IO15 | MTDO | Strapping pin. Can interfere with boot mode if pulled incorrectly. |
For general GPIO usage, IO2, IO16, and IO17 are the safest and most flexible choices.
Getting started
flash your first firmware in ~2 minutesBoard: Esp32 Dev
Flash Size: 4MB
Upload Speed: 921600
// blink
pinMode(18, OUTPUT);
digitalWrite(18, LOW); // on (often inverted)[env:esp32cam]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
upload_speed = 921600esp32:
board: esp32dev
variant: esp32
framework:
type: esp-idf
# blink - GPIO18
output:
- platform: gpio
pin: 18
id: led_out
light:
- platform: binary
name: "LED"
output: led_outesptool.py --chip esp32 --port /dev/ttyACM0 \
write_flash 0x0 firmware.binSpecifications
ESP32 · 40.5 × 27 mmAbout this board
At its core is the ESP32 - a dual-core Xtensa with both Bluetooth Classic and BLE.
Expect to pay about $10.00 - less than the ~$20 most ESP32 boards go for.
Onboard you'll find 4MB (QSPI) PSRAM, an OV2640 camera (1600x1200), a microSD slot, status LEDs (Red (GPIO33), Flash (GPIO4)) and Reset buttons.
The ESP32-CAM (also written as ESP32CAM, ESP 32 CAM, or ESP-CAM) is a low-cost Wi-Fi + Bluetooth camera module powered by Espressif’s ESP32-S chip. It comes with an OV2640 camera, microSD slot, and GPIO pins, making it perfect for IoT, security, and AI vision projects. In this guide, you’ll find the ESP32-CAM pinout, wiring diagrams, datasheet, technical specs, and setup instructions for AI Thinker and similar modules.
- u.FL/IPEX connector for external antenna (0Ω resistor jumper selects onboard PCB or external)
- No onboard USB - program via an external FTDI/USB-to-TTL adapter on U0R/U0T
FAQ
5 common questionsWhat is the ESP32-CAM used for?›
What voltage does the ESP32-CAM require?›
What is the resolution of the ESP32-CAM's OV2640 camera?›
Does the ESP32-CAM have Bluetooth?›
How do I program the ESP32-CAM?›
Where to buy
prices are typical street prices
Resources
Similar boards




