Skip to content

Mchiir/FaceFollower

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FaceFollower

FaceTrackBot is a Python-Arduino project that uses OpenCV for real-time face detection and controls a 28BYJ-48 stepper motor via Arduino to keep a face centered.

Project Files

  • app.py - Main tracking + motor control
  • camera.py - Detects working camera index
  • sketch_oct30a.ino - Arduino stepper sketch
  • requirements.txt - Python dependencies

Setup

  1. Clone repo: git clone <repo_url>
  2. Create venv: python -m venv .venv and activate it
  3. Install dependencies: pip install -r requirements.txt

Arduino

  1. Open sketch_oct30a.ino in Arduino IDE
  2. Select board: Arduino Uno, select COM port
  3. Upload sketch and close Serial Monitor

Camera

  • Run camera.py to find working index (0 default)
  • Use index in app.py for cv2.VideoCapture()

Run

python app.py
  • Motor follows detected face horizontally
  • Press q to quit

Configurable Parameters

  • KP - Proportional gain (0.01-0.1)
  • DEADZONE - Pixel tolerance
  • MIN_ANGLE / MAX_ANGLE - Arduino stepper limits

Troubleshooting

  • Serial port error: Close Serial Monitor, check COM
  • Blank camera: Ensure no other app uses camera
  • Stepper not moving: Check wiring and pins

Author

Mugisha Chrispin | GitHub: Mchiir | MIT License

About

A Python-powered robot that never loses sight of you — real-time face tracking using OpenCV and Arduino!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors