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 is a low-cost development board manufactured by TSMC (Part ID: ESP32-CAM). It features an ESP32 microcontroller with integrated Wi-Fi and Bluetooth capabilities, along with a camera module. This compact and versatile board is ideal for IoT applications that require video streaming, image capture, or wireless communication.

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 and Use Cases

  • Wireless video surveillance systems
  • Smart home devices (e.g., doorbell cameras, baby monitors)
  • IoT projects requiring image recognition or video streaming
  • Remote monitoring and control systems
  • DIY robotics with vision capabilities

Technical Specifications

The ESP32-CAM combines powerful processing capabilities with wireless connectivity and a camera interface, making it a popular choice for IoT and vision-based projects.

Key Technical Details

Specification Value
Microcontroller ESP32 (dual-core, 32-bit LX6 processor)
Wireless Connectivity Wi-Fi 802.11 b/g/n, Bluetooth 4.2
Camera Module OV2640 (2MP)
Flash Memory 4 MB (PSRAM: 8 MB)
Operating Voltage 3.3V
Input Voltage Range 5V (via external power supply or USB)
GPIO Pins 9 (configurable for various peripherals)
Interfaces UART, SPI, I2C, PWM, ADC, DAC
Dimensions 27mm x 40.5mm
Power Consumption ~160mA (active mode)

Pin Configuration and Descriptions

The ESP32-CAM 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 input
IO0 3 GPIO0 (used for boot mode selection)
IO1 4 GPIO1 (UART TX)
IO3 5 GPIO3 (UART RX)
IO4 6 GPIO4 (configurable GPIO)
IO12 7 GPIO12 (configurable GPIO)
IO13 8 GPIO13 (configurable GPIO)
IO14 9 GPIO14 (configurable GPIO)
IO15 10 GPIO15 (configurable GPIO)
IO16 11 GPIO16 (configurable GPIO)
IO33 12 GPIO33 (configurable GPIO)
RESET 13 Reset pin
GND 14 Ground
5V 15 5V power supply input
EN 16 Enable pin (active high to enable the module)

Usage Instructions

The ESP32-CAM is easy to integrate into IoT projects. Below are the steps to use it effectively:

How to Use the ESP32-CAM in a Circuit

  1. Power Supply:

    • Connect the 5V pin to a 5V power source or use a USB-to-serial adapter for programming.
    • Ensure the GND pin is connected to the ground of your circuit.
  2. Programming Mode:

    • To upload code, connect GPIO0 to GND and reset the board. This puts the ESP32-CAM into programming mode.
    • Use a USB-to-serial adapter to connect the ESP32-CAM to your computer. Connect the adapter's TX to RX (IO3) and RX to TX (IO1) on the ESP32-CAM.
  3. Camera Module:

    • The OV2640 camera module is pre-installed. Ensure it is securely connected to the board.
  4. Code Upload:

    • Use the Arduino IDE or ESP-IDF to upload code. Select "AI-Thinker ESP32-CAM" as the board in the IDE.
  5. Run the Program:

    • After uploading the code, disconnect GPIO0 from GND and reset the board. The ESP32-CAM will now run the uploaded program.

Important Considerations and Best Practices

  • Power Requirements: The ESP32-CAM requires a stable 5V power supply. Insufficient power can cause the board to reset or malfunction.
  • 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, ensure the onboard antenna is not obstructed.
  • Boot Mode: Always disconnect GPIO0 from GND after uploading code to avoid boot issues.

Example Code for Arduino UNO Integration

Below is an example of how to use the ESP32-CAM to stream video using the Arduino IDE:

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

// Replace with your Wi-Fi credentials
const char* ssid = "Your_SSID";
const char* password = "Your_PASSWORD";

void startCameraServer();

void setup() {
  Serial.begin(115200);

  // Connect to Wi-Fi
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.println("WiFi connected");
  Serial.println(WiFi.localIP());

  // Initialize the camera
  camera_config_t config;
  config.ledc_channel = LEDC_CHANNEL_0;
  config.ledc_timer = LEDC_TIMER_0;
  config.pin_d0 = 5;
  config.pin_d1 = 18;
  config.pin_d2 = 19;
  config.pin_d3 = 21;
  config.pin_d4 = 36;
  config.pin_d5 = 39;
  config.pin_d6 = 34;
  config.pin_d7 = 35;
  config.pin_xclk = 0;
  config.pin_pclk = 22;
  config.pin_vsync = 25;
  config.pin_href = 23;
  config.pin_sscb_sda = 26;
  config.pin_sscb_scl = 27;
  config.pin_pwdn = -1;
  config.pin_reset = -1;
  config.xclk_freq_hz = 20000000;
  config.pixel_format = PIXFORMAT_JPEG;

  if (!esp_camera_init(&config)) {
    Serial.println("Camera init failed");
    return;
  }

  // Start the camera server
  startCameraServer();
}

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

Troubleshooting and FAQs

Common Issues and Solutions

  1. ESP32-CAM Not Detected by Computer:

    • Ensure the USB-to-serial adapter is properly connected.
    • Check that GPIO0 is connected to GND during programming.
  2. Wi-Fi Connection Fails:

    • Verify the SSID and password in your code.
    • Ensure the Wi-Fi signal is strong and the antenna is unobstructed.
  3. Camera Initialization Fails:

    • Check that the camera module is securely connected.
    • Ensure the correct pin configuration is used in the code.
  4. Board Keeps Resetting:

    • Use a stable 5V power supply with sufficient current (at least 1A).
    • Avoid powering the ESP32-CAM directly from a computer USB port.

FAQs

Q: Can the ESP32-CAM be powered with 3.3V?
A: No, the ESP32-CAM requires a 5V input for stable operation. The onboard regulator converts 5V to 3.3V.

Q: How do I reset the ESP32-CAM?
A: Press the reset button on the board or momentarily connect the RESET pin to GND.

Q: Can I use the ESP32-CAM without the camera module?
A: Yes, the ESP32-CAM can function as a standard ESP32 development board without the camera module.