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

How to Use ESP32CAM: Examples, Pinouts, and Specs

Image of ESP32CAM
Cirkit Designer LogoDesign with ESP32CAM in Cirkit Designer

Introduction

The ESP32CAM is a low-cost development board that features an ESP32 microcontroller with integrated Wi-Fi and Bluetooth capabilities, along with a camera module. This compact and versatile board is widely used in IoT projects, enabling image capture, video streaming, and wireless communication. Its small form factor and powerful features make it ideal for applications such as surveillance systems, remote monitoring, smart home devices, and AI-based image processing.

Common applications of the ESP32CAM include:

  • Wireless video streaming and image capture
  • Home security and surveillance systems
  • Smart doorbells and intercoms
  • Remote monitoring for industrial or agricultural use
  • AI-based object detection and facial recognition

Explore Projects Built with ESP32CAM

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 ESP32CAM 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 ESP32CAM 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 ESP32CAM 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 ESP32CAM 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 ESP32CAM

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 ESP32CAM 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 ESP32CAM 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 ESP32CAM 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 ESP32CAM 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

Technical Specifications

The ESP32CAM combines the ESP32 microcontroller with a camera module and other essential components. Below are its key technical details:

Key Features

  • Microcontroller: ESP32 dual-core processor with Wi-Fi and Bluetooth
  • Camera Module: OV2640 (2MP resolution)
  • Flash Memory: 4MB (PSRAM optional on some models)
  • Storage: MicroSD card slot (supports up to 4GB)
  • Connectivity: Wi-Fi 802.11 b/g/n, Bluetooth 4.2
  • Operating Voltage: 3.3V
  • Power Supply: 5V (via micro-USB or external source)
  • GPIO Pins: 9 available for user applications
  • Dimensions: 27mm x 40.5mm

Pin Configuration and Descriptions

The ESP32CAM has a total of 16 pins. Below is the pinout and description:

Pin Name Description
1 GND Ground connection
2 5V Power input (5V)
3 3.3V Power output (3.3V)
4 GPIO0 General-purpose I/O pin; used for boot mode selection
5 GPIO1 (U0TXD) UART0 TX pin; used for serial communication
6 GPIO3 (U0RXD) UART0 RX pin; used for serial communication
7 GPIO2 General-purpose I/O pin; connected to the onboard LED
8 GPIO4 General-purpose I/O pin
9 GPIO12 General-purpose I/O pin; used for SD card data
10 GPIO13 General-purpose I/O pin; used for SD card clock
11 GPIO14 General-purpose I/O pin; used for SD card command
12 GPIO15 General-purpose I/O pin
13 GPIO16 General-purpose I/O pin
14 GPIO17 General-purpose I/O pin
15 RESET Reset pin; used to restart the board
16 GND Ground connection

Usage Instructions

The ESP32CAM is a versatile board that can be used in a variety of projects. Below are the steps to get started and important considerations:

Setting Up the ESP32CAM

  1. Power the Board: Connect the ESP32CAM to a 5V power source using the 5V and GND pins or a micro-USB adapter.
  2. Programming the Board:
    • Use an FTDI programmer or USB-to-serial adapter to upload code to the ESP32CAM.
    • Connect the FTDI adapter to the ESP32CAM as follows:
      • FTDI GND → ESP32CAM GND
      • FTDI VCC (5V) → ESP32CAM 5V
      • FTDI TX → ESP32CAM U0RXD (GPIO3)
      • FTDI RX → ESP32CAM U0TXD (GPIO1)
    • Set GPIO0 to LOW (connect to GND) to enable programming mode.
    • Use the Arduino IDE or ESP-IDF to upload your code.
  3. Connect to Wi-Fi: Configure the ESP32CAM to connect to your Wi-Fi network for wireless communication.

Example Code: Capturing and Streaming Video

Below is an example Arduino sketch to set up the ESP32CAM for video streaming:

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

// Replace with your Wi-Fi 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("");
  Serial.println("Wi-Fi 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)) {
    Serial.println("Camera initialized successfully");
  } else {
    Serial.println("Camera initialization failed");
    return;
  }

  startCameraServer();
  Serial.println("Camera server started");
}

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

Important Considerations

  • Ensure the ESP32CAM is powered with a stable 5V supply to avoid unexpected resets.
  • Use a heat sink if the board overheats during prolonged use.
  • When using the MicroSD card slot, ensure the card is formatted as FAT32.

Troubleshooting and FAQs

Common Issues

  1. Camera Initialization Failed:

    • Ensure the camera module is properly connected to the ESP32CAM board.
    • Verify the camera configuration pins in your code.
  2. Wi-Fi Connection Issues:

    • Double-check your Wi-Fi credentials.
    • Ensure the Wi-Fi network is within range and supports 2.4GHz (ESP32CAM does not support 5GHz).
  3. Board Not Detected by FTDI Programmer:

    • Verify the connections between the FTDI adapter and the ESP32CAM.
    • Ensure GPIO0 is connected to GND during programming.

Tips for Troubleshooting

  • Use the Serial Monitor in the Arduino IDE to debug issues.
  • If the board fails to boot, press the RESET button or power cycle the board.
  • For better performance, use a high-quality power supply and cables.

This concludes the ESP32CAM documentation. Happy building!