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

How to Use esp32came: Examples, Pinouts, and Specs

Image of esp32came
Cirkit Designer LogoDesign with esp32came in Cirkit Designer

Introduction

The ESP32-CAM is a low-cost development board that combines the powerful ESP32 microcontroller with integrated Wi-Fi and Bluetooth capabilities, along with a camera module. This compact and versatile board is ideal for applications requiring wireless connectivity and image or video processing. Its small form factor and rich feature set make it a popular choice for IoT projects, home automation, surveillance systems, and AI-based image recognition tasks.

Explore Projects Built with esp32came

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 esp32came 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 esp32came 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 esp32came 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 Dual Servo System
Image of esp32 cam: A project utilizing esp32came in a practical application
This circuit features an ESP32 CAM module interfaced with two servos and an FTDI programmer for power and communication. The ESP32 CAM controls the servos via GPIO12 and GPIO13, while the FTDI programmer provides power and serial communication for programming and debugging.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with esp32came

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 esp32came 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 esp32came 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 esp32came 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 esp32 cam: A project utilizing esp32came in a practical application
ESP32 CAM Wi-Fi Controlled Dual Servo System
This circuit features an ESP32 CAM module interfaced with two servos and an FTDI programmer for power and communication. The ESP32 CAM controls the servos via GPIO12 and GPIO13, while the FTDI programmer provides power and serial communication for programming and debugging.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications:

  • Wireless video streaming and surveillance
  • IoT-based smart home devices
  • Face and object recognition systems
  • Remote monitoring and control
  • AI-powered image processing projects

Technical Specifications

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

Key Features:

  • Microcontroller: ESP32-D0WDQ6 with dual-core processor
  • Wireless Connectivity: Wi-Fi 802.11 b/g/n and Bluetooth 4.2 (BLE)
  • Camera Module: OV2640 (2MP resolution)
  • Flash Memory: 4MB (PSRAM: 8MB)
  • Operating Voltage: 3.3V
  • Input Voltage Range: 5V (via external power supply or USB)
  • GPIO Pins: 9 available for user applications
  • Interfaces: UART, SPI, I2C, PWM, ADC
  • MicroSD Card Slot: Supports up to 4GB for storage
  • Power Consumption: ~160mA (active mode)
  • 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 Type Description
GND Power Ground connection
3.3V Power 3.3V power supply output
5V Power 5V power input
GPIO0 I/O Used for boot mode selection (connect to GND for programming)
GPIO1 (U0TXD) UART UART0 TX pin (used for serial communication)
GPIO3 (U0RXD) UART UART0 RX pin (used for serial communication)
GPIO4 I/O General-purpose I/O pin
GPIO12 I/O General-purpose I/O pin
GPIO13 I/O General-purpose I/O pin
GPIO14 I/O General-purpose I/O pin
GPIO15 I/O General-purpose I/O pin
GPIO16 I/O General-purpose I/O pin
GPIO33 I/O General-purpose I/O pin
RESET Input Reset pin (active low)
SD_CMD SD Interface Command pin for MicroSD card
SD_CLK SD Interface Clock pin for MicroSD card

Note: GPIO0 must be connected to GND during programming. Disconnect it after flashing the firmware.

Usage Instructions

The ESP32-CAM can be used in a variety of projects. Below are the steps to get started:

1. Setting Up the ESP32-CAM:

  1. Power Supply: Provide 5V to the 5V pin or use an external USB-to-TTL adapter.
  2. Programming Mode: Connect GPIO0 to GND to enable programming mode.
  3. Connect to a Programmer: Use a USB-to-TTL adapter to connect the ESP32-CAM to your computer:
    • TX of the adapter to U0RXD (GPIO3)
    • RX of the adapter to U0TXD (GPIO1)
    • GND of the adapter to GND of the ESP32-CAM
    • 5V of the adapter to the 5V pin of the ESP32-CAM
  4. Install Drivers: Ensure the USB-to-TTL adapter drivers are installed on your computer.

2. Programming the ESP32-CAM:

  • Use the Arduino IDE to program the ESP32-CAM. Follow these steps:
    1. Install the ESP32 board package in the Arduino IDE.
    2. Select the board as "AI-Thinker ESP32-CAM" under Tools > Board.
    3. Select the correct COM port for your USB-to-TTL adapter.
    4. Write or upload a sketch (e.g., a basic camera web server example).

Example Code: Camera Web Server

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

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

// Camera configuration for AI-Thinker module
#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);
  Serial.println();

  // 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("IP address: ");
  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 = 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;
  }

  // Start the camera server
  startCameraServer();
}

void loop() {
  delay(10000); // Keep the program running
}

3. Running the Camera Web Server:

  • After uploading the code, disconnect GPIO0 from GND and reset the board.
  • Open the Serial Monitor to find the IP address of the ESP32-CAM.
  • Enter the IP address in a web browser to access the camera feed.

Important Considerations:

  • Ensure the power supply provides sufficient current (at least 500mA).
  • Use a heat sink if the ESP32-CAM overheats during prolonged use.
  • Avoid using GPIO1 and GPIO3 for other purposes when programming.

Troubleshooting and FAQs

Common Issues:

  1. Camera Initialization Failed:

    • Ensure the camera module is properly connected to the ESP32-CAM board.
    • Verify the camera configuration in the code matches the hardware.
  2. Wi-Fi Connection Issues:

    • Double-check the SSID and password in the code.
    • Ensure the Wi-Fi network is within range.
  3. Serial Monitor Shows Garbage Characters:

    • Set the baud rate in the Serial Monitor to 115200.
  4. ESP32-CAM Not Detected by Computer:

    • Verify the USB-to-TTL adapter connections.
    • Ensure GPIO0 is connected to GND during programming.

FAQs:

  • Q: Can I use the ESP32-CAM without a programmer?
    A: Yes, you can use an external power supply and pre-flashed firmware, but a programmer is required for custom code.

  • Q: What is the maximum resolution of the camera?
    A: The OV2640 camera supports up to 1600x1200 (UXGA) resolution.

  • Q: Can I use the ESP32-CAM for battery-powered projects?
    A: Yes, but ensure the battery can provide sufficient current (at least 500mA).