Arduino Smart Parking with IR Sensors, Servo Barrier and LCD
Level 58 · Park Here · 35 minutes
Build a four-space car park: detect arriving cars, lift the barrier and show how many spaces remain.

Preview the project free; a course seat is required to run and submit. No hardware kit needed.
Your project challenge
Run the simulation. Bring cars to the entry and exit sensors, then clear each sensor after the car passes. Count each car once. Show free spaces on the LCD. Keep the barrier open while an admitted car is underneath; close it 500 ms after both sensors clear.
Components you’ll use
- Arduino Uno
- IR Obstacle Sensor × 2
- SG90 Micro Servo
- LCD 16x2 Display
- Battery
What you’ll build
A car park with four spaces, a screen and a moving barrier. Use the sensor buttons to bring a car to the entrance or exit. Press again to let it pass.
How it works
Each infrared sensor sends LOW when it detects a car. The entrance uses one free space; the exit returns one. The LCD shows the spaces left. When none remain, it shows FULL and the next arriving car waits.
The key idea
Count an event once. A car waiting over a sensor is still one car. Remember whether you already admitted it. If another car leaves, admit the waiting car without asking it to move away first.
⚠ Watch out
Keep the barrier raised until both lanes clear, then wait 500 milliseconds before closing. Never let the count go below zero or above four. Share battery ground with the Arduino.
Make it yours: add a light for each parking space.
The interactive editor includes the wiring guide, code editor and simulation controls.