Face recognition attendance with Raspberry Pi
RFID cards can be lent to friends. A camera at the classroom door that recognises faces marks attendance without anything to carry, and is a good first project in computer vision.
- Parts
- ₹11,328
- Build
- 14 weeks
- Board
- Raspberry Pi 5
- Objectives
- 5
Block diagram
- Camera Module 3Captures faces at the door
- Raspberry Pi 5Detects and recognises faces
- Web registerShows and exports attendance
- Buzzer and LEDConfirm each person
- Data loggerStores timestamped readings for analysis+
Objectives
- To detect faces in live video at 5 frames per second or more.
- To recognise enrolled students with over 90% accuracy in classroom light.
- To mark attendance once per period and export it as CSV.
- To measure accuracy, false matches and speed with 20 enrolled people.
- To log timestamped data and analyse it to support the conclusions with evidence.
Parts and specifications
- Raspberry Pi 5 (4 GB)Quad Cortex-A76 2.4 GHz, 4 GB RAM, two camera connectors, runs Python and OpenCV; needs a 5 V 5 A USB-C supply₹5,600Buy
- Raspberry Pi 5 27 W USB-C supply₹1,200
- Case with cooler and camera cable₹800
- DS3231 RTC moduleTemperature-compensated, ±2 ppm (about 1 minute a year), I²C 0x68, CR2032 backup₹150Buy
Total about ₹11,328 at typical online prices. Tap a part for its pinout and datasheet notes.
Design calculations
At 1.5 m with a 66° lens and 1280 px width, the frame covers about 1.95 m, so a 16 cm face is about 105 px wide, enough for recognition (aim for over 80 px).
Each face becomes a 128-number embedding. Accept a match when the Euclidean distance to the stored one is below about 0.5; lower is stricter.
Detection with HOG at 640 × 480 takes about 100 ms on a Pi 5, embedding about 150 ms per face, so about 4 faces a second.
Pin map
| Signal | Pin or connection |
|---|---|
| Camera | CSI connector (CAM0) |
| Buzzer | GPIO 17 |
| LED | GPIO 27 through 330 Ω |
| Network | Wi-Fi or Ethernet to show the register |
Firmware outline
- Enrol: take 10 photos of each student, compute embeddings and store the average with roll number.
- Capture frames at 640 × 480; detect faces; skip faces smaller than 80 px.
- Compute the embedding and find the nearest enrolled face; accept below the threshold.
- Require the same match in 3 frames before marking, to avoid single-frame errors.
- Mark once per period; beep; save to SQLite; Flask page shows the register and CSV export.
Test plan
| Test | Expected result |
|---|---|
| 20 enrolled students, room light | Accuracy over 90% |
| Unknown person | Not matched |
| Photo of an enrolled student on a phone | Note whether it is fooled (liveness is future work) |
| Same student walks past twice | Marked once |
These rows start your results table when you plan the project.
Viva practice
Say your answer out loud first, then check. The first 2 answers are free; Maker opens all 5.
Make it yours
One or two upgrades for a mini project, two to four for a major one.
Build these first
Datasheets and sources to cite
- Raspberry Pi Camera Module 3 datasheet
- Schroff, Kalenichenko and Philbin, FaceNet (2015)
- Digital Personal Data Protection Act 2023
About this project
How much does the face recognition attendance with raspberry pi project cost?
About ₹10,718 for the parts in the base list: Raspberry Pi 5 (4 GB), Raspberry Pi Camera Module 3, Raspberry Pi 5 27 W USB-C supply, 32 GB microSD card, Active buzzer 5 V, LED 5 mm green with 220 Ω, Case with cooler and camera cable.
How long does it take?
About 12 weeks for the base project, built on a Raspberry Pi 5. Each upgrade adds time.
Which branches is it suitable for?
Computer Science / IT (IoT, AI), Electronics and Communication, as a major project.
Which pins and design calculations does it use?
Camera on CSI connector (CAM0); Buzzer on GPIO 17; LED on GPIO 27 through 330 Ω. Worked calculations on this page: face size, matching threshold, speed.
How do I test it?
20 enrolled students, room light: Accuracy over 90%. Unknown person: Not matched. Photo of an enrolled student on a phone: Note whether it is fooled (liveness is future work). Same student walks past twice: Marked once.
What are the objectives?
To detect faces in live video at 5 frames per second or more. To recognise enrolled students with over 90% accuracy in classroom light. To mark attendance once per period and export it as CSV. To measure accuracy, false matches and speed with 20 enrolled people.
