Home Articles Build a DIY Home Security System with Raspberry Pi (Under $150)
Guide · 6 min read

Build a DIY Home Security System with Raspberry Pi (Under $150)

Build a complete DIY home security system with Raspberry Pi — motion detection, camera alerts, and local storage. No monthly fees.

Commercial home security systems want $15-40/month for cloud recording, and they stop working the moment you cancel. Ring, Arlo, Nest — they all hold your footage hostage behind a subscription. A Raspberry Pi-based security system costs under $150 in hardware, stores everything locally, sends instant alerts to your phone, and never charges you a monthly fee. Here's how to build one.

What You'll Build

By the end of this guide, you'll have a security system that:

  • Captures video from 1-4 cameras with motion detection
  • Sends push notifications with snapshot images to your phone when motion is detected
  • Records 24/7 or motion-triggered clips to a local drive
  • Provides a web interface accessible from any device on your network
  • Optionally exposes a secure remote feed through a VPN or Tailscale tunnel
  • Costs nothing beyond the initial hardware investment

No cloud. No subscription. No company watching your footage.

Hardware Shopping List

Component Recommended Model Price
Raspberry Pi Pi 5 (4GB) $60
microSD card SanDisk Extreme 64GB $10
USB SSD (for recording) Kingston XS1000 1TB $60
Power supply Official Pi 5 27W USB-C $12
Case (with fan) Argon ONE V3 $15
Total $157

For cameras, you have two options:

Option A: USB Cameras (Simplest)

Plug a USB webcam directly into the Pi. The Logitech C920 ($50-70) is the classic choice — 1080p, decent night vision with an IR illuminator, and excellent Linux compatibility. You can connect 1-2 USB cameras to a Pi 5 before saturating the USB bandwidth.

Option B: IP Cameras (Better Quality)

Network cameras connect via Ethernet or WiFi and stream video over RTSP. The Reolink RLC-510A ($45) delivers 5MP resolution, built-in IR night vision, and PoE (Power over Ethernet) — meaning one cable provides data and power. IP cameras are better for outdoor use and longer cable runs.

You can mix and match — use USB cameras for indoor spots and IP cameras for outdoor coverage.

Software: Frigate NVR

We're using Frigate, the best open-source NVR (Network Video Recorder) for home use. Frigate provides:

  • Real-time object detection (person, car, animal, package) using a Google Coral TPU or CPU-based inference
  • Motion-triggered and continuous recording
  • Home Assistant integration
  • Web interface with live views and playback
  • MQTT notifications for custom automation

Why Frigate Over Motion or ZoneMinder?

Motion is lightweight but only detects pixel changes — it can't tell a person from a tree branch in the wind. You'll get hundreds of false alerts.

ZoneMinder is powerful but overly complex for a home setup. The UI is stuck in 2005, and configuration requires significant effort.

Frigate uses AI object detection to intelligently filter motion. When a person walks into frame, you get an alert. When the wind blows your bushes, you don't. This alone makes Frigate worth choosing over the alternatives.

Step-by-Step Setup

Step 1: Install Raspberry Pi OS

Download Raspberry Pi Imager from raspberrypi.com. Flash Raspberry Pi OS Lite (64-bit) to your microSD card. During the imaging process, click the gear icon and:

  • Set a hostname (e.g., security-pi)
  • Enable SSH
  • Set a username and strong password
  • Configure your WiFi (though wired Ethernet is more reliable for camera feeds)

Insert the card, connect Ethernet and power, and SSH in:

ssh your-username@security-pi.local

Step 2: Prepare the USB SSD

The microSD card is for the OS; recordings go on the USB SSD for speed and longevity. Plug in your USB SSD and mount it:

sudo mkdir /mnt/recordings
sudo mount /dev/sda1 /mnt/recordings

Add it to /etc/fstab for automatic mounting on boot:

echo '/dev/sda1 /mnt/recordings ext4 defaults,noatime 0 2' | sudo tee -a /etc/fstab

Format the drive if it's new:

sudo mkfs.ext4 /dev/sda1

Step 3: Install Docker

Frigate runs in Docker, which simplifies installation and updates:

curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER

Log out and back in for the group change to take effect.

Step 4: Configure Frigate

Create a directory for Frigate's config:

mkdir -p ~/frigate/config

Create the configuration file ~/frigate/config/config.yml:

mqtt:
  enabled: false  # Enable if using Home Assistant

cameras:
  front_door:
    ffmpeg:
      inputs:
        - path: rtsp://192.168.1.100:554/stream1  # Your IP camera's RTSP URL
          roles:
            - detect
            - record
    detect:
      width: 1920
      height: 1080
      fps: 5
    record:
      enabled: true
      retain:
        days: 14
        mode: motion
      events:
        retain:
          default: 30
          mode: motion
    snapshots:
      enabled: true
      retain:
        default: 30
    objects:
      track:
        - person
        - car
        - dog
        - cat

  living_room:
    ffmpeg:
      inputs:
        - path: /dev/video0  # USB camera
          roles:
            - detect
            - record
    detect:
      width: 1920
      height: 1080
      fps: 5
    record:
      enabled: true
      retain:
        days: 7
        mode: motion
    objects:
      track:
        - person

record:
  enabled: true
  retain:
    days: 14
    mode: motion
  events:
    retain:
      default: 30

snapshots:
  enabled: true

detectors:
  cpu1:
    type: cpu
    num_threads: 4

Adjust the camera paths for your setup:

  • USB cameras: /dev/video0, /dev/video2, etc.
  • IP cameras: rtsp://[camera-ip]:[port]/[stream-path] (check your camera's documentation for the RTSP URL)

Step 5: Launch Frigate

docker run -d \
  --name frigate \
  --restart=unless-stopped \
  --mount type=tmpfs,target=/tmp/cache,tmpfs-size=1000000000 \
  --device /dev/video0 \
  -v ~/frigate/config:/config \
  -v /mnt/recordings:/media/frigate \
  -p 5000:5000 \
  -p 8554:8554 \
  -p 8555:8555/tcp \
  -p 8555:8555/udp \
  ghcr.io/blakeblackshear/frigate:stable

Open a browser and navigate to http://security-pi.local:5000. You should see your camera feeds with object detection overlays.

Step 6: Set Up Notifications

For push notifications without a subscription service, we'll use ntfy — a free, open-source push notification system.

Install the ntfy app on your phone (available on both iOS and Android). Subscribe to a topic — make it random and unique, like my-home-security-abc123.

Create a simple notification script ~/frigate/notify.sh:

#!/bin/bash
# Called by Frigate when an event occurs
EVENT_TYPE=$1
CAMERA=$2
LABEL=$3

curl -H "Title: Motion Alert" \
     -H "Priority: high" \
     -H "Tags: warning" \
     -d "$LABEL detected on $CAMERA" \
     https://ntfy.sh/my-home-security-abc123

For more sophisticated notifications (including snapshot images), integrate Frigate with Home Assistant and use the Frigate notification blueprint, which sends images directly to your phone's notification panel.

Adding a Google Coral TPU (Optional but Recommended)

CPU-based object detection works on a Pi 5, but it uses significant processing power and limits you to about 5 FPS detection across all cameras. A Google Coral USB Accelerator ($35-60) offloads AI inference to dedicated hardware.

With a Coral TPU:

  • Detection runs at 100+ FPS
  • CPU usage drops dramatically
  • You can run more cameras simultaneously
  • Detection accuracy improves

Update your Frigate config to use the Coral:

detectors:
  coral:
    type: edgetpu
    device: usb

This is the single best upgrade you can make to a Pi-based Frigate system.

Storage Calculations

How much storage do you need? It depends on recording mode and camera count:

  • Motion-only recording, 2 cameras: ~5-10 GB/day → 1TB lasts 100-200 days
  • 24/7 recording, 2 cameras at 1080p: ~40-60 GB/day → 1TB lasts 17-25 days
  • 24/7 recording, 4 cameras at 1080p: ~80-120 GB/day → 1TB lasts 8-12 days

Frigate automatically manages storage — it deletes the oldest recordings when the drive fills up, maintaining your configured retention period. A 1TB drive with motion-only recording on 2-3 cameras gives you 2-4 weeks of history, which is plenty for home security.

Remote Access (Without Port Forwarding)

You want to check your cameras from work or vacation. Do not open ports on your router. Instead, use Tailscale — a zero-config VPN that creates a secure private network between your devices.

  1. Install Tailscale on your Pi: curl -fsSL https://tailscale.com/install.sh | sh
  2. Install Tailscale on your phone
  3. Authenticate both devices with the same account
  4. Access Frigate at http://[pi-tailscale-ip]:5000 from anywhere

Tailscale is free for personal use (up to 100 devices) and requires zero networking knowledge. Your camera feeds are encrypted end-to-end and never pass through a third-party cloud.

Integrating with Home Assistant

If you're running Home Assistant (and if you're reading SmartHomeMade, you probably are or should be), Frigate integrates beautifully:

  • Live camera feeds on your dashboard
  • Automation triggers based on detected objects ("turn on porch light when a person is detected after sunset")
  • Notification blueprints that send snapshot images to your phone
  • Timeline view showing all events across cameras

The Frigate integration for Home Assistant installs through HACS and takes about 5 minutes to configure.

Cost Comparison: DIY vs Commercial

DIY (Raspberry Pi + Frigate) Ring Alarm Pro + Cameras Arlo Pro 5
Upfront cost ~$150 + cameras $350 + cameras $200-600 for cameras
Monthly fee $0 $20/month $13-18/month
Year 1 total ~$300 (with 2 cameras) $590+ $350-800
Year 3 total ~$300 $1,070+ $680-1,400
Local storage ✅ (limited) ❌ (cloud only)
No internet required
Object detection ✅ (with Coral)
Custom automation ✅ (unlimited) Limited Limited

By year 3, the DIY system has saved $770-1,100 compared to commercial alternatives. And it keeps saving every month after that.

Potential Issues and Troubleshooting

USB camera not detected: Check ls /dev/video* to see available video devices. USB cameras on Linux sometimes enumerate as /dev/video0 and /dev/video1 (one for video, one for metadata).

RTSP stream won't connect: Verify the RTSP URL by testing it in VLC on another computer first. Some cameras require authentication in the URL: rtsp://username:password@192.168.1.100:554/stream1.

High CPU usage: Reduce detection FPS to 3, lower the detection resolution, or add a Coral TPU.

Motion false positives: Adjust Frigate's motion threshold settings, add motion masks for areas with constant movement (trees, roads), and rely on object detection filtering rather than raw motion.

SD card corruption: This is why we record to a USB SSD, not the microSD card. SD cards have limited write cycles and will fail under constant recording workloads. If your OS card corrupts, reflash it — your recordings are safe on the SSD.

The Bottom Line

A Raspberry Pi security system with Frigate gives you everything commercial systems offer — motion detection, object recognition, push notifications, remote viewing — without the monthly fee. It requires more setup effort upfront, but the result is a system you fully control, with footage that never touches anyone else's servers.

If you've already invested in a smart home ecosystem (especially Home Assistant), Frigate on a Pi is the obvious choice for cameras. And if you're coming from Ring or Arlo, you'll wonder why you ever paid $20/month for something you can run yourself for free.


Products mentioned in this article are available on Amazon. As an Amazon Associate, we earn from qualifying purchases.

Shop the products:

Published on

All Articles

Comments