This guide walks you through how to make a video doorbell using affordable components like a Raspberry Pi, camera module, and motion sensor. You’ll learn to code, wire, and install your own smart doorbell with live video and alerts.
Key Takeaways
- DIY video doorbells save money: Building your own costs less than buying a commercial model and lets you customize features.
- Use a Raspberry Pi as the brain: This small computer handles video capture, motion detection, and internet connectivity.
- Choose the right camera module: A Raspberry Pi Camera Module (v2 or HQ) offers high-quality video for clear footage.
- Motion detection triggers alerts: A PIR sensor detects visitors and starts recording or sends notifications to your phone.
- Stream video securely online: Use tools like MotionEyeOS or Home Assistant to view live feeds and store clips safely.
- Power it reliably: Use a 5V power supply or PoE (Power over Ethernet) to keep your doorbell running 24/7.
- Weatherproof your build: Protect electronics with a sealed enclosure and outdoor-rated cables for long-term use.
How to Make Video Doorbell: A Complete DIY Guide
Imagine knowing who’s at your door—even when you’re not home. With a DIY video doorbell, you can see, hear, and speak to visitors using your smartphone. No monthly fees. No subscription traps. Just smart, secure, and customizable tech you built yourself.
In this guide, you’ll learn how to make a video doorbell from scratch using beginner-friendly tools and open-source software. Whether you’re a tech hobbyist or just love solving problems with gadgets, this project is fun, educational, and practical. We’ll walk you through every step: choosing parts, wiring components, writing code, setting up streaming, and installing your doorbell outside.
By the end, you’ll have a working smart doorbell that sends real-time alerts, records video, and lets you check in remotely—all without relying on expensive brands like Ring or Nest.
Why Build Your Own Video Doorbell?
Commercial video doorbells are convenient, but they come with downsides: monthly fees, privacy concerns, and limited customization. When you build your own, you control everything—from data storage to alert settings.
Visual guide about How to Make Video Doorbell
Image source: i.ytimg.com
Here’s why a DIY video doorbell is worth it:
- Cost-effective: A full build costs $80–$150, compared to $200+ for premium models.
- Privacy-first: Your video stays on your home network—no cloud uploads unless you want them.
- Fully customizable: Add features like facial recognition, night vision, or integration with smart lights.
- Learning experience: You’ll gain skills in electronics, coding, and networking.
Plus, it’s a great weekend project that results in something truly useful.
What You’ll Need: Tools and Components
Before we start, gather these parts. Most are available on Amazon, Adafruit, or Raspberry Pi’s official store.
Essential Components
- Raspberry Pi 4 (2GB or 4GB): The “brain” of your doorbell. Handles video, motion detection, and internet.
- Raspberry Pi Camera Module (v2 or HQ): Captures high-definition video. The HQ version supports night vision with an IR filter.
- PIR Motion Sensor (HC-SR501): Detects movement near your door. Triggers recording or alerts.
- MicroSD Card (16GB+): Stores the operating system and recorded clips.
- 5V Power Supply (3A recommended): Powers the Pi. Use a wall adapter or USB-C cable.
- Jumper Wires (male-to-female): Connect the PIR sensor to the Pi.
- Weatherproof Enclosure: Protects electronics from rain and dust. Look for IP65-rated boxes.
- Doorbell Button (optional): A physical button to trigger alerts manually.
Optional Upgrades
- IR LEDs: Add night vision by illuminating the area in darkness.
- Speaker and Microphone: Enable two-way audio so you can talk to visitors.
- PoE HAT: Power the Pi over Ethernet cable—great for clean wiring.
- 3D-Printed Mount: Custom-fit your doorbell to your doorframe.
Tools You’ll Need
- Screwdriver set
- Wire strippers (if cutting cables)
- Hot glue gun (for sealing)
- Laptop or computer (for setup)
- Ethernet cable (for initial setup)
Once you have everything, let’s get started.
Step 1: Set Up the Raspberry Pi
The Raspberry Pi is the core of your video doorbell. We’ll install an operating system and prepare it for video and motion detection.
Install the Operating System
We recommend using Raspberry Pi OS Lite (headless version) to save resources. Alternatively, use MotionEyeOS, a lightweight OS designed specifically for video surveillance.
Here’s how to install Raspberry Pi OS:
- Download Raspberry Pi Imager from raspberrypi.com.
- Insert your microSD card into your computer.
- Open the Imager, select “Raspberry Pi OS (other)” > “Raspberry Pi OS Lite (64-bit)”.
- Choose your SD card and click “Write”.
- Once done, eject the card safely.
Enable SSH and Camera Interface
Since we’re using a headless setup (no monitor), we need to enable SSH for remote access and the camera interface.
- Reinsert the SD card into your computer.
- Open the “boot” drive (it should appear as a removable disk).
- Create an empty file named
ssh(no extension) in the root folder. This enables SSH. - Create another file named
userconfand add your Pi username and password in the format:username:encrypted-password. Use this guide to generate the encrypted password. - To enable the camera, create a file named
config.txtin the boot folder and add:start_x=1andgpu_mem=128.
Connect and Boot the Pi
- Insert the SD card into the Pi.
- Connect the Pi to your router via Ethernet.
- Plug in the power supply to boot it up.
- Wait 1–2 minutes for it to start.
Find the Pi’s IP Address
On your computer, open a terminal or command prompt and run:
ping raspberrypi.local
If that doesn’t work, log into your router’s admin page (usually 192.168.1.1) and look for a device named “raspberrypi”. Note its IP address.
Connect via SSH
Use an SSH client like PuTTY (Windows) or Terminal (Mac/Linux):
ssh pi@[IP_ADDRESS]
Default password is raspberry unless you changed it.
Update the System
Once logged in, run:
sudo apt update && sudo apt upgrade -y
This ensures your Pi has the latest software.
Step 2: Connect the Camera Module
The camera captures video when motion is detected. The Raspberry Pi Camera Module connects via a ribbon cable.
Attach the Camera
- Power off the Pi and unplug it.
- Locate the camera port (CSI) on the Pi—it’s a narrow slot near the HDMI port.
- Lift the plastic tab on the port.
- Insert the ribbon cable (blue side facing the Ethernet port).
- Push the tab back down to secure it.
- Mount the camera inside your enclosure with screws or adhesive.
Test the Camera
Power on the Pi and SSH back in. Test the camera with:
raspistill -o test.jpg
This takes a photo and saves it as test.jpg. To view it, transfer the file to your computer using SCP or enable VNC.
If the image is dark or distorted, check the cable connection. Ensure the camera is enabled in raspi-config:
sudo raspi-config
Navigate to Interface Options > Camera > Enable.
Step 3: Wire the PIR Motion Sensor
The PIR sensor detects when someone approaches your door. When triggered, it tells the Pi to start recording.
Understand the PIR Sensor Pins
The HC-SR501 has three pins:
- VCC: Connect to 5V (Pin 2 on Pi)
- GND: Connect to Ground (Pin 6 on Pi)
- OUT: Connect to a GPIO pin (e.g., GPIO 4, Pin 7)
Connect the Sensor
- Power off the Pi.
- Use jumper wires to connect:
- PIR VCC → Pi 5V (Pin 2)
- PIR GND → Pi GND (Pin 6)
- PIR OUT → Pi GPIO 4 (Pin 7)
- Mount the PIR sensor inside the enclosure, pointing toward the door area.
- Adjust the sensitivity and delay using the small potentiometers on the sensor.
Test the Sensor
Create a simple Python script to test motion detection:
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setup(4, GPIO.IN)
print("PIR Sensor Test (Ctrl+C to exit)")
try:
while True:
if GPIO.input(4):
print("Motion detected!")
time.sleep(0.1)
except KeyboardInterrupt:
print("Test ended")
GPIO.cleanup()
Save as pir_test.py and run:
python3 pir_test.pyWave your hand in front of the sensor. You should see “Motion detected!” in the terminal.
Step 4: Install MotionEyeOS for Video Streaming
Instead of writing complex code from scratch, we’ll use MotionEyeOS, a free, open-source surveillance system that runs on the Pi.
Why MotionEyeOS?
- Web-based interface for easy setup
- Motion detection with alerts
- Live streaming and video recording
- Email or push notifications
- Works with cameras and sensors
Install MotionEyeOS
- Download the latest MotionEyeOS image from GitHub.
- Use Raspberry Pi Imager to flash the image to your SD card.
- Insert the card into the Pi and power it on.
- Wait 2–3 minutes for setup.
Access the Web Interface
Find the Pi’s IP address (same as before) and open a browser:
http://[IP_ADDRESS]:8765
Default login: admin (no password).
Configure the Camera
- Click “Add Camera” > “Local Raspberry Pi Camera”.
- Set resolution to 1280x720 or 1920x1080.
- Enable “Motion Detection”.
- Set sensitivity and threshold (start with 50% and adjust).
- Enable “Still Images” and “Video Recording”.
- Set storage path to
/home/adminor an external USB drive.
Set Up Alerts
- Go to “Actions” tab.
- Enable “Send Email” or “Run Command”.
- For email, enter your SMTP details (Gmail works with app passwords).
- For push alerts, use a service like Pushover or IFTTT.
Example IFTTT command:
curl -X POST https://maker.ifttt.com/trigger/doorbell_motion/with/key/YOUR_KEY
Step 5: Add Two-Way Audio (Optional)
Want to talk to visitors? Add a USB microphone and speaker.
Connect Audio Devices
- Plug a USB microphone into a Pi USB port.
- Connect a small USB speaker or use a powered speaker with a 3.5mm jack.
Test Audio
Record a test sound:
arecord -d 5 test.wav
Play it back:
aplay test.wav
Enable Audio in MotionEyeOS
- In MotionEyeOS, go to camera settings.
- Enable “Audio” and select your microphone.
- Set audio bitrate (128 kbps is fine).
- Save and restart the service.
Now you can hear visitors and respond via the web interface.
Step 6: Power and Weatherproofing
Your doorbell needs reliable power and protection from the elements.
Power Options
- Wall Adapter: Use a 5V 3A USB-C power supply. Run a cable through the wall or under the door.
- PoE (Power over Ethernet): Use a PoE HAT and Ethernet cable to deliver power and data in one wire.
- Battery (not recommended): Pi drains power quickly. Only use for testing.
Weatherproof the Enclosure
- Drill small holes for camera lens, PIR sensor, and cables.
- Use silicone sealant around holes to prevent water ingress.
- Mount the Pi, camera, and sensor inside with standoffs.
- Close the enclosure and secure with screws.
- Add a small silica gel pack to absorb moisture.
Cable Management
- Use outdoor-rated USB or Ethernet cables.
- Route cables through conduit or under trim.
- Use cable clips to secure wires.
Step 7: Mount and Test Your Doorbell
Now it’s time to install your creation.
Choose a Location
- Mount at eye level (5–6 feet high).
- Point the camera toward the walkway.
- Ensure the PIR sensor has a clear view.
- Avoid direct sunlight or bright lights that cause glare.
Mounting Options
- Screws: Drill into the doorframe or wall.
- Adhesive Strips: Use heavy-duty outdoor tape (e.g., 3M VHB).
- 3D-Printed Bracket: Design a custom mount for a perfect fit.
Final Test
- Power on the doorbell.
- Open the MotionEyeOS web interface.
- Walk in front of the door—check if motion is detected.
- Verify video quality and audio (if enabled).
- Test alerts: Do you get an email or phone notification?
Troubleshooting Common Issues
No Video Feed
- Check camera ribbon cable connection.
- Ensure camera is enabled in
raspi-config. - Reboot the Pi.
False Motion Alarms
- Adjust PIR sensitivity (turn the potentiometer clockwise to reduce).
- Reposition the sensor away from heat sources or moving curtains.
- Increase the delay time between triggers.
Pi Keeps Rebooting
- Use a higher-quality power supply (3A minimum).
- Check for loose connections.
- Avoid using USB hubs or underpowered adapters.
Can’t Access Web Interface
- Verify the Pi’s IP address.
- Ensure your computer is on the same network.
- Check firewall settings.
Video is Blurry or Dark
- Clean the camera lens.
- Adjust focus (on HQ camera).
- Add IR LEDs for night vision.
Conclusion
You’ve just built your own video doorbell—a smart, secure, and customizable solution that rivals commercial models. From wiring the PIR sensor to setting up live streaming, you’ve gained hands-on experience with Raspberry Pi, electronics, and home automation.
This project doesn’t just save money—it gives you full control over your data and features. You can expand it later: add facial recognition, integrate with Home Assistant, or connect to smart locks.
Building tech yourself is empowering. And now, every time someone rings your (virtual) doorbell, you’ll know exactly how it works—because you made it.
So grab your tools, follow the steps, and start seeing who’s at your door—anytime, anywhere.