Number plate recognition gate for campus vehicles
Security guards at college gates write vehicle numbers in a register by hand. A camera that reads Indian number plates, opens the barrier for registered vehicles and logs visitors saves time and keeps a searchable record.
- Parts
- ₹10,900
- Build
- 14 weeks
- Board
- Raspberry Pi 5
- Objectives
- 4
Block diagram
- IR vehicle sensorWakes the camera when a vehicle arrives
- Camera Module 3Photographs the plate
- Raspberry Pi 5Finds the plate and reads it
- Servo barrierOpens for registered vehicles
- Gate displayShows the number read
Objectives
- To locate the plate in an image with a trained detector.
- To read Indian plate characters with OCR and validate the format (for example TN 09 AB 1234).
- To open the barrier for registered vehicles and log every vehicle with a photo.
- To measure plate read accuracy on 100 photos in day and night light.
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
- IR obstacle sensor moduleReflective IR pair with LM393, 2 to 30 cm set by trimmer, digital out, sunlight can false-trigger₹40Buy
- MG996R metal gear servo9.4 kg·cm at 4.8 V, 0 to 180°, stall up to 2.5 A so give it its own 5 to 6 V supply₹350Buy
- 16×2 LCD with I²C backpackHD44780, PCF8574 at 0x27 or 0x3F, 5 V, contrast trimmer on the back₹220Buy
- LM2596 buck (servo 6 V)4 to 40 V in, 1.25 to 37 V out, up to 2 A continuous (3 A peak), about 85% efficient₹90Buy
- Model gate and printed plates₹300
Total about ₹10,900 at typical online prices. Tap a part for its pinout and datasheet notes.
Design calculations
A 50 cm plate at 3 m with a 66° lens at 1920 px width (frame ≈ 3.9 m) is about 250 px wide, so characters are about 20 px tall: enough for OCR.
At 10 km/h (2.8 m/s) a 1/1000 s exposure moves the plate 2.8 mm, sharp enough. Use a short exposure with extra light at night.
Regex: ^[A-Z]{2}[0-9]{1,2}[A-Z]{0,3}[0-9]{4}$ catches most OCR errors (for example O read as 0).
Pin map
| Signal | Pin or connection |
|---|---|
| Camera | CSI connector |
| IR vehicle sensor | GPIO 23 |
| Servo signal | GPIO 18 (hardware PWM), servo on 6 V buck |
| LCD SDA / SCL | GPIO 2 / 3 |
Firmware outline
- Wait for the IR sensor; take a burst of 3 photos.
- Run a YOLO plate detector (trained on Indian plates) and crop the best box.
- Clean the crop: grayscale, resize, threshold; run OCR (EasyOCR or Tesseract).
- Fix common confusions by position (letters vs digits) and check the regex.
- If the number is in the registered list, open the barrier; log number, time and photo to SQLite.
Test plan
| Test | Expected result |
|---|---|
| 100 printed plates, day light | Read accuracy |
| Same at night with lamp | Read accuracy |
| Unregistered number | Barrier stays closed, visitor logged |
| Two-wheeler plates (two lines) | Read and combined |
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.
Datasheets and sources to cite
- Raspberry Pi Camera Module 3 datasheet
- Central Motor Vehicles Rules 1989, rule 50 (plate format)
- Ultralytics YOLO documentation
About this project
How much does the number plate recognition gate for campus vehicles project cost?
About ₹10,900 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, IR obstacle sensor module, MG996R metal gear servo, 16×2 LCD with I²C backpack, LM2596 buck (servo 6 V), Model gate and printed plates.
How long does it take?
About 14 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; IR vehicle sensor on GPIO 23; Servo signal on GPIO 18 (hardware PWM), servo on 6 V buck. Worked calculations on this page: plate pixels, shutter speed, plate format check.
How do I test it?
100 printed plates, day light: Read accuracy. Same at night with lamp: Read accuracy. Unregistered number: Barrier stays closed, visitor logged. Two-wheeler plates (two lines): Read and combined.
What are the objectives?
To locate the plate in an image with a trained detector. To read Indian plate characters with OCR and validate the format (for example TN 09 AB 1234). To open the barrier for registered vehicles and log every vehicle with a photo. To measure plate read accuracy on 100 photos in day and night light.
