Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use ESP32-CAM: Examples, Pinouts, and Specs

Image of ESP32-CAM
Cirkit Designer LogoDesign with ESP32-CAM in Cirkit Designer

Introduction

The ESP32-CAM (Manufacturer Part ID: COM6) is a low-cost, low-power system on a chip (SoC) developed by Arduino. It features integrated Wi-Fi and Bluetooth capabilities, along with a camera module for image and video capture. This versatile module is widely used in Internet of Things (IoT) projects and applications requiring remote monitoring, such as home automation, security systems, and wireless video streaming.

Explore Projects Built with ESP32-CAM

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
ESP32 CAM Wi-Fi Controlled Camera with FTDI Programmer
Image of R: A project utilizing ESP32-CAM in a practical application
This circuit consists of an ESP32 CAM module connected to an FTDI Programmer for power and serial communication. The ESP32 CAM is programmed to capture images and stream them over WiFi, acting as a web server to provide live video feed.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32 CAM Wi-Fi Controlled Camera with FTDI Programmer
Image of ESP32 CAM: A project utilizing ESP32-CAM in a practical application
This circuit consists of an ESP32 CAM module connected to an FTDI Programmer for power and serial communication. The ESP32 CAM is programmed to capture images and stream them over WiFi, acting as a web server to provide a live video feed.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32 CAM Wi-Fi Controlled Live Video Streamer with FTDI Programmer
Image of amen: A project utilizing ESP32-CAM in a practical application
This circuit consists of an ESP32 CAM module connected to an FTDI Programmer for power and serial communication. The ESP32 CAM is programmed to capture images and stream them over WiFi, acting as a web server to provide a live video feed.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32 CAM Wi-Fi Controlled Camera with FTDI Programmer
Image of EventCAM: A project utilizing ESP32-CAM in a practical application
This circuit connects an ESP32 CAM module to an FTDI Programmer for power and serial communication. The ESP32 CAM is programmed to capture images and stream them over WiFi, acting as a web server to provide a live video feed.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with ESP32-CAM

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of R: A project utilizing ESP32-CAM in a practical application
ESP32 CAM Wi-Fi Controlled Camera with FTDI Programmer
This circuit consists of an ESP32 CAM module connected to an FTDI Programmer for power and serial communication. The ESP32 CAM is programmed to capture images and stream them over WiFi, acting as a web server to provide live video feed.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of ESP32 CAM: A project utilizing ESP32-CAM in a practical application
ESP32 CAM Wi-Fi Controlled Camera with FTDI Programmer
This circuit consists of an ESP32 CAM module connected to an FTDI Programmer for power and serial communication. The ESP32 CAM is programmed to capture images and stream them over WiFi, acting as a web server to provide a live video feed.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of amen: A project utilizing ESP32-CAM in a practical application
ESP32 CAM Wi-Fi Controlled Live Video Streamer with FTDI Programmer
This circuit consists of an ESP32 CAM module connected to an FTDI Programmer for power and serial communication. The ESP32 CAM is programmed to capture images and stream them over WiFi, acting as a web server to provide a live video feed.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of EventCAM: A project utilizing ESP32-CAM in a practical application
ESP32 CAM Wi-Fi Controlled Camera with FTDI Programmer
This circuit connects an ESP32 CAM module to an FTDI Programmer for power and serial communication. The ESP32 CAM is programmed to capture images and stream them over WiFi, acting as a web server to provide a live video feed.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications

  • Wireless video surveillance and monitoring
  • Smart home devices and automation
  • IoT-based image recognition systems
  • Remote-controlled robots with video feedback
  • Environmental monitoring with visual data capture

Technical Specifications

The ESP32-CAM is a powerful module with the following key specifications:

Parameter Value
Microcontroller ESP32-D0WDQ6
Wireless Connectivity Wi-Fi 802.11 b/g/n, Bluetooth 4.2 (Classic and BLE)
Camera Module OV2640 (2MP resolution)
Flash Memory 4 MB (PSRAM: 8 MB)
Operating Voltage 3.3V
Input Voltage Range 5V (via external power supply or USB)
GPIO Pins 9 (including UART, SPI, I2C, PWM, ADC, and DAC support)
Image Output Format JPEG, BMP, GRAYSCALE
Power Consumption Deep Sleep: ~6mA, Active Mode: ~160mA
Dimensions 27mm x 40.5mm

Pin Configuration and Descriptions

The ESP32-CAM module has a total of 16 pins. Below is the pinout and description:

Pin Name Pin Number Description
GND 1 Ground
3.3V 2 3.3V Power Supply
5V 3 5V Power Supply (preferred for stable operation)
GPIO0 4 General Purpose I/O, used for boot mode selection
GPIO1 (TX) 5 UART Transmit
GPIO3 (RX) 6 UART Receive
GPIO4 7 General Purpose I/O, supports PWM, ADC, and more
GPIO12 8 General Purpose I/O, connected to the onboard LED
GPIO13 9 General Purpose I/O, supports PWM, ADC, and more
GPIO14 10 General Purpose I/O, supports PWM, ADC, and more
GPIO15 11 General Purpose I/O, supports PWM, ADC, and more
GPIO16 12 General Purpose I/O, supports PWM, ADC, and more
GPIO33 13 General Purpose I/O, supports PWM, ADC, and more
RESET 14 Reset Pin
SD_D2 15 SD Card Data Line 2
SD_D3 16 SD Card Data Line 3

Usage Instructions

How to Use the ESP32-CAM in a Circuit

  1. Power Supply: Connect the 5V pin to a stable 5V power source. Ensure the GND pin is connected to the ground of your circuit.
  2. Programming: Use an FTDI programmer or USB-to-serial adapter to upload code. Connect the following:
    • FTDI TX to ESP32-CAM RX (GPIO3)
    • FTDI RX to ESP32-CAM TX (GPIO1)
    • GND to GND
    • 5V to 5V
  3. Boot Mode: To upload code, connect GPIO0 to GND and press the RESET button. After uploading, disconnect GPIO0 from GND.
  4. Camera Module: Ensure the OV2640 camera module is securely connected to the ESP32-CAM board.

Important Considerations

  • Power Stability: Use a stable 5V power supply to avoid unexpected resets or malfunctions.
  • Heat Management: The ESP32-CAM can get warm during operation. Ensure proper ventilation or use a heatsink if necessary.
  • Antenna: For better Wi-Fi performance, use an external antenna if the onboard antenna is insufficient for your application.
  • SD Card: If using an SD card, format it to FAT32 and ensure it is properly inserted into the slot.

Example Code for Arduino UNO

Below is an example code to capture an image and serve it via a web server:

#include <WiFi.h>
#include <esp_camera.h>

// Replace with your network credentials
const char* ssid = "Your_SSID";
const char* password = "Your_PASSWORD";

// Camera configuration
#define PWDN_GPIO_NUM    -1
#define RESET_GPIO_NUM   -1
#define XCLK_GPIO_NUM     0
#define SIOD_GPIO_NUM    26
#define SIOC_GPIO_NUM    27
#define Y9_GPIO_NUM      35
#define Y8_GPIO_NUM      34
#define Y7_GPIO_NUM      39
#define Y6_GPIO_NUM      36
#define Y5_GPIO_NUM      21
#define Y4_GPIO_NUM      19
#define Y3_GPIO_NUM      18
#define Y2_GPIO_NUM       5
#define VSYNC_GPIO_NUM   25
#define HREF_GPIO_NUM    23
#define PCLK_GPIO_NUM    22

void startCameraServer();

void setup() {
  Serial.begin(115200);
  WiFi.begin(ssid, password);

  // Wait for Wi-Fi connection
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("\nWiFi connected");

  // Camera initialization
  camera_config_t config;
  config.ledc_channel = LEDC_CHANNEL_0;
  config.ledc_timer = LEDC_TIMER_0;
  config.pin_d0 = Y2_GPIO_NUM;
  config.pin_d1 = Y3_GPIO_NUM;
  config.pin_d2 = Y4_GPIO_NUM;
  config.pin_d3 = Y5_GPIO_NUM;
  config.pin_d4 = Y6_GPIO_NUM;
  config.pin_d5 = Y7_GPIO_NUM;
  config.pin_d6 = Y8_GPIO_NUM;
  config.pin_d7 = Y9_GPIO_NUM;
  config.pin_xclk = XCLK_GPIO_NUM;
  config.pin_pclk = PCLK_GPIO_NUM;
  config.pin_vsync = VSYNC_GPIO_NUM;
  config.pin_href = HREF_GPIO_NUM;
  config.pin_sscb_sda = SIOD_GPIO_NUM;
  config.pin_sscb_scl = SIOC_GPIO_NUM;
  config.pin_pwdn = PWDN_GPIO_NUM;
  config.pin_reset = RESET_GPIO_NUM;
  config.xclk_freq_hz = 20000000;
  config.pixel_format = PIXFORMAT_JPEG;

  if (!esp_camera_init(&config)) {
    Serial.println("Camera initialized successfully");
  } else {
    Serial.println("Camera initialization failed");
    return;
  }

  startCameraServer();
}

void loop() {
  // Main loop does nothing; camera server handles requests
}

Troubleshooting and FAQs

Common Issues

  1. ESP32-CAM Not Connecting to Wi-Fi

    • Ensure the SSID and password are correct.
    • Check if the Wi-Fi signal strength is sufficient.
    • Use an external antenna if necessary.
  2. Camera Initialization Failed

    • Verify the camera module is securely connected.
    • Ensure the correct GPIO pins are configured in the code.
  3. Frequent Resets

    • Use a stable 5V power supply with sufficient current (at least 1A).
    • Check for loose connections or short circuits.
  4. SD Card Not Detected

    • Ensure the SD card is formatted to FAT32.
    • Verify the SD card is properly inserted and the pins are clean.

FAQs

Q: Can the ESP32-CAM be powered via USB?
A: No, the ESP32-CAM does not have a USB port. Use an FTDI programmer or external 5V power supply.

Q: What is the maximum resolution of the camera?
A: The OV2640 camera module supports a maximum resolution of 1600x1200 pixels.

Q: Can I use the ESP32-CAM for real-time video streaming?
A: Yes, the ESP32-CAM can stream video over Wi-Fi, but the frame rate and quality depend on the network bandwidth and configuration.