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 Arduino (Part ID: UNO) that features a built-in camera and Wi-Fi capabilities. It is based on the ESP32 chip, which is known for its powerful processing capabilities and integrated wireless communication. The ESP32 Cam is ideal for IoT applications, such as video streaming, image capture, and remote monitoring. Its compact size and versatile features make it a popular choice for developers and hobbyists alike.

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

  • Home security systems with live video streaming
  • Smart doorbells with image capture and motion detection
  • IoT-enabled surveillance cameras
  • Face recognition and object detection projects
  • Wireless image transmission for robotics and drones

Technical Specifications

The ESP32 Cam is equipped with a range of features that make it suitable for various applications. Below are its key technical specifications:

General Specifications

Feature Specification
Microcontroller ESP32-S chip
Camera OV2640 (2MP)
Wi-Fi 802.11 b/g/n
Bluetooth BLE and Bluetooth 4.2
Flash Memory 4MB
SRAM 520KB
Operating Voltage 3.3V
Power Supply Range 5V (via external power or USB)
Dimensions 27mm x 40.5mm

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
5V 3 5V Power Supply
GPIO0 4 General Purpose I/O (Boot Mode Select)
GPIO1 5 UART TX (Serial Communication)
GPIO3 6 UART RX (Serial Communication)
GPIO4 7 General Purpose I/O
GPIO12 8 General Purpose I/O
GPIO13 9 General Purpose I/O
GPIO14 10 General Purpose I/O
GPIO15 11 General Purpose I/O
GPIO16 12 General Purpose I/O
GPIO33 13 General Purpose I/O
GPIO34 14 General Purpose I/O
RESET 15 Reset Pin
GND 16 Ground

Usage Instructions

The ESP32 Cam can be used in a variety of projects, but it requires careful setup and configuration. Below are the steps to get started:

1. Setting Up the ESP32 Cam

  1. Power Supply: Connect the ESP32 Cam to a 5V power source using an external power supply or USB.
  2. Programming: Use an FTDI programmer or USB-to-serial adapter to upload code to the ESP32 Cam. Connect the following:
    • FTDI GND to ESP32 Cam GND
    • FTDI VCC (5V) to ESP32 Cam 5V
    • FTDI TX to ESP32 Cam RX
    • FTDI RX to ESP32 Cam TX
  3. Boot Mode: To upload code, connect GPIO0 to GND and press the RESET button.

2. Programming with Arduino IDE

  1. Install the ESP32 board package in the Arduino IDE:
    • Go to File > Preferences and add the following URL to the "Additional Board Manager URLs" field:
      https://dl.espressif.com/dl/package_esp32_index.json
    • Go to Tools > Board > Boards Manager, search for "ESP32," and install the package.
  2. Select the AI-Thinker ESP32-CAM board from the Tools menu.
  3. Write or upload your code. Below is an example for capturing an image and starting 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");

  // Initialize the camera
  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) != ESP_OK) {
    Serial.println("Camera init failed");
    return;
  }

  startCameraServer();
  Serial.println("Camera ready! Use the IP address to connect.");
}

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

3. Accessing the Camera

  • After uploading the code, open the Serial Monitor to find the ESP32 Cam's IP address.
  • Enter the IP address in a web browser to access the camera feed.

Important Considerations

  • Ensure the ESP32 Cam is powered with a stable 5V supply to avoid boot issues.
  • Use a heat sink if the module gets too hot during operation.
  • Avoid using GPIO0, GPIO2, and GPIO15 for other purposes, as they are used for boot modes.

Troubleshooting and FAQs

Common Issues

  1. ESP32 Cam Not Booting:

    • Ensure GPIO0 is connected to GND during programming.
    • Check the power supply voltage (must be 5V).
  2. Camera Initialization Failed:

    • Verify the camera module is properly connected.
    • Ensure the correct camera model is selected in the code.
  3. Wi-Fi Connection Issues:

    • Double-check the SSID and password in the code.
    • Ensure the Wi-Fi network is within range.

Solutions and Tips

  • Use a high-quality FTDI programmer to avoid communication errors.
  • If the ESP32 Cam is not detected, try pressing the RESET button after connecting GPIO0 to GND.
  • For better performance, use a dedicated 5V power supply instead of relying on USB power.

By following this documentation, you can successfully set up and use the ESP32 Cam for your IoT and video streaming projects.