ESP32-CAM Complete Setup Guide: Flashing, FTDI Wiring, First Boot
What You Need
- ESP32-CAM board (AI-Thinker is the common one — OV2640 camera)
- FTDI USB-to-serial adapter set to 3.3V (5V will kill the board)
- Jumper wires, a breadboard helps
- A separate 5V/1A+ power source is recommended once you're past flashing — USB-serial adapters often can't supply enough current for WiFi + camera
Wiring for Flashing
The ESP32-CAM has no onboard USB, so every session starts with wiring it to an FTDI adapter:
- FTDI 5V → ESP32-CAM 5V
- FTDI GND → ESP32-CAM GND
- FTDI TX → ESP32-CAM U0R (RX)
- FTDI RX → ESP32-CAM U0T (TX)
- GPIO0 → GND (this puts the board in flash/programming mode)
Without GPIO0 tied to GND at power-up, the board boots normally and won't accept new firmware.
Arduino IDE Setup
- Install the ESP32 board package: File > Preferences > Additional Board URLs > add https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
- Tools > Board > ESP32 Arduino > AI Thinker ESP32-CAM
- Set Partition Scheme to "Huge APP (3MB No OTA/1MB SPIFFS)" if you're not doing OTA — this avoids sketch-too-big errors on camera projects
- Select the correct COM port for your FTDI adapter
First Flash: CameraWebServer Example
File > Examples > ESP32 > Camera > CameraWebServer. Uncomment the line for your board:
#define CAMERA_MODEL_AI_THINKERAdd your WiFi credentials in the ssid/password fields near the top, then hit Upload. Watch the console — when it says "Connecting....", press the small RST button on the board.
After Flashing: Boot to Run Mode
Disconnect GPIO0 from GND and power-cycle the board (or press RST). Open Serial Monitor at 115200 baud — you'll see it connect to WiFi and print an IP address. Open that IP in a browser to see the camera stream.
Common Problems
- Brownout detector triggered: your power source can't supply enough current. Use a dedicated 5V/1A+ supply, not the FTDI adapter, once running.
- Upload fails / "Failed to connect": double-check GPIO0-to-GND, and that TX/RX aren't swapped.
- Camera init failed: almost always a power issue, not a wiring issue — try a better supply before reflashing.
- Board resets randomly when WiFi + camera both active: add a large capacitor (470μF+) across 5V/GND near the board.
Next Steps
Once you have a stable stream, look at the companion guides for MJPEG/RTSP streaming into Home Assistant, motion-triggered snapshots, and on-device face detection.
Related Guides
- How to Use the ESP32-CAM: Video Streaming, Motion Detection, and Time-Lapse
- Getting Started with ESP32: GPIO, WiFi, and Your First Project
- ESP32 + MicroPython: Getting Started (vs Arduino IDE)
- How to Program Addressable LED Strips: WS2812B Patterns, Effects, and Power Design
- I2C vs SPI vs UART: How to Choose and Use Serial Communication Protocols
- How to Use Sensors with Arduino and ESP32: Temperature, Distance, Load, Current, and Hall Effect
- How to Control Motors with Arduino and ESP32: Stepper, DC, and Servo Drivers
- How to Hack Wi-Fi and Bluetooth with the Flipper Zero and Wi-Fi Marauder