Skip to main content
Version: FILS English

Barrier Access System

A simple barrier access system that lifts the barrier when a registered license plate is recognized.

info

Author: Logoviceanu Ana Lorena
GitHub Project Link: https://github.com/UPB-PMRust-Students/project-Ana0420

Description

An automated system for controlling access to an office building parking lot, using color-based license plate recognition. When a car approaches, its presence is detected using an ultrasonic sensor. If the license plate (represented by a specific color pattern) matches a registered entry stored on an SD card, the barrier lifts and a stoplight turns green. Otherwise, access is denied and the light remains red. The system only activates when a car is near.

Motivation

This project was chosen to combine embedded system knowledge, sensor integration, and Rust programming in a practical and realistic scenario. Automating a gate entrance simulates a real-world problem with simple yet scalable components. Using color instead of OCR keeps it simple and hardware-focused.

Architecture

Main Components: Proximity Detection: Ultrasonic sensor detects when a car is near. License Plate Identification: TCS34725 color sensor checks color blocks on the license plate. Access Control: List of accepted license plates stored on an SD card. Control Unit: Raspberry Pi Pico W running Rust, interpreting sensor input and sending commands. Output Mechanisms: Servo motor to raise/lower the barrier; RGB LED to show red/green light. Connections: Car detected by HC-SR04 → triggers the system. Color sensor (TCS34725) reads the plate colors. Pico W matches the color pattern against the list stored on the SD card. If matched: Servo motor (SG90) opens the barrier. RGB LED turns green. If not: Barrier stays closed. LED turns red. Idle: LED remains off unless a car is nearby.

block_schematic

Log

Week 5 - 11 May

During this week, I focused on the planning and preparation phase of the project. I created an initial, orientative KiCad schematic to visualize the overall hardware architecture and validate component compatibility. I also finalized the list of required components and purchased all the necessary modules and accessories. Additionally, I planned the functional flow of the project — outlining how each component will interact, how the license plate recognition logic will work using color patterns, and how the system will control the barrier and stoplight based on sensor input and SD card validation.

Week 12 - 18 May

This week, I completed the main hardware setup for the project. I placed and connected all required components on a breadboard based on their datasheets, ensuring correct wiring and functionality for each module. I also finalized the full KiCad schematic to reflect the actual hardware configuration. With this, the hardware part of the project is essentially finished, except for the physical model, which will be added later.

hardware1

hardware2

Week 19 - 25 May

Hardware

Raspberry Pi Pico W – Central microcontroller that runs the entire system TCS34725 Color Sensor – Detects and reads the color-based license plates HC-SR04 Ultrasonic Sensor – Detects incoming vehicles to trigger the system SG90 Servo Motor – Controls the barrier arm to allow or block entry RGB LED – Acts as a traffic light (green for entry, red for stop) SD Card Module – Stores the list of registered license plates (color codes) 220Ω Resistors – Current limiting for the RGB LED Breadboard & Jumper Wires – For building and connecting the circuit Voltage Divider (2 resistors) – Protects Pico from 5V echo signal of the ultrasonic sensor Optional Logic Level Shifter – Safely connects 5V devices to 3.3V Pico (if needed) External 5V Power Supply (optional) – For powering servo and 5V devices

Schematics

kicad_schematic

Bill of Materials

DeviceUsagePrice
Raspberry Pi Pico WThe main microcontroller that controls the system40 RON
TCS34725 Color SensorUsed to detect color-coded license plates22,05 RON
HC-SR04 Ultrasonic SensorDetects the presence of a vehicle5,56 RON
SG90 Servo MotorRaises and lowers the barrier11,12 RON
SD Card ModuleStores the list of registered license plates7,14 RON
Micro SD Card (≥1 GB)Storage medium for the license data[0]
BreadboardPrototyping the circuit, Jumper Wires, Voltage Divider, 220Ω Resistors, RGB LED, USB cable60 RON

Software

LibraryDescriptionUsage
embassyAsynchronous embedded framework for RustMain framework for async embedded control
embedded-halHardware abstraction layer for embedded systemsInterface standard for communicating with peripherals
tcs3472Driver for the TCS3472 color sensorReads the color-based license plates
hc-sr04Driver for the HC-SR04 ultrasonic sensorDetects vehicle presence to trigger system
servoServo motor controlMoves the barrier up/down
embedded-sdmmcFAT filesystem access on SD cardsReads license plate data stored on SD card
  1. raspberrypi
  2. embedded-hal
  3. ultrasonic sensor tutorial