uild Arduino Smart Parking System with LCD & Sensors

Arduino Smart Parking System

Arduino Smart Parking System
Global schematic



Are you tired of circling blocks looking for parking? Imagine a smart system that shows you instantly whether a spot is free. This Arduino Smart Parking System does exactly that—and more. It uses real sensors, an LCD screen, and servo gates to manage up to 8 parking spots automatically. Moreover, it’s perfect for students, makers, and smart city builders who want hands-on experience with real-world automation.

Best of all, you build it yourself with affordable parts. You’ll learn how to save Arduino pins using a 74HC165 shift register, control servos, read IR sensors, and display live status. Therefore, this project teaches core electronics and coding skills in one fun package.

Why Build an Arduino Smart Parking System?

Urban areas keep growing, but parking stays limited. As a result, smart parking solutions reduce traffic, save fuel, and cut frustration. Fortunately, Arduino makes it easy to prototype such systems at home or in the classroom.

Additionally, this Arduino Smart Parking System gives real-time feedback. You see which spots are open. You control entry and exit gates automatically. And you get visual alerts with LEDs. Consequently, it mirrors real commercial systems—but at a fraction of the cost.

Furthermore, it’s scalable. Start with 8 spots. Later, add more using extra shift registers. Hence, your learning grows with your project.

How the Arduino Smart Parking System Works

First, eight parking spot sensors detect if a car is present. Instead of using eight Arduino pins, they connect to a 74HC165 shift register. This chip reads all eight sensors using just three Arduino pins. Therefore, you save valuable I/O for other tasks.

Next, the Arduino checks how many spots are free. If at least one is open, the green LED turns on. Then, when a car approaches the entry gate, an IR sensor triggers the servo to open. After 500 milliseconds, the gate closes automatically.

On the other hand, if all spots are full, the red LED flashes. The entry gate stays shut. Meanwhile, the exit gate opens whenever a car leaves, thanks to a second IR sensor.

Finally, a 16x2 LCD shows live status. Each spot appears as “X” (occupied) or “Y” (free). For example:

1|2|3|4|5|6|7|8|
Y|X|Y|X|Y|Y|Y|X|

This clear layout lets users see availability at a glance—just like in real parking garages.

Hardware List for Your Smart Parking Build

You’ll need these components to build your own Arduino Smart Parking System. Most are common in starter kits. Also, many are available on Amazon or electronics stores.

  • 1 × Arduino Uno (or compatible like ELEGOO Uno)
  • 1 × 16x2 LCD display (with HD44780 controller)
  • 1 × 74HC165 8-bit shift register IC
  • 2 × IR obstacle sensors (for entry and exit)
  • 8 × parking spot sensors (IR, ultrasonic, or magnetic—any digital output)
  • 2 × servo motors (for gate control)
  • 1 × green LED + 1 × red LED
  • 2 × 220Ω resistors (for LEDs)
  • 8 × pull-down resistors (10kΩ recommended for sensors)
  • 1 × breadboard
  • 40+ jumper wires
  • 1 × USB cable (for programming)
  • Optional: 10kΩ potentiometer (for LCD contrast)

Note: ELEGOO and other Arduino-compatible boards work perfectly. They cost less and support the same code.

Wiring Your Arduino Smart Parking System

Wiring may seem complex, but it’s logical once you group components. Below are the key connections. Always double-check before powering on!

74HC165 Shift Register Connections

This chip reads all 8 parking sensors using minimal pins:

  • D0–D7 → 8 parking spot sensors (each with pull-down resistor)
  • SH/LD (Pin 1) → Arduino A1
  • CLK (Pin 2) → Arduino pin 3
  • SO (Pin 9) → Arduino pin 2
  • VCC → 5V, GND → GND

LCD Display Wiring

Use standard 4-bit mode to save pins:

  • RS → Pin 13
  • E → Pin 12
  • D4 → Pin 11
  • D5 → Pin 10
  • D6 → Pin 9
  • D7 → Pin 8
  • VO → Middle pin of 10kΩ potentiometer (for contrast)
  • VSS → GND, VDD → 5V, LED+ → 5V, LED- → GND

Sensor and Actuator Connections

  • Entry IR sensor → Pin 4
  • Exit IR sensor → Pin 5
  • Green LED → Pin 7 (with 220Ω resistor to GND)
  • Red LED → Pin 6 (with 220Ω resistor to GND)
  • Entry servo → Arduino A2
  • Exit servo → Arduino A3

Lastly, connect all GNDs together. This ensures a common reference voltage across all devices.

Arduino Code for Smart Parking Management

The code runs two main tasks: reading parking status and controlling gates. It uses the LiquidCrystal, Wire, and Servo libraries. All logic fits in one file for simplicity.

#include <Wire.h>
#include <LiquidCrystal.h>
#include <Servo.h>

// LCD pins
LiquidCrystal lcd(13, 12, 11, 10, 9, 8);

// 74HC165 pins
#define SH_LD A1 // Shift/Load Bar pin
#define CLK 3    // Clock pin
#define SO 2     // Serial Output pin

#define green 7  // Green LED for gate open
#define red 6    // Red LED for parking full

// IR sensors
#define ENTRY_SENSOR 4 // Entry sensor pin
#define EXIT_SENSOR 5  // Exit sensor pin

// Servo motors
Servo entryGateServo; // Servo for entry gate (A2)
Servo exitGateServo;  // Servo for exit gate (A3)

// Number of parking spots
const int NUM_SPOTS = 8;
bool spots[NUM_SPOTS]; // Parking spot statuses
int freeSpots = NUM_SPOTS; // Counter for free spots

void setup() {
  // LCD setup
  lcd.begin(16, 2);
  lcd.clear();

  // Servo setup
  entryGateServo.attach(A2);
  exitGateServo.attach(A3);
  entryGateServo.write(0); // Keep entry gate closed
  exitGateServo.write(0);  // Keep exit gate closed

  // 74HC165 control pins
  pinMode(SH_LD, OUTPUT);
  pinMode(CLK, OUTPUT);
  pinMode(SO, INPUT);
  pinMode(green, OUTPUT);
  pinMode(red, OUTPUT);
  digitalWrite(green, LOW);
  digitalWrite(red, LOW);
  digitalWrite(SH_LD, LOW);

  // IR sensors
  pinMode(ENTRY_SENSOR, INPUT);
  pinMode(EXIT_SENSOR, INPUT);

  Serial.begin(9600);
}

void loop() {
  // Read parking spot statuses
  readShiftRegister(spots);

  // Calculate the number of free spots
  freeSpots = 0;
  for (int i = 0; i < NUM_SPOTS; i++) {
    if (!spots[i]) {
      freeSpots++;
    }
  }

  // Handle entry
  if (digitalRead(ENTRY_SENSOR) == HIGH) {
    if (freeSpots > 0) {
      digitalWrite(green, HIGH);
      entryGateServo.write(90); // Open entry gate
      delay(500);
      entryGateServo.write(0);  // Close gate
      digitalWrite(green, LOW);
    } else {
      digitalWrite(red, HIGH);
      delay(500);
      digitalWrite(red, LOW);
    }
  }

  // Handle exit
  if (digitalRead(EXIT_SENSOR) == HIGH) {
    exitGateServo.write(90); // Open exit gate
    delay(500);
    exitGateServo.write(0);  // Close gate
  }

  // Update the LCD
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("1|2|3|4|5|6|7|8|");
  lcd.setCursor(0, 1);
  for (int i = 0; i < NUM_SPOTS; i++) {
    lcd.print(spots[i] ? "X|" : "Y|");
  }
  delay(500);
}

// Function to read the shift register
void readShiftRegister(bool ar[NUM_SPOTS]) {
  digitalWrite(SH_LD, LOW);
  delayMicroseconds(5);
  digitalWrite(SH_LD, HIGH);
  for (int i = 0; i < NUM_SPOTS; i++) {
    digitalWrite(CLK, LOW);
    delayMicroseconds(5);
    ar[i] = digitalRead(SO);
    digitalWrite(CLK, HIGH);
    delayMicroseconds(5);
  }
}

How the Code Functions

Arduino Smart Parking System passing car
Passing car


In setup(), the code initializes the LCD, servos, LEDs, and sensor pins. It also starts serial communication for debugging.

Then, in loop(), it reads all parking spots using readShiftRegister(). This function loads parallel data from the sensors and shifts it out bit by bit to the Arduino.

After counting free spots, the system checks the entry sensor. If free spots exist, it opens the gate briefly. Otherwise, it flashes the red LED. Similarly, the exit sensor always opens the exit gate.

Finally, the LCD refreshes every 500 ms to show current status. This ensures users always see up-to-date info.

Testing and Calibration Tips

Once wired and coded, test each part step by step. First, upload the code and open the Serial Monitor. Although this version doesn’t print to serial, you can add debug lines if needed.

Next, cover one parking sensor. The LCD should change from Y to X for that spot. Repeat for all eight to confirm readings.

Then, simulate a car at the entry. Wave your hand over the entry IR sensor. If spots are free, the green LED should light and the servo should move. If full, the red LED flashes.

Likewise, test the exit sensor. The gate should open regardless of spot count.

💡 Pro Tip: Adjust IR sensor sensitivity using their onboard potentiometer. Too sensitive? It triggers falsely. Not sensitive enough? It misses cars.

Real-World Applications and Upgrades

This Arduino Smart Parking System isn’t just a demo. In fact, it’s a working model for real use cases.

Parking Garages and Campuses

Install it in school parking lots, small offices, or apartment garages. It reduces congestion and guides drivers instantly.

Smart City Integration

Add a Wi-Fi module like ESP8266. Then, send spot data to a web dashboard or mobile app. Users can check availability before arriving.

Expand to 16, 24, or More Spots

Daisy-chain multiple 74HC165 chips. Connect Q7’ of the first to SO of the next. Then, update the code to read 16 or 24 bits. Thus, you scale the system with minimal extra pins.

Education and Robotics Clubs

This project teaches digital logic, sensors, actuators, and real-time control. Therefore, it’s ideal for STEM curricula or science fairs.

Frequently Asked Questions

Can I use Raspberry Pi instead of Arduino?

Yes! Raspberry Pi works well for IoT versions. However, Arduino handles real-time sensor reading better without an operating system delay. For best results, use Arduino for sensing and Pi for cloud reporting.

What sensors work for parking spots?

Use IR proximity sensors, ultrasonic sensors, pressure mats, or even magnetic reed switches. Just ensure they output a clean HIGH/LOW signal. Then, connect them to the 74HC165 inputs with pull-down resistors.

Why use a shift register?

Arduino Uno has limited digital pins. Reading 8 sensors directly would use 8 pins. With a 74HC165, you use only 3. This leaves room for LCD, servos, and more. Hence, shift registers are essential for scalable projects.

Final Thoughts on Building Your Own System

In summary, the Arduino Smart Parking System combines hardware and software into a practical, educational project. You learn I/O management, real-time control, and user interface design—all while solving a real-world problem.

Start small with 8 spots. Then, add Wi-Fi, cameras, or payment systems as your skills grow. Whether you’re a student, hobbyist, or engineer, this project opens doors to smarter automation.

So gather your parts, follow the wiring guide, upload the code, and watch your parking lot come to life!

Post a Comment

0 Comments