Build your own private, secure smart doorbell for a fraction of the cost of commercial alternatives. Using the ESP32-CAM, you'll create a system that captures a high-resolution photo when someone rings the bell and instantly sends it to your phone via Telegram or a custom web app. No monthly subscriptions, no privacy concerns.
The ESP32-CAM is a marvel of engineering, combining a powerful microcontroller with an OV2640 camera module. In this project, the module remains in a low-power sleep state until the doorbell button is pressed. This triggers an External Interrupt, waking the device.
Once awake, the ESP32-CAM connects to WiFi, initializes the camera, takes a snapshot, and uploads it to a cloud service (like Telegram Bot API). It can also host a live video stream for real-time monitoring.
| Component | ESP32-CAM Pin | Notes |
|---|---|---|
| Push Button | GPIO 13 | External Wake-up Pin |
| Doorbell Chime | GPIO 12 | Optional Buzzer |
| FTDI RX | GPIO 1 (TX) | For programming only |
| FTDI TX | GPIO 3 (RX) | For programming only |
| Power | 5V / GND | Requires stable 5V 2A |
Important: To upload code, you must connect IO0 to GND and press Reset. Remove the jumper for normal operation.
#include "esp_camera.h"
#include <WiFi.h>
const char* ssid = "YOUR_WIFI_SSID";
const char* password = "YOUR_WIFI_PASSWORD";
// AI-Thinker Model Pinout
#define PWDN_GPIO_NUM 32
#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 setup() {
Serial.begin(115200);
camera_config_t config;
config.ledc_channel = LEDC_CHANNEL_0;
config.ledc_timer = LEDC_TIMER_0;
config.pin_d0 = Y2_GPIO_NUM;
// ... (Full camera config snippet)
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) { delay(500); }
// Logic to take photo and send via Telegram when GPIO 13 is LOW
}
void loop() {
// Check button state or handle stream
}