# Smart Parking System Using IoT and OpenCV
## A Smarter and Easier Way to Park
Finding a parking space in busy areas can be difficult and time-consuming. Drivers often spend several minutes searching for an empty slot, which increases traffic, wastes fuel, and causes frustration.
Our **IoT and OpenCV-Based Smart Parking System** provides a simple, secure, and modern solution to this problem. It allows users to check parking availability, reserve a parking slot, make digital payments, and manage their complete parking activity through a mobile application.
The system combines IoT sensors, Arduino, OpenCV, Firebase, and a Flutter mobile application to create a smooth parking experience for both users and parking administrators.
## Real-Time Parking Availability
Each parking slot is monitored using an IR sensor connected to an Arduino microcontroller. The sensor detects whether a vehicle is present in the parking space.
When a vehicle enters or leaves a slot, the system automatically updates its status. Users can see this information in real time through the mobile application.
The application clearly shows whether a parking slot is:
* Available
* Occupied
* Reserved
This helps users find an empty parking space without driving around the parking area.
## Easy Sign-Up and Secure Login
Users can create an account through the mobile application by entering their required information. Firebase Authentication is used to provide a secure sign-up and login process.
Each user has a personal account where they can view their reservations, parking history, payment balance, bills, and other important information.
This system protects user data and connects every reservation and transaction to the correct account.
## Reserve a Parking Slot in Advance
The application allows users to reserve an available parking slot before reaching the parking location.
The user can open the app, check available slots, select a suitable parking space, and confirm the reservation. The selected slot is then marked as reserved so that another user cannot book it.
This feature saves time and gives users confidence that a parking space will be available when they arrive.
## OTP-Based Parking Verification
To improve security, the system uses OTP verification for reserved parking slots.
After making a reservation, the user receives a One-Time Password. When the user reaches the parking area, they enter the OTP into the system.
After successful verification, the gate or parking barrier opens automatically with the help of a servo motor. This ensures that only the authorized user can access the reserved parking space.
## Number Plate Detection Using OpenCV
The system uses OpenCV technology to detect and read vehicle number plates.
A camera captures the vehicle’s number plate when the car enters the parking area. The system processes the image and identifies the plate number.
Number plate detection helps the system:
* Identify registered vehicles
* Improve parking security
* Record vehicle entry and exit
* Verify user and vehicle information
* Maintain a digital parking history
This feature reduces manual checking and makes the parking process faster and more reliable.
## Automatic Parking Time and Billing
The smart parking system records the entry and exit time of every vehicle.
When a vehicle enters the parking area, the parking timer starts automatically. When the vehicle leaves, the system calculates the total parking duration.
The parking bill is created based on the amount of time the vehicle remained in the parking area. Users can view their parking time and bill through the mobile application.
This automatic billing process reduces human error and makes the payment system fair and transparent.
## Digital Payment and Coin System
The application provides a digital payment and credit-based system.
Users can upload their payment receipt through the app. After the administrator verifies the payment, credits or coins are added to the user’s account.
When the user completes a parking session, the required amount is automatically deducted from their account balance.
Through the application, users can check:
* Current balance
* Parking charges
* Payment history
* Previous transactions
* Total parking time
This contactless payment method is simple, quick, and convenient.
## Mobile Application for Users
The mobile application is developed using Flutter, which allows it to work on both Android and iOS devices.
Through the application, users can:
* Create an account and log in
* Check real-time parking availability
* Reserve a parking slot
* Receive and enter an OTP
* Add money or parking credits
* View parking duration
* Check and pay parking bills
* View reservation history
* Navigate to the parking location
* Manage their profile and vehicle details
The application is designed with a simple interface so users can easily access all important features.
## Admin Management System
The system also provides an admin interface for parking management.
Administrators can use the system to:
* Monitor all parking slots
* Check available, occupied, and reserved spaces
* Manage user accounts
* Approve parking reservations
* Verify payment receipts
* Add credits to user accounts
* View transaction records
* Monitor vehicle entry and exit
* Manage parking charges
* Check the overall status of the parking area
This allows the administrator to control the complete parking process from one platform.
## Firebase Real-Time Database
Firebase Realtime Database is used to store and manage parking information.
It stores data related to:
* User accounts
* Parking slot status
* Vehicle information
* Reservations
* Entry and exit time
* OTP verification
* Payments
* User balances
* Transaction history
When the status of a parking slot changes, Firebase instantly updates the information in the user and admin applications.
This real-time connection ensures that everyone sees accurate and updated parking information.
## Main Technologies Used
The Smart Parking System uses the following technologies:
* **IoT:** Connects sensors, hardware, and the mobile application.
* **IR Sensors:** Detect whether parking slots are empty or occupied.
* **Arduino:** Processes sensor data and controls hardware components.
* **OpenCV:** Detects and reads vehicle number plates.
* **Flutter:** Provides the mobile application for Android and iOS.
* **Firebase:** Manages authentication, cloud data, reservations, and payments.
* **Servo Motor:** Controls the parking gate or barrier.
* **OTP Verification:** Protects reserved parking slots from unauthorized access.
## Benefits of the Smart Parking System
This system provides many benefits for users and parking administrators.
It helps users save time by showing available parking spaces before they enter the parking area. It also reduces traffic congestion because drivers do not need to search manually for an empty slot.
The reservation feature guarantees a parking space, while OTP and number plate verification improve security. Automatic timing and billing make the payment process accurate and transparent.
For administrators, the system reduces manual work and provides complete control over parking spaces, users, reservations, payments, and vehicles.
## Future Improvements
The system can be improved further by adding artificial intelligence to predict parking demand during busy hours.
GPS and map services can also be improved to guide users directly to the nearest available parking space. Advanced number plate recognition, online payment gateways, notification systems, and stronger data security can make the system even more effective.
The platform can also be expanded to manage multiple parking locations across a city.
## Conclusion
The IoT and OpenCV-Based Smart Parking System is a complete solution for modern parking management.
It brings real-time parking detection, advance reservations, secure OTP access, number plate recognition, automatic billing, digital payments, and mobile application control into one system.
By reducing manual work and helping users find parking spaces quickly, the system provides a safer, faster, and more convenient parking experience. It can be used in shopping malls, universities, hospitals, offices, airports, residential buildings, and other busy locations.