Build your own ultra-low latency baby monitor with Raspberry Pi, WebRTC streaming, and complete privacy control. No cloud, no subscriptions, just pure peace of mind.
BabyGuard is a self-hosted, privacy-first baby monitoring system built for Raspberry Pi 4. Unlike commercial baby monitors that rely on cloud services and monthly subscriptions, BabyGuard gives you complete control over your data and privacy.
Using cutting-edge WebRTC technology, it delivers ultra-low latency (< 200ms) video and audio streaming directly to your browser—no apps required. The system integrates with various sensors (temperature, humidity, motion) and hardware components (IR blasters, LEDs, buzzers) through GPIO pins.
Your data never leaves your network
One-time hardware cost, free software forever
Open source code you can modify and extend
Everything you need to monitor your little one with confidence and control
Peer-to-peer video/audio streaming with < 200ms latency. No server relay needed, direct browser-to-device connection using modern WebRTC protocols.
Real-time temperature and humidity tracking with DHT22/DHT11 sensors. Get alerts when conditions fall outside safe ranges.
Push-to-talk functionality lets you soothe your baby remotely. Built-in white noise and lullaby player for better sleep.
Control LEDs, buzzers, IR blasters, and other hardware components through Raspberry Pi's GPIO pins. Automate night lights and alerts.
JWT authentication, HTTPS encryption, cookie-based sessions, and secure WebSocket connections keep your feed private and protected.
External weather API integration shows outdoor conditions alongside indoor monitoring for complete environmental awareness.
Capture snapshots or record video clips in AVI format. Save precious moments or review important events with timestamp metadata.
Monitor CPU usage, memory, bandwidth, WiFi signal strength, and system temperature in real-time to ensure optimal performance.
Access from anywhere with WireGuard VPN and Caddy reverse proxy setup. Secure remote monitoring without exposing your device to the internet.
Understanding how the pieces fit together—from hardware sensors to browser streaming
Camera module, microphone, DHT sensors, IR receiver/transmitter, GPIO-controlled LEDs and buzzers. All physical components interface through Pi's GPIO pins and CSI/USB ports.
Python-based async web server handles HTTP requests, WebSocket connections, WebRTC signaling, sensor polling, and hardware control. Uses aiortc for WebRTC implementation.
Responsive web interface with HTML5/CSS3/JavaScript. WebRTC peer connection for media streaming, Socket.IO for real-time updates, and REST API for control commands.
Camera & mic capture raw audio/video data
WebRTC codecs compress & packetize streams
P2P connection streams data via SRTP
Browser decodes & renders in real-time
Modern, battle-tested technologies working together seamlessly
Modern Python web framework for building async APIs with automatic docs and type checking.
Real-time communication protocol for peer-to-peer audio/video streaming without plugins.
Bidirectional real-time communication for sensor data, notifications, and live updates.
Python library to control Raspberry Pi GPIO pins for sensors and actuators.
Powerful templating engine for rendering dynamic HTML pages server-side.
JSON Web Token implementation for secure, stateless authentication.
Lightweight database with ORM for storing settings, logs, and user data.
Modern web server with automatic HTTPS for secure reverse proxy setup.
Understanding the magic behind ultra-low latency peer-to-peer streaming
Browser and Raspberry Pi exchange SDP (Session Description Protocol) offers/answers and ICE candidates through WebSocket connection to establish P2P parameters.
STUN servers help discover public IP addresses. If direct connection fails (symmetric NAT), TURN server relays traffic (BabyGuard prefers direct P2P for lowest latency).
Once connected, video/audio streams flow directly via SRTP (Secure Real-time Transport Protocol) with end-to-end encryption—no server in the middle!
H.264 for video and Opus for audio provide optimal quality/latency balance. Hardware acceleration on Pi 4 ensures smooth encoding.
< 200ms vs 2-10 seconds for HLS/DASH. See your baby in real-time, not delayed.
DTLS-SRTP encrypts all media. No intermediaries can intercept your feed.
Native browser support. Works on Chrome, Firefox, Safari, Edge—no Flash or Java.
Everything you need to build your BabyGuard system
2GB+ RAM recommended
The brain of BabyGuard. Pi 4's quad-core CPU handles WebRTC encoding and sensor polling simultaneously with ease.
CSI or USB webcam
Raspberry Pi Camera Module v2 or any UVC-compatible USB webcam. 1080p@30fps recommended for smooth streaming.
Any USB mic or USB cam with mic
For two-way audio communication. Built-in mic on USB webcams works great, or use a dedicated USB microphone for better quality.
Temp & humidity
Digital temperature and humidity sensor connected to GPIO. More accurate than DHT11, perfect for nursery monitoring.
For GPIO connections
Essential for connecting sensors and components to GPIO pins without soldering. Male-to-female jumper wires recommended.
5V 3A USB-C
Official Raspberry Pi power supply or equivalent. Stable power is crucial for reliable operation and preventing SD card corruption.
Infrared LEDs for night vision illumination (850nm or 940nm)
Learn and replay IR codes from remotes for smart control
Audio alerts for temperature thresholds or motion detection
PWM-controlled ambient lighting with color customization
Get BabyGuard running in minutes with our automated setup script
Installs all dependencies
Configures system settings
Starts the application
Important: Always use HTTPS (not HTTP) to access the interface, otherwise browser security will block microphone access.
Access your BabyGuard from anywhere in the world—securely
Access BabyGuard from any device on your home WiFi network. Simple and secure—no internet connection required.
Find your Pi's IP address:
hostname -I
Access via browser:
https://192.168.1.100:8000
Set static IP (recommended):
Configure in router or /etc/dhcpcd.conf
Monitor from anywhere using WireGuard VPN + Caddy reverse proxy. Enterprise-grade security without exposing your Pi to the internet.
WireGuard VPN Setup
Create secure tunnel to home network
Caddy Reverse Proxy
Auto SSL certificates & domain routing
Port Forwarding (Minimal)
Only WireGuard port (UDP 51820)
Detailed WireGuard + Caddy configuration guide available in repository docs.
Change default credentials immediately. Use 16+ character passwords with mixed case, numbers, and symbols.
Keep Raspberry Pi OS and dependencies updated: sudo apt update && sudo apt upgrade
Enable UFW firewall. Only allow necessary ports (8000 for LAN, 51820 for WireGuard).
Place BabyGuard on isolated VLAN or guest network to limit lateral movement if compromised.
Regularly backup /etc, database files, and custom configurations to external storage.
Turn off SSH, VNC, or other services when not needed to reduce attack surface.
Exciting features coming soon to make BabyGuard even more powerful
Machine learning model to detect and classify baby cries, sending push notifications with cry type (hungry, tired, discomfort).
Computer vision algorithms to detect movement, track baby position, and alert if baby leaves crib or covers face.
Native mobile push notifications via Firebase Cloud Messaging (FCM) or Telegram bot integration for instant alerts.
Deep learning to detect baby's emotional state (happy, crying, sleeping) and provide insights on sleep patterns and mood trends.
Modern SPA frontend migration for better UX, offline support with PWA, and advanced features like multi-camera support and timeline scrubbing.
Join the privacy-first baby monitoring revolution. No subscriptions, no cloud, just peace of mind.