The ESP32-CAM (AI-Thinker version) is a cheap WiFi camera, but a fussy one: there's no USB port and weak power makes it reset. This guide walks through flashing and running the built-in streaming example.
Parts
- AI-Thinker ESP32-CAM (OV2640 camera)
- USB-TTL adapter (FTDI / CP2102 / CH340) with 3.3V logic, or an ESP32-CAM-MB programming base
- A stable 5V supply, at least 500mA (ideally 1A)
- Jumper wires, plus one jumper to tie IO0 to GND
Wiring for flashing
| USB-TTL | ESP32-CAM |
|---|---|
| 5V | 5V |
| GND | GND |
| TX | U0R (GPIO3) |
| RX | U0T (GPIO1) |
| Connect IO0 to GND to enter flash mode, then press RESET. | |
Steps
- In the Arduino IDE, install the esp32 by Espressif Systems board package.
- Select the AI Thinker ESP32-CAM board.
- Open
File → Examples → ESP32 → Camera → CameraWebServer. - Uncomment
#define CAMERA_MODEL_AI_THINKER(all other model lines must be commented). On newer core versions, pick the model inboard_config.h. - Enter your WiFi
ssidandpassword(2.4GHz). - Upload. When you see "Connecting...", press RESET if needed.
- Remove the IO0–GND jumper, press RESET, and open the Serial Monitor at 115200 to read the IP address.
- Open that IP in your browser and click Start Stream.
Common problems
| Symptom | Cause / fix |
|---|---|
Brownout detector was triggered | Weak power. Use a dedicated 5V supply with enough current, short wires, and a 470µF–1000µF capacitor near the 5V pin. Don't power it from a weak laptop USB port. |
Failed to connect... Wrong boot mode | IO0 wasn't tied to GND while flashing, or RESET wasn't pressed. |
Camera init failed 0x105 / 0x20001 | Loose camera ribbon cable or the wrong board model selected. |
| Choppy, laggy video | Lower the resolution (VGA/SVGA), raise the JPEG quality value (higher number = more compression), move closer to the router. |
| Chip gets very hot | Normal during continuous streaming; add a small heatsink and keep it ventilated. |
Security: the CameraWebServer example has no password. Use it only on your LAN and never expose its port to the Internet. For remote viewing, use a VPN (WireGuard/Tailscale) or a Cloudflare Tunnel with authentication.