Concept & Inspiration: This project serves as a functional prototype of an automated parking gate system, directly inspired by the gate mechanism at the Soldiers and Sailors Garage where I parked daily during my university studies. Fascinated by the precise coordination of sensors and actuators required for secure vehicle entry, I challenged myself to replicate and improve upon this real-world system using embedded technology.
The Solution: The final prototype addresses the need for secure, efficient, and contactless vehicle management. Unlike simple manual gates, this system integrates an RFID-based authentication system with an automated mechanical gate. It features an interactive 16x2 LCD interface to prompt users, a servo-actuated gate arm, and an intelligent ultrasonic sensor loop that prevents the gate from closing until the vehicle has safely passed.
My Role (Solo Engineer): As an individual project, I was solely responsible for every phase of the engineering lifecycle:
Project Demonstration: Authentication Cycle & Safety Logic
The system is built around a standalone ATmega328P microcontroller. It features a dual-voltage power architecture to support mixed-signal components.
Moving from a breadboard prototype to a final product required a custom PCB design. The primary challenge was integrating the voltage regulation directly onto the board to eliminate external power bricks and ensure a compact form factor.
The system is powered by a 9V source. I engineered a dual-regulator circuit directly on the PCB:
Designed in Altium Designer, the PCB features:
I wrote the firmware in C++ using the Arduino IDE. The logic relies on a state machine that handles card scanning, authentication, and safety checks before moving the gate. Below are sample snippets of the core logic I implemented.
void loop() { // 1. Check for new card presence if (!mfrc522.PICC_IsNewCardPresent()) return; if (!mfrc522.PICC_ReadCardSerial()) return; // 2. Read UID and Compare with Authorized Database String content = ""; for (byte i = 0; i < mfrc522.uid.size; i++) { content.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ")); content.concat(String(mfrc522.uid.uidByte[i], HEX)); } content.toUpperCase(); // 3. Determine Access State if (content.substring(1) == AUTHORIZED_UID) { grantAccess(); // Trigger Green LED, Servo Open, Success Tone } else { denyAccess(); // Trigger Red LED, Error Tone } }
void grantAccess() { lcd.clear(); lcd.print("Access Granted"); // 1. Open Gate servo.write(90); delay(2000); // 2. Safety Loop: Wait for vehicle to pass using Ultrasonic Sensor while (isObjectDetected()) { delay(100); // Hold gate open if car is detected } // 3. Close Gate after vehicle clears delay(1000); servo.write(0); resetSystem(); } bool isObjectDetected() { // Ultrasonic Logic: Trigger Pulse -> Echo Read digitalWrite(TRIG_PIN, LOW); delayMicroseconds(2); digitalWrite(TRIG_PIN, HIGH); delayMicroseconds(10); digitalWrite(TRIG_PIN, LOW); long duration = pulseIn(ECHO_PIN, HIGH); int distance = duration * 0.034 / 2; return (distance < 10); // Return TRUE if object is within 10cm }