DIY Home Security System: Combining Raspberry Pi, ESP32 Sensors, and Flipper Zero
This project ties together three devices we've covered individually — a Raspberry Pi running Frigate for AI camera detection, ESP32 sensor nodes on doors and windows, and a Flipper Zero to actually test the security of what you've built — into one coherent home security system you fully own, with no subscription and no cloud dependency for the core functionality.
System Architecture
ComponentRole Raspberry Pi (Frigate)The brain — runs camera-based AI detection and central event logging. See our Frigate NVR guide for the base setup ESP32 sensor nodesDoor/window contact sensors reporting state changes over WiFi or LoRa to the Pi, filling the gap cameras can't cover well — a window opening in a room without camera coverage, for instance Home Assistant (on the Pi, or a separate instance)The integration layer — pulls together Frigate's detection events and ESP32 sensor states into one dashboard and automation engine Flipper ZeroYour own penetration testing tool, used after the system is built to verify it's actually secure — not a running component of the system itselfStep 1: Camera Layer
Start from our Frigate NVR guide for the base install and camera configuration. For a multi-entry security setup specifically, prioritize camera placement covering your actual entry points (front door, back door, garage) over broad yard coverage — entry point coverage gives you the most security value per camera.
Step 2: Door/Window Sensor Nodes
Build ESP32-based contact sensors for doors and windows not covered well by camera line-of-sight — side windows, basement entries, anywhere a camera can't practically watch. This uses the same reed-switch-plus-deep-sleep pattern from our mailbox notifier build, just applied to doors and windows instead of a mailbox, and reporting to your Home Assistant instance instead of a generic notification endpoint:
void sendSensorEvent(String location, bool isOpen) { HTTPClient http; http.begin("http://your-pi-ip:8123/api/webhook/door_sensor"); http.addHeader("Content-Type", "application/json"); String payload = "{\"location\":\"" + location + "\",\"open\":" + String(isOpen ? "true" : "false") + "}"; http.POST(payload); http.end(); }For nodes farther from WiFi range — a detached garage or shed — swap the WiFi reporting for the LoRa pattern from our LoRa sensor node guide instead, reporting through a LoRa gateway back to the same Home Assistant webhook.
Step 3: Tying It Together in Home Assistant
With Frigate's camera events and your ESP32 sensor nodes both feeding into Home Assistant, you can build automations that reason across both:
- Person detected at front door + door sensor still closed — likely just someone approaching (delivery, visitor), lower urgency notification
- Door/window sensor triggers with no corresponding person detection nearby — potentially more concerning (entry not through a monitored point, or at an unusual time), higher urgency notification
- Any entry sensor triggers while an "away" mode is active (set manually, or tied to phone presence detection) — immediate high-priority alert regardless of camera corroboration
This layered logic — combining camera AI detection with simple contact sensors — gives you meaningfully better signal than either system alone. Cameras alone miss non-visual entry points; contact sensors alone can't tell you if it's actually a person versus wind or a pet.
Step 4: Notification Routing
Route different event severities to different notification channels through Home Assistant's automation engine — a low-priority "package likely delivered" notification doesn't need to wake you up at 2am the way a genuine entry-point trigger during away-mode should. Most push notification integrations (mobile app notifications, Pushover, ntfy) support priority levels or distinct notification channels for exactly this kind of tiering.
Step 5: Test Your Own Security With the Flipper
Once the system is built, this is where the Flipper Zero comes in — not as a running part of the system, but as your tool for verifying it actually works as intended. A few things worth checking on your own setup:
- WiFi security — use the Flipper's WiFi tools (with a Marauder-equipped dev board, per our WiFi multi-tool guide) to confirm your home network isn't trivially accessible, since your entire sensor network depends on WiFi security as a foundation
- Physical access points — if you use any RFID/NFC access control as part of your broader home security (garage keypad, smart lock), verify it isn't vulnerable to the kind of cloning attacks covered in our RFID/NFC guide — some older/cheaper access control hardware is genuinely vulnerable to simple cloning
- Sub-GHz signals — if you have a garage door opener or gate remote using an older, unencrypted fixed-code protocol rather than rolling code, this is worth checking with the Flipper's Sub-GHz analysis tools, since fixed-code remotes are genuinely capturable and replayable by anyone with similar hardware
The point of this step isn't paranoia — it's that a home security system is only as strong as its weakest link, and the weakest link is very often not the camera/sensor system itself but an overlooked access point (old garage remote, weak WiFi password, cheap RFID lock) that the rest of the system doesn't cover at all.
Ongoing Maintenance
TaskFrequency Check sensor node battery levelsMonthly, or automate a low-battery alert through Home Assistant if your node firmware reports battery voltage Review Frigate false-positive rate, adjust zones/masksAs needed when you notice recurring false alerts Verify camera and sensor coverage after any physical changesWhenever you add furniture, landscaping, or anything that could newly obstruct a camera's view or a sensor's functionThe real value of building this yourself instead of buying a commercial system isn't just cost — it's that every layer is something you understand, can extend, and can genuinely verify the security of, rather than trusting a closed system and a company's changing subscription terms.
Related Guides
- Build a Wall-Mounted Maker Dashboard: Aggregating Your Print Farm, Security, and Home Server on One CYD Panel
- Running Frigate NVR on Raspberry Pi for Security Cameras
- Raspberry Pi Security Camera/NVR with Frigate
- Tying It Together: Pi + ESP32 + Flipper Home Automation Hub
- Scaling Up: A Multi-Node LoRa Sensor Network with a Raspberry Pi Gateway
- Build a Local AI Security Camera System with Frigate NVR on a Raspberry Pi
- Build a Driveway and Gate Camera with License Plate Recognition Using Raspberry Pi and Frigate
- How to Hack Wi-Fi and Bluetooth with the Flipper Zero and Wi-Fi Marauder