An ESP32-CAM at the door that captures photos of visitors.
Built and tested by Drisya K S · Industrial Robotics Institute
Arduino IDE, ESP32 board package, Telegram (for notifications)
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.
| Component | Qty |
|---|---|
| ESP32-CAM (AI-Thinker) | 1 |
| FTDI Programmer | 1 |
| Jumper Wires | As needed |
| Breadboard | 1 |
| Stable 5V Power Supply | 1 |
| From | Connect to |
|---|---|
| FTDI VCC | ESP32-CAM 5V |
| FTDI GND | GND |
| FTDI TX | ESP32-CAM U0R (RX) |
| FTDI RX | ESP32-CAM U0T (TX) |
| GPIO0 | GND (only while uploading) |
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);
}A camera-based door alert for home security. The ESP32-CAM connects to Wi-Fi and captures images of whoever is at the door.
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).
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.
The complete, tested Arduino C++ code is free on this page. Copy it into Arduino IDE and upload it to the board.
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.