Zbotic Logo Zbotic Logo
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

  • Shop
  • About Us
  • Contact Us
  • Reseller
  • Blogs
020 69134444
1800 209 0998
[email protected]
Help Desk
Facebook Twitter Instagram Linkedin YouTube
Zbotic Logo Zbotic Logo
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

All departments
  • 3D Print Service
  • 3D Printer
  • Batteries & Chargers
  • Development Boards
  • Drone Parts
  • EBike parts
  • Sensor Modules
  • Electronic Components
  • Electronic Modules
  • IoT and Wireless
  • Mechanical Parts and Workbench Tools
  • Motors & Drivers & Pumps & Actuators
  • DIY and Robot Kits
  • Show more
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
Return to previous page
Home Student Projects & STEM Education

Smart Parking System: Ultrasonic Sensor Arduino Project

Smart Parking System: Ultrasonic Sensor Arduino Project

March 11, 2026 /Posted byJayesh Jain / 0

A smart parking system with Arduino and ultrasonic sensors is a practical IoT project that addresses one of urban India’s most persistent challenges. Cities like Mumbai, Bengaluru, Delhi, and Pune lose thousands of crores annually in productivity due to traffic congestion caused by drivers searching for parking. A smart parking system uses ultrasonic sensors to detect vehicle presence in each parking slot, displays availability in real-time, and can even guide drivers to the nearest free spot. This complete project guide covers everything from components to code.

Table of Contents

  • System Overview and Architecture
  • Components Required
  • Hardware Setup
  • Complete Arduino Code
  • Adding an LED Display Panel
  • IoT Upgrade with ESP8266
  • Frequently Asked Questions

System Overview and Architecture

The smart parking system works as follows:

  1. HC-SR04 ultrasonic sensors are mounted above each parking slot (or at the entrance of each slot at ground level)
  2. When a vehicle is present, the sensor measures a short distance (vehicle roof detected). When empty, it measures a longer distance (floor of the parking area)
  3. The Arduino reads all sensor data and updates an LED matrix or LCD display showing slot availability
  4. Entry/exit barriers (servo motors) can be controlled based on available spaces
  5. Optional: Wi-Fi module sends data to a mobile app or web dashboard for remote monitoring

Components Required

Component Quantity Cost (INR)
Arduino Uno or Mega 1 ₹350–600
HC-SR04 Ultrasonic Sensor 4–6 ₹40–80 each
16×2 LCD with I2C Module 1 ₹120–180
LEDs (Red + Green) 6–12 ₹5–10 each
SG90 Servo (for barrier) 1–2 ₹80–120
Resistors (220Ω for LEDs) 10+ ₹10–20 total
Breadboard + jumper wires 1 set ₹100–150
9V battery or DC adapter 1 ₹80–150

Total for 4-slot demo: ₹900–1,500

Recommended: 37-in-1 Sensor Kit Compatible with Arduino — Contains ultrasonic sensor modules and other components useful for the smart parking system. The 37-kit also includes IR sensors as an alternative detection method.

Hardware Setup

Sensor Placement

Mount HC-SR04 sensors vertically above each parking slot, facing downward. Typical mounting height: 2–2.5 metres above the floor (representing a parking structure sensor pole). Threshold for occupied detection: if measured distance < 150cm, slot is occupied. If ≥ 150cm, slot is free. Adjust threshold based on your model scale.

Wiring (4 Sensors + LCD)

  • Sensor 1: TRIG→Pin 2, ECHO→Pin 3
  • Sensor 2: TRIG→Pin 4, ECHO→Pin 5
  • Sensor 3: TRIG→Pin 6, ECHO→Pin 7
  • Sensor 4: TRIG→Pin 8, ECHO→Pin 9
  • Green LEDs: Pins 10, 11, 12, 13 (slot free indicator)
  • Red LEDs: Pins A0, A1, A2, A3 (slot occupied indicator)
  • LCD I2C: SDA→A4, SCL→A5
  • Servo: Pin 3 (entry barrier)

Complete Arduino Code

// Smart Parking System - Arduino Project
// Monitors 4 parking slots with ultrasonic sensors
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <Servo.h>

LiquidCrystal_I2C lcd(0x27, 16, 2);
Servo entryBarrier;

// Sensor pins [TRIG, ECHO] for 4 slots
const int TRIG[] = {2, 4, 6, 8};
const int ECHO[] = {3, 5, 7, 9};

// LED pins [Green=free, Red=occupied]
const int GREEN_LED[] = {10, 11, 12, 13};
const int RED_LED[]   = {A0, A1, A2, A3};

const int OCCUPIED_THRESHOLD = 100; // cm - below this = car present
const int NUM_SLOTS = 4;

bool slotStatus[NUM_SLOTS]; // true = occupied

long getDistance(int trigPin, int echoPin) {
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);
  
  long duration = pulseIn(echoPin, HIGH, 30000); // 30ms timeout
  return duration * 0.034 / 2; // Convert to cm
}

void setup() {
  for(int i = 0; i < NUM_SLOTS; i++) {
    pinMode(TRIG[i], OUTPUT);
    pinMode(ECHO[i], INPUT);
    pinMode(GREEN_LED[i], OUTPUT);
    pinMode(RED_LED[i], OUTPUT);
  }
  
  entryBarrier.attach(3);
  entryBarrier.write(0); // Closed position
  
  lcd.init();
  lcd.backlight();
  lcd.print("Smart Parking");
  lcd.setCursor(0, 1);
  lcd.print("Initialising...");
  delay(2000);
  
  Serial.begin(9600);
}

void loop() {
  int freeSlots = 0;
  
  for(int i = 0; i < NUM_SLOTS; i++) {
    long distance = getDistance(TRIG[i], ECHO[i]);
    slotStatus[i] = (distance > 0 && distance < OCCUPIED_THRESHOLD);
    
    // Update LEDs
    digitalWrite(GREEN_LED[i], slotStatus[i] ? LOW  : HIGH); // Green=free
    digitalWrite(RED_LED[i],   slotStatus[i] ? HIGH : LOW);  // Red=occupied
    
    if(!slotStatus[i]) freeSlots++;
    
    Serial.print("Slot "); Serial.print(i+1);
    Serial.print(": "); Serial.print(slotStatus[i] ? "OCCUPIED" : "FREE");
    Serial.print(" ("); Serial.print(distance); Serial.print("cm) | ");
  }
  Serial.println();
  
  // Update LCD display
  lcd.clear();
  lcd.print("Free: ");
  lcd.print(freeSlots);
  lcd.print("/");
  lcd.print(NUM_SLOTS);
  lcd.setCursor(0, 1);
  
  // Show individual slot status
  for(int i = 0; i < NUM_SLOTS; i++) {
    lcd.print(slotStatus[i] ? "X" : "O"); // X=occupied, O=open
    lcd.print(" ");
  }
  
  // Control entry barrier
  if(freeSlots > 0) {
    entryBarrier.write(90); // Open barrier
  } else {
    entryBarrier.write(0);  // Close barrier (parking full)
  }
  
  delay(500); // Update every 500ms
}
Recommended: Arduino Uno R3 Beginners Kit — Includes the Arduino Uno and essential components to start the smart parking project. Add HC-SR04 sensors and LEDs from the sensor kit to complete the build.

Adding an LED Display Panel

For a more visual exhibition display, create an LED matrix representation of the parking lot on a cardboard or foam board:

  • Draw parking slot outlines with a marker
  • Mount green and red LEDs in each slot outline
  • Add a lane for vehicles to enter/exit
  • Mount a servo-controlled barrier at the entrance
  • Place model toy cars in occupied slots for visual clarity

This physical representation makes the system immediately understandable to exhibition visitors — a key factor in winning competitions.

IoT Upgrade with ESP8266

Replace the Arduino Uno with a NodeMCU ESP8266 or add an ESP8266 as a Wi-Fi gateway to send parking data to the cloud:

// ESP8266 add-on: Send parking data to ThingSpeak
#include <ESP8266WiFi.h>

void sendToCloud(int freeSlots, bool* slotData) {
  WiFiClient client;
  if(client.connect("api.thingspeak.com", 80)) {
    String postStr = "api_key=YOUR_API_KEY";
    postStr += "&field1=" + String(freeSlots);
    for(int i = 0; i < 4; i++) {
      postStr += "&field" + String(i+2) + "=" + String(slotData[i] ? 1 : 0);
    }
    
    client.print("POST /update HTTP/1.1n");
    client.print("Host: api.thingspeak.comn");
    client.print("Content-Type: application/x-www-form-urlencodedn");
    client.print("Content-Length: " + String(postStr.length()) + "nn");
    client.print(postStr);
  }
  client.stop();
}

With this upgrade, a mobile app or web browser can show real-time parking availability from anywhere — transforming the project from a local demonstration to a realistic smart city solution.

Recommended: Arduino Starter Kit with 170 Pages Project Book — The project book provides a strong foundation in sensor interfacing and display output that prepares students for the smart parking system build.

Frequently Asked Questions

How accurate is the HC-SR04 sensor for vehicle detection in a real parking lot?

HC-SR04 has a rated range of 2cm–400cm with ±3mm accuracy. For vehicle detection at 200–250cm mounting height, this is highly reliable in indoor parking structures. Outdoor use requires protection from direct sunlight (which can interfere with the ultrasonic signal) and rain. Industrial IR sensors (photoelectric type) are more reliable outdoors but cost more.

Can this system scale to a real 500-slot parking garage?

The Arduino version is a prototype demonstration. A real 500-slot system would use industrial IoT sensors (inductive loop detectors or magnetic sensors embedded in the floor), industrial PLCs or Raspberry Pi clusters, LoRa or Ethernet communication, and a commercial parking management software platform. Your Arduino prototype demonstrates the same core concept at a 1:100 scale.

What is the maximum number of parking slots one Arduino Uno can monitor?

An Arduino Uno has 6 PWM digital and 14 digital pins total. Each HC-SR04 sensor needs 2 pins, so 7 sensors maximum. With a multiplexer (like the CD74HC4067 16-channel analog/digital mux), you can expand to monitoring 30+ slots with one Arduino. Arduino Mega (54 digital pins) supports up to 27 sensors directly.

How does a smart parking system save energy and reduce pollution?

A study by INRIX found that 30% of urban traffic is drivers searching for parking. Real-time parking guidance eliminates this “parking cruising” — reducing fuel consumption, vehicle emissions, and road congestion. For a 500-slot parking facility, smart parking can reduce entry-related traffic by 20–30%, with corresponding emissions reduction. This is the key sustainability argument for your project presentation.

Shop Arduino & Sensor Kits at Zbotic →

Tags: HC-SR04 Arduino, IoT parking system, smart city Arduino project India, smart parking system Arduino, ultrasonic sensor project
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
CAT5e vs CAT6 vs CAT6A Etherne...
blog cat5e vs cat6 vs cat6a ethernet cable speed and distance 598502
blog how to use bench power supply for arduino and esp32 projects 598513
How to Use Bench Power Supply ...

Related posts

Svg%3E
Read more

CubeSat Kit: Satellite Building for Education

April 1, 2026 0
The cubesat kit is one of the most exciting STEM projects you can take on in India today. Whether you... Continue reading
Svg%3E
Read more

Weather Balloon: High-Altitude Data Collection

April 1, 2026 0
The weather balloon is one of the most exciting STEM projects you can take on in India today. Whether you... Continue reading
Svg%3E
Read more

Automatic Irrigation: Multi-Zone Watering Controller

April 1, 2026 0
The automatic irrigation is one of the most exciting STEM projects you can take on in India today. Whether you... Continue reading
Svg%3E
Read more

Smart Weighbridge: Load Cell Industrial Scale

April 1, 2026 0
The smart weighbridge is one of the most exciting STEM projects you can take on in India today. Whether you... Continue reading
Svg%3E
Read more

Vending Machine: Arduino Coin and Product Dispenser

April 1, 2026 0
The vending machine is one of the most exciting STEM projects you can take on in India today. Whether you... Continue reading

Add comment Cancel reply

Your email address will not be published. Required fields are marked

Facebook Twitter Instagram Pinterest Linkedin Youtube

Get the latest deals and more.

Download on Google Play Download on the App Store

Call us: 020 69134444 / 1800 209 0998

Monday - Saturday 09:30 AM - 06:00 PM
For Technical Supports Email: [email protected]
For Sales / Enquiries Email: [email protected]

  • My Account

    • Cart

    • Wishlist

    • Checkout

    • My Orders

    • Track Order

    • My Account

  • Information

    • FAQs

    • Blogs

    • Career

    • About Us

    • Contact Us

    • Payment Options

  • Policies

    • Privacy Policy

    • Terms & Conditions

    • GST Input Tax Credit

    • Shipping Return Policy

    • E-Waste Collection Points

    • Our Sitemap

© Zbotic.in is registered trademark of Moxie Supply Pvt Ltd – All Rights Reserved
Login
Use Phone Number
Use Email Address
Not a member yet? Register Now
Reset Password
Use Phone Number
Use Email Address
Register
Already a member? Login Now