How-to · Intermediate · 3 min read
ESP32-CAM
Setup, Programming and Video Streaming
By Geekobot Learning Team · Updated 24 Oct 2026
On this page
The ESP32-CAM is a low-cost ESP32 board with an OV2640 2 MP camera and microSD slot but no USB port. Program it with a USB-to-serial adapter (or the ESP32-CAM-MB base), holding GPIO 0 to ground while uploading, then run the CameraWebServer example to stream video over Wi-Fi to a browser. Give it a solid 5 V supply: most problems are power.
Key specs at a glance
- Camera
- OV2640, 2 MP, up to 1600x1200 (UXGA)
- Chip
- ESP32-S with 4 MB PSRAM
- Storage
- microSD (4-bit SD_MMC uses most free GPIOs)
- Free GPIO
- Very few: GPIO 12, 13, 14, 15, 2, 4 shared with SD and flash LED
- Power
- 5 V, peaks over 300 mA; 3.3 V supply is unreliable
- Programming
- External USB-serial at 3.3 V logic, or ESP32-CAM-MB board
- Streaming
- MJPEG over HTTP; about 10 to 25 fps at VGA
Wiring for programming
With an FTDI or CP2102 adapter set to 3.3 V logic:
| ESP32-CAM | USB-serial adapter |
|---|---|
| 5V | 5V (power from the adapter's 5 V, not 3.3 V) |
| GND | GND |
| U0R (RX) | TX |
| U0T (TX) | RX |
| GPIO 0 | GND, only while uploading |
- 5V
- 5V (power from the adapter's 5 V, not 3.3 V)
- GND
- GND
- U0R (RX)
- TX
- U0T (TX)
- RX
- GPIO 0
- GND, only while uploading
Upload the CameraWebServer example
- 1Install the ESP32 board package in the Arduino IDE (see the ESP32 guide).
- 2Select AI Thinker ESP32-CAM as the board (or ESP32 Wrover Module with Huge APP partition).
- 3Open File > Examples > ESP32 > Camera > CameraWebServer, uncomment
#define CAMERA_MODEL_AI_THINKER, and enter your Wi-Fi details. - 4Connect GPIO 0 to GND, press the RESET button, then click Upload.
- 5Remove the GPIO 0 jumper, press RESET, and open the Serial Monitor at 115200 baud. Open the printed IP address in a browser and click Start Stream.
Fixing brownouts, resets and no-camera errors
the 5 V supply sags. Use a 5 V 2 A adapter or a powered USB adapter, short wires, and add a 470 to 1000 µF capacitor across 5V and GND.
reseat the ribbon cable (contacts facing the board), check the model define, and confirm PSRAM is enabled.
GPIO 0 not grounded at reset, TX/RX swapped, or the adapter set to 5 V logic.
the on-board PCB antenna is poor. Move the 0 Ω resistor to use the external antenna connector, or keep the module away from metal.
What you can build
Time-lapse cameras that save to microSD, doorbell cameras that notify Telegram, Home Assistant camera feeds, face detection on the ESP32-S3 version, and QR-code readers. Keep expectations modest: VGA MJPEG streaming is fine; 1080p video is not.
ESP32-CAM alternatives
| Board | Advantage |
|---|---|
| ESP32-CAM-MB base | Adds a CH340 USB port so you can program without an adapter |
| ESP32-S3 CAM boards (e.g. XIAO ESP32S3 Sense, Freenove S3) | Native USB, more RAM, faster face detection, better antenna |
| Raspberry Pi + Camera Module | Real video, 1080p+, OpenCV, recording |
- ESP32-CAM-MB base
- Adds a CH340 USB port so you can program without an adapter
- ESP32-S3 CAM boards (e.g. XIAO ESP32S3 Sense, Freenove S3)
- Native USB, more RAM, faster face detection, better antenna
- Raspberry Pi + Camera Module
- Real video, 1080p+, OpenCV, recording
Common mistakes to avoid
- Powering the board from the adapter's 3.3 V pin; the camera needs the 5 V input.
- Forgetting to ground GPIO 0 before reset when uploading.
- Using the SD card and trying to use the same GPIOs for sensors.
- Pointing the camera at bright windows and expecting auto-exposure to cope; set the exposure in the web UI.
- Expecting smooth HD video from a 2 MP camera on an ESP32.
Frequently asked questions
How do I program an ESP32-CAM without a USB port?
Use a 3.3 V USB-to-serial adapter wired to 5V, GND, U0R and U0T, and ground GPIO 0 during upload. The ESP32-CAM-MB base board adds a USB port and does this automatically.
Why does my ESP32-CAM keep restarting?
Almost always insufficient power. Use a 5 V supply rated for 2 A, short wires, and a large capacitor near the board. Wi-Fi transmit peaks exceed what many adapters' 3.3 V pins can give.
Can the ESP32-CAM record video to the SD card?
It can save JPEG frames and short MJPEG sequences, but it has no hardware video encoder, so recording is limited to low frame rates.
Can the ESP32-CAM do face recognition?
The original ESP32 can do basic face detection at low resolution. The ESP32-S3 versions handle it much better with the ESP-WHO framework.
Which pins are free on the ESP32-CAM?
With the SD card unused: GPIO 12, 13, 14, 15, 2 and 4 (the flash LED). GPIO 16 is used by PSRAM and GPIO 1 and 3 by serial.
Parts for this guide
Terms in this guide
Projects that use it
Put this into practice: 25 step-by-step builds in our project library use parts from this guide.
Keep learning
Sources
- ESP32-CAM datasheet (AI-Thinker)
- OV2640 datasheet (OmniVision)
- esp32-camera library documentation (Espressif Systems)
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.



