IoTAdvancedPRJ-150

Smart Door Visitor Camera (ESP32-CAM)

An ESP32-CAM at the door that captures photos of visitors.

Built and tested by Drisya K S · Industrial Robotics Institute

ESP32-CAM (AI-Thinker)

Arduino IDE, ESP32 board package, Telegram (for notifications)

LevelAdvanced
Build time3–4 hours
BoardESP32-CAM (AI-Thinker)
Parts5 components

What is the Smart Door Visitor Camera (ESP32-CAM)?

A camera-based door alert for home security. The ESP32-CAM connects to Wi-Fi and captures images of whoever is at the door. This guide covers setting up and programming the AI-Thinker ESP32-CAM and capturing frames; sending the photo to your phone (for example via Telegram) is the next step to add.

How it works

  1. The ESP32-CAM connects to your Wi-Fi.
  2. The camera is set up with the AI-Thinker pin configuration.
  3. Every 5 seconds the camera captures a JPEG frame.
  4. The capture is reported on the Serial Monitor; the frame can then be sent to your phone (Telegram code to be added).

Parts list

ComponentQty
ESP32-CAM (AI-Thinker)1
FTDI Programmer1
Jumper WiresAs needed
Breadboard1
Stable 5V Power Supply1

Software

  • Arduino IDE
  • ESP32 board package
  • Telegram (for notifications)

Wiring and connections

FromConnect to
FTDI VCCESP32-CAM 5V
FTDI GNDGND
FTDI TXESP32-CAM U0R (RX)
FTDI RXESP32-CAM U0T (TX)
GPIO0GND (only while uploading)

How to build the Smart Door Visitor Camera (ESP32-CAM)

  1. Wire the FTDI programmer to the ESP32-CAM and join GPIO0 to GND.
  2. In the Arduino IDE choose the board "AI Thinker ESP32-CAM".
  3. Add your Wi-Fi details and upload the code.
  4. Remove the GPIO0–GND wire and press reset.
  5. Open the Serial Monitor at 115200 baud to see captures.
  6. Power the camera from a stable 5V supply (weak USB ports cause resets).

Smart Door Visitor Camera (ESP32-CAM) code

Complete, tested Arduino C++ code for this project. Copy it into Arduino IDE and upload it to the ESP32-CAM (AI-Thinker).

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

const char* ssid = "YourWiFiName";
const char* password = "YourWiFiPassword";

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

  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("WiFi Connected");

  // Camera config (AI-Thinker ESP32-CAM)
  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 = 32;
  config.pin_reset = -1;
  config.xclk_freq_hz = 20000000;
  config.pixel_format = PIXFORMAT_JPEG;
  config.frame_size = FRAMESIZE_VGA;
  config.jpeg_quality = 12;
  config.fb_count = 1;

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

void loop() {
  camera_fb_t *fb = esp_camera_fb_get();
  if (!fb) {
    Serial.println("Camera capture failed");
    return;
  }

  Serial.printf("Image captured: %u bytes\n", fb->len);

  // TODO: send fb->buf (fb->len bytes) to Telegram here

  esp_camera_fb_return(fb);
  delay(5000);
}

Real-world uses

  • Home door security
  • Office entrances
  • Shop monitoring
  • Learning ESP32-CAM

Frequently asked questions

What is a Smart Door Visitor Camera (ESP32-CAM)?

A camera-based door alert for home security. The ESP32-CAM connects to Wi-Fi and captures images of whoever is at the door.

What components are needed for the Smart Door Visitor Camera (ESP32-CAM)?

You need: ESP32-CAM (AI-Thinker) (1), FTDI Programmer (1), Jumper Wires, Breadboard (1), Stable 5V Power Supply (1). Software: Arduino IDE, ESP32 board package, Telegram (for notifications).

Is the Smart Door Visitor Camera (ESP32-CAM) project good for beginners?

It is rated advanced and takes about 3–4 hours to build, using the ESP32-CAM (AI-Thinker). The guide on this page explains every connection and step.

Where can I get the code for the Smart Door Visitor Camera (ESP32-CAM)?

The complete, tested Arduino C++ code is free on this page. Copy it into Arduino IDE and upload it to the board.

Can I buy a kit for the Smart Door Visitor Camera (ESP32-CAM)?

Yes. IRI sells a kit with the parts for this project (PRJ-150). Message IRI on WhatsApp at +91 86060 82634 for the kit price and delivery details.

Industrial Robotics Institute
Logo