A versitile day/night security camera system using radar-based motion detection, UART/GPIO communication with a Raspberry Pi, and a machine-vision human detection pipeline that generates animated GIF alerts and sends them to Telegram.
YOLO was able to detect the correct amount of people reliably in ~5 seconds with optimization (tested up to four people)
SecCam is a hybrid hardware/software security system designed for continuous outdoor or indoor monitoring, even in low-light or no-light environments.
Updated recently using process groups to prioritize frame capture and minimize downtime.
Pipeline:
- Human radar sensor connected to an ESP32 via GPIO
- Serial UART connection to RaspberryPi3b+
- YOLO based machine-vision human detection
- GIF generation -> Telegram API alerts
SecCam is optimized for low power, low false positives, and real-time responsiveness.
- HMMD-MMWave-Sensor Buy
- ESP32 Dev Board (handles radar data) Buy
- UART Serial (Radar <-> ESP32)
- Raspberry-Pi3b+ (primary processing unit) Buy
- GPIO (power, triggers)
- Arducam 1080p night/day camera with automatic light detection Buy
- Python
- Bash
- C++ (ESP32 firmware)
- Ultralytics YOLOv8n
- RPi.GPIO
- fmpeg (camera + GIF generation)
- curl (Telegram API sending)
- Telegram Bot API
┌─────────────────────────┐
│ HMMD Radar Module │
└─────────┬───────────────┘
│ Module: (Radar) ──► (ESP32)
│ Data: TX ──► RX2
│ Power: 3V3 ──► 3V3
│ Ground: GND ──► GND
┌────┴───────┐
│ ESP32 │
└────┬───────┘
│ Module: (ESP32) ──► (Pi)
│ Data: GPIO23 ──► GPIO17
│ Power: VIN ───► 5V
│ Ground: GND ───► GND
┌─────────┴──────────────┐
│ Raspberry Pi 3B+ │
│ - Frame Capture │ USB ┌───────────────┐
│ - Human Detection ├─────────┤ Camera module │
│ - GIF Generation │ └───────────────┘
│ - Telegram API │
└─────────┬──────────────┘
│
▼
Smartphone Alerts
git clone https://github.com/MearlyAMortal/SecCam.git
cd SecCam
- Create virtual environment:
python3 -m venv ~/ml-env - Activate it:
source ~/ml-env/bin/activate - Install dependencies (Depenting on pi OS):
sudo apt install -y python3-pip ffmpeg curl pip install RPi.GPIO ultralytics - Set up directory
mkdir -p photos touch config.sh - Set up config.sh
config.sh
nano config.sh#!/bin/bash #Working directory export CONF_PARENT_DIR="should be .../SecCam" export CONF_VIRTUAL_ENV="should be .../ml-env/bin/activate" #Telegram export CONF_BOT_TOKEN="YOUR BOT TOKEN" export CONF_CHAT_ID="YOUR CHAT ID" #Child directories export CONF_PHOTOS_DIR="$CONF_PARENT_DIR/photos" export CONF_FRAMES_DIR="$CONF_PHOTOS_DIR/frames" export CONF_GIF_DIR="$CONF_PHOTOS_DIR/gifs" export CONF_LOG_DIR="$CONF_PARENT_DIR/log" #Scipts export CONF_SEND_SCRIPT="$CONF_PARENT_DIR/send.sh" - Edit permissions
chmod +x listen.sh send.sh vision.sh
Upload the firmware in SecCam/esp32_send.ino using Arduino IDE (ESP32 Dev Board, speed 115200).
Full guide to setup bot HERE
To start:
./listen.sh
To stop:
CTRL+c (SIGINT)
Can be found in the generated log directory. (12-12-25_12-12-25.txt) The files are generated using the start date and the end date is appended after program execution. Duplicate file names will not overwrite old ones and instead increment a number at the end. (12-12-25_12-12-25_2.txt)
This project is licensed under the MIT License. See the LICENSE file for details.
Contact me: GitHub profile

