This project is an AI-powered safety system that performs real-time PPE (Personal Protective Equipment) detection, face recognition, and Arduino-controlled access using a stepper motor, LEDs, and a webcam. It's designed to ensure only authorized individuals wearing the required safety gear (helmet, mask, and vest) can enter a secure area — such as a lab, construction site, or industrial facility.
- ✅ Real-time person and PPE detection using a YOLOv8 model
- 🎥 Live webcam feed with bounding boxes and confidence scores
- 🧠 Face recognition for logging personnel identity
- 🎙️ Voice feedback using
pyttsx3 - 🔄 Arduino integration with:
- Green/Red LED indicators
- Stepper motor-controlled door/gate
- 📝 Excel log export of recognized persons and timestamps
- 🚫 Automatic denial if multiple people are detected simultaneously
- Arduino Uno (or compatible)
- 4-Wire Stepper Motor
- Green & Red LEDs
- Webcam
- USB cable (for Arduino)
- Breadboard & jumper wires
- Compatible PPE (Helmet, Mask, Vest) for detection model
- Python 3.8+
- Ultralytics YOLOv8
- OpenCV (
opencv-python) cvzonepyfirmatapyttsx3pandas,openpyxl- Custom YOLO model:
ppe.pt - Face Recognition Utility:
SimpleFacerec
PPE_Detection_Project/
├── PPEDetection-arduino.py # Main Python script
├── Images/ # Folder for known face images
├── ppe.pt # Trained YOLOv8 model for PPE
├── recognition_log.xlsx # Auto-generated log file
├── simple_facerec.py # Face recognition utility
└── README.md
pip install ultralytics opencv-python cvzone pyfirmata pyttsx3 pandas openpyxlOpen Arduino IDE → Tools → Board: Arduino Uno → Upload StandardFirmata from Examples.
python PPEDetection-arduino.pyThe system will prompt the first user to enter. Only one person is allowed at a time.
- Webcam captures live feed.
- YOLO model detects:
HardhatMaskSafety Vest
- Face is recognized using
SimpleFacerec. - If only one person is present and all PPE are worn:
- 🔊 "Access granted"
- ✅ Green LED lights up
- 🔁 Stepper motor rotates to open the door
- Otherwise:
- ❌ Red LED is lit
- 🔊 "Only one person allowed" or PPE warning
- Real-time display with annotated detections
- Audio feedback
- Logged entries:
| Name | Time |
|------------|---------------------|
| John Doe | 2025-06-01 09:31:15 |
- Add authorized face images in
Images/folder. - Modify detection classes or confidence threshold in code.
- Replace
ppe.ptwith an updated or more specialized model.
This project is licensed under the MIT License.
Developed by Rayan Ali Tlais
GitHub: ryn2004t(https://github.com/ryn2004t)
Email: [tlsryn2@gmail.com]
Pull requests, improvements, and suggestions are welcome!