← back

face detection doorcam using opencv

june 2022

overview

This project started because I kept missing my doorbell. So I decided to turn an old smartphone into a smart door camera that plays a bell sound on a remote speaker whenever it detects a human face.

The setup runs locally using Python and OpenCV — it captures video from the phone's camera, detects faces in real time, and triggers a sound alert when someone shows up at the door. The code runs right on Termux on an old Redmi phone, no server or internet needed.

how it works

The script uses OpenCV's CascadeClassifier with the haarcascade_frontalface_default.xml model to detect faces in every frame. Each detected face is highlighted with a rectangle, and a short bell sound plays instantly. The app keeps running until manually closed, making it a light, DIY smart doorbell setup.

requirements

future additions

file structure

face_detection/
├── detect_face.py
├── haarcascade_frontalface_default.xml
└── README.md
→ view on github