When wiring an ESP32-CAM or integrating a standalone Digital Video Port (DVP) camera module like the OV2640 or OV5640, guessing the Flexible Printed Circuit (FPC) pinout will instantly fry the sensor's 1.5V core logic. The industry standard for hobbyist and IoT embedded vision is the 24-pin DVP interface. Below is the exact pinout for the ubiquitous AI-Thinker ESP32-CAM board and standard OmniVision-compatible 24-pin FPC ribbons, mapped directly to the ESP32 GPIOs.
The 24-Pin DVP FPC Camera Connector Pinout
This table maps the physical 24-pin FPC connector on the camera module to the specific GPIO pins on the AI-Thinker ESP32-CAM board. If you are wiring a standalone ESP32-WROVER to a bare camera module, use the 'Signal Function' column to map to your own GPIOs.
| Pin | FPC Symbol | Signal Function | ESP32-CAM GPIO | Voltage / Notes |
|---|---|---|---|---|
| 1 | GND | System Ground | GND | 0V |
| 2 | SIOD / SDA | SCCB/I2C Data | GPIO 26 | 3.3V (Needs pull-up) |
| 3 | SIOC / SCL | SCCB/I2C Clock | GPIO 27 | 3.3V (Needs pull-up) |
| 4 | VSYNC | Vertical Sync | GPIO 25 | 3.3V Logic |
| 5 | HREF | Horizontal Reference | GPIO 23 | 3.3V Logic |
| 6 | PCLK | Pixel Clock | GPIO 22 | 3.3V Logic |
| 7 | XCLK | System Clock Input | GPIO 21 | 3.3V (ESP32 outputs 20MHz) |
| 8 | D9 | Data Bit 9 (MSB) | GPIO 19 | 3.3V Logic |
| 9 | D8 | Data Bit 8 | GPIO 36 | 3.3V Logic |
| 10 | D7 | Data Bit 7 | GPIO 18 | 3.3V Logic |
| 11 | D6 | Data Bit 6 | GPIO 39 | 3.3V Logic |
| 12 | D5 | Data Bit 5 | GPIO 5 | 3.3V Logic |
| 13 | D4 | Data Bit 4 | GPIO 34 | 3.3V Logic |
| 14 | D3 | Data Bit 3 | GPIO 35 | 3.3V Logic |
| 15 | D2 | Data Bit 2 | GPIO 32 | 3.3V Logic (Shared w/ PWDN on some variants) |
| 16 | D1 | Data Bit 1 | GPIO 0 | 3.3V Logic (Boot strapping pin!) |
| 17 | D0 | Data Bit 0 (LSB) | GPIO 4 | 3.3V Logic (Shared w/ Flashlight) |
| 18 | RESET | Hardware Reset | GPIO 33 | Active LOW |
| 19 | PWDN | Power Down | GPIO 32 | Active HIGH |
| 20 | DOVDD | Digital I/O Power | 3.3V / 2.8V | Powers I/O pads (3.3V on AI-Thinker) |
| 21 | GND | System Ground | GND | 0V |
| 22 | AVDD | Analog Power | 2.8V | Powers analog array (Internal reg on AI-Thinker) |
| 23 | GND | System Ground | GND | 0V |
| 24 | DVDD | Digital Core Power | 1.5V | Core logic (Internal reg on AI-Thinker) |
Rows People Get Wrong (and How to Fix Them)
When debugging a blank image feed or a bricked sensor, the failure almost always traces back to misinterpreting the control and power rows in the table above.
PWDN and RESET Logic States
The PWDN (Power Down) pin on OmniVision sensors is typically active HIGH. If you leave this pin floating, internal pull-ups may force the camera into a permanent sleep state. On the ESP32-CAM, GPIO 32 drives this pin; your initialization code must explicitly drive it LOW to wake the sensor. Conversely, the RESET pin is active LOW. The Espressif esp32-camera driver handles toggling these pins during the esp_camera_init() sequence, but if you are writing bare-metal I2C init code, you must pulse RESET low for at least 10ms, then release it high before attempting SCCB communication.
SIOD/SIOC: SCCB vs. Standard I2C
Pins 2 and 3 are labeled SDA/SCL on many breakout boards, but they actually use SCCB (Serial Camera Control Bus). SCCB is OmniVision's proprietary variant of I2C. The critical difference is that SCCB does not use the standard I2C Acknowledge (ACK) bit in the same way, and it relies on a specific 'don't care' bit phase. If you try to read camera registers using the standard Arduino Wire.h library, the bus will often hang or return 0xFF. Always use a dedicated SCCB implementation or the official ESP-IDF camera driver to handle the register reads.
XCLK Frequency and Power Brownouts
Pin 7 (XCLK) requires the ESP32 to output a master clock, typically 20MHz. While the OV2640 datasheet states it can accept up to 24MHz, pushing the XCLK to 24MHz on the AI-Thinker ESP32-CAM frequently causes severe 3.3V rail brownouts. The onboard AMS1117-3.3 voltage regulator struggles with the transient current spikes at higher clock speeds, resulting in the ESP32 browning out and rebooting mid-frame capture. Stick to 20MHz (or even 10MHz for long FPC ribbons) to maintain signal integrity and power stability.
Standard Variants: 24-Pin DVP vs 20-Pin vs MIPI
Not all camera ribbons are identical. While the 24-pin DVP is the universal standard for ESP32 hobbyist boards, you may encounter other interfaces when sourcing surplus or industrial camera modules. Here is how the standards compare and which applies to your microcontroller.
| Feature | 24-Pin DVP (Standard) | 20-Pin DVP (Legacy/Alt) | MIPI CSI-2 (Advanced) |
|---|---|---|---|
| Primary Use Case | ESP32, Arduino Portenta, hobbyist SBCs | Older Raspberry Pi cam v1.3, legacy DVRs | Modern SBCs (Pi 4/5, Jetson), smartphones |
| Data Lanes | 8 to 10 parallel pins (D0-D9) | 8 parallel pins (D0-D7) | 1 to 4 differential serial pairs |
| Clocking | Single-ended PCLK & XCLK | Single-ended PCLK & XCLK | Embedded clock in serial data lanes |
| ESP32 Compatibility | Native (via LCD_CAM peripheral) | Native (ignore D8/D9 pins) | Not supported (Requires dedicated MIPI PHY) |
| Max Cable Length | ~15cm (signal degrades fast) | ~10cm | Up to 30cm+ with active repeaters |
Safe Interpretation When FPC Markings Are Faded
Cheap FPC ribbons from online marketplaces often arrive with pin numbers rubbed off, or the silkscreen on the camera PCB is unreadable. Before applying power, you must positively identify Pin 1 and the ground plane using a multimeter.
Finding Pin 1 Visually
Manufacturers follow the OmniVision mechanical standard for FPCs. Pin 1 is almost always indicated by:
- A thicker copper trace on the FPC ribbon compared to the signal lines.
- A beveled or chamfered corner on the blue/black stiffener at the end of the ribbon.
- A small printed dot or triangle on the PCB directly adjacent to the connector.
Multimeter Verification Protocol
Never rely on visual cues alone when the markings are degraded. Use your multimeter to map the power domain before energizing the circuit.
- Identify Ground: Set your meter to continuity mode. Place the black probe on the metal EMI shield of the camera module (this is universally tied to system ground). Probe the FPC pins. Pins 1, 21, and 23 should beep continuously. This confirms your Pin 1 orientation.
- Identify Core Power (DVDD): Switch to diode-test mode. Probe the suspected Pin 24 (DVDD) with the red lead, black on ground. You should read a forward voltage drop (typically 0.4V to 0.8V) due to the internal decoupling capacitors and ESD diodes. If it reads 0.00V (short) or OL (open), your pin mapping is wrong.
- Verify I/O Power (DOVDD): Pin 20 will show a similar diode drop, but often slightly higher impedance than DVDD.
By mapping the ground pins and verifying the diode drops on the power rails, you can safely reconstruct the esp32 camera pinout for any unmarked DVP module. Always double-check your mapping against the official ESP-IDF hardware guidelines before writing firmware, as a single misaligned ZIF connector will permanently short the I2C bus and lock up the ESP32's GPIO matrix.






