Back to projects

IoT

Smart Attendance System with Servo Movement

An IoT-based attendance system that uses facial recognition to record clock-in and clock-out activities. Two PIR sensors detect movement direction, while a servo motor automatically adjusts the camera orientation for better face capture.

Smart Attendance System with Servo Movement cover

Overview

The Smart Attendance System combines facial recognition and IoT technology to provide a contactless and automated attendance solution. It runs locally on a Raspberry Pi 4B and integrates a camera, 5-inch touchscreen display, two PIR sensors, an MG996R servo motor, voice feedback, and a Flask-based monitoring dashboard.

Problem

Traditional attendance methods can be inefficient, require physical contact, and remain vulnerable to proxy attendance or data manipulation. A static camera may also fail to capture faces properly when users approach from different directions, reducing recognition reliability.

Solution

The system recognizes registered users through a camera and allows attendance to be recorded manually or automatically as Clock In or Clock Out. Two PIR sensors detect entry and exit movement, while an MG996R servo motor adjusts the camera orientation toward the user. Attendance records are stored locally in daily CSV files and presented through a Flask-based web dashboard.

System Architecture

  1. Raspberry Pi 4B acts as the main processing unit
  2. PIR IN detects movement from the entrance direction
  3. PIR OUT detects movement from the exit direction
  4. The MG996R servo rotates the camera between 0 and 180 degrees
  5. The camera captures images for real-time face processing
  6. OpenCV and Haar Cascade perform face detection
  7. The KNN classifier matches detected faces with locally registered data
  8. Registered face samples are stored locally in Pickle files
  9. Attendance records are stored in daily CSV files
  10. The touchscreen displays recognition and attendance status
  11. The Flask dashboard reads and presents attendance records
  12. Text-to-speech provides immediate audio feedback
  13. LM2596 modules regulate power for the servo and supporting components
  14. The PAM8403 amplifier drives the audio speaker

Screenshots

Smart Attendance System with Servo Movement screenshot 1
Smart Attendance System with Servo Movement screenshot 2
Smart Attendance System with Servo Movement screenshot 3
Smart Attendance System with Servo Movement screenshot 4
Smart Attendance System with Servo Movement screenshot 5
Smart Attendance System with Servo Movement screenshot 6
Smart Attendance System with Servo Movement screenshot 7
Smart Attendance System with Servo Movement screenshot 8
Smart Attendance System with Servo Movement screenshot 9
Smart Attendance System with Servo Movement screenshot 10
Smart Attendance System with Servo Movement screenshot 11
Smart Attendance System with Servo Movement screenshot 12

Demo Video

YouTube demo preview

Challenges

  • Maintaining recognition accuracy under different lighting conditions
  • Optimizing computer vision performance for Raspberry Pi
  • Preventing duplicate or accidental attendance records
  • Synchronizing PIR sensor input with servo movement
  • Providing stable and separate power for the servo motor
  • Calibrating the servo movement between 0 and 180 degrees
  • Finding reliable camera angles for face detection
  • Protecting locally stored biometric information
  • Integrating hardware and software into a stable prototype

Future Improvements

  • Add liveness detection to prevent photo-based spoofing
  • Encrypt locally stored facial data
  • Add secure administrator authentication
  • Replace pixel-based KNN with facial embedding models
  • Add configurable work schedules and late-arrival detection
  • Improve clock-in and clock-out validation
  • Add automated backup and data recovery
  • Support PostgreSQL or MySQL database storage
  • Add employee and department management
  • Provide mobile-friendly monitoring and notifications
  • Add remote hardware health monitoring
  • Improve power management and battery backup support