BabyGuard is a Raspberry Piโpowered smart baby monitoring system built using FastAPI + WebRTC for ultra-low latency streaming.
โ Works over LAN + WAN
โ Designed for real-time monitoring + interaction
โ Lightweight, self-hosted, privacy-first
โ Can Control Infrared Devices
- Live camera feed (Pi Camera optional)
- Live microphone streaming (optional)
- WebRTC ultra-low latency
- Temperature & humidity monitoring
- Outside weather integration
- Push to TALK
- Media Player for child soothing
- White Noise for Sleep
- LED Indicator (via GPIO)
- Temp/Humid Sensor (via GPIO)
- Buzzer indicator (via GPIO)
- Microphone Support (via USB)
- Camera Module (via CSI Port)
- TSOP Receiver for IR Learning (via GPIO)
- IR Sender LED (via GPIO)
- CPU, RAM, disk, network stats
- Full Raspberry Pi health dashboard
- Video recording
- Playback interface
- Snapshot capture + gallery
- JWT Authentication
Mediaplayer & Snapshots Gallery
Wireguard Secure VPN & Caddy Reverse Proxy Config
- Client connects via domain โ Caddy (TLS termination)
- Caddy reverse proxies to backend
- WireGuard tunnel connects VPS โ Home network (Private Secure VPN)
- Raspberry Pi (behind NAT) streams via WebRTC
Note: All components are recommended for the best experience, but none are mandatory. If you omit a specific part (e.g., IR sender/receiver or mic/camera), only that specific functionality will be unavailable. Everything else will work seamlessly.
- LED Indicator wiring (GPIO pins)
- DHT22/DHT11 (Temp/Humidity) (GPIO pins)
- Piezo Buzzer (GPIO pins)
- Speakers integration (3.5mm Audio Jack)
- Microphone integration (USB port 2.0 or 3.0)
- Camera module (CSI camera port)
- TSOP IR Reciver sensor (GPIO pins)
- IR sender sensor (GPIO pins)
Automatic installation is recommended hence there are mnay steps involved installing system wide global packags and setting up proper boot service and other optimizations e.g. enabling/disabling other required hardware capablitities & features, the included setup.sh script takes care of this automatically.
git clone https://github.com/Zedstron/babymonitor
cd babymonitorsudo chmod +x setup.sh
sudo ./setup.shOr if automatic installation isn't working for you, or crashes or packages broken or any thing in general go wrong try following Manual minimal steps.
git clone https://github.com/Zedstron/babymonitor
cd babymonitorsudo apt update -y
sudo apt upgrade -ypython3 -m venv venv
source venv/bin/activateInstall Python Packages
pip install -r requirements.txtInstall System Deps:
sudo apt install -y $(cat packages.txt)Create the .env file with nano or any text editor of your choice and place following variables
JWT_SECRET="any alphanumeric strong random value for JWT"
WEATHER_API_KEY="optional key for current latest weahter"Note: Obtain a weather API key at https://home.openweathermap.org/users/sign_in just in case if you are interested in this feature
Generate certificates for https, since for PTT to work we cannot access microphone in browser from http, permission won't be allowed
mkdir cert
cd cert
openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -nodespython main.pyAn experimental Docker image is published to Docker Hub. This method is NOT Recommended for production and is provided for quick testing only.
Before running the container, ensure a .env file exists in the project root containing at minimum a JWT_SECRET. You may also include an optional WEATHER_API_KEY (if omitted, external weather won't be available). You can obtain a weather API key at https://home.openweathermap.org/users/sign_in
Pull the image from Docker Hub:
docker pull zedstron/babyguardExample run (reads variables from .env):
docker run --env-file .env -p 443:443 zedstron/babyguard- Cry detection (AI)
- Occupancy detection (Vision or Motion Sensor)
- Push notifications
- Facial emotions detection e.g. not feeling comfortable
- Baby heavy movement e.g. moving outside crib
- Converting FE side to React/Angular
PRs Welcom





