The main objective of this project is to simplify the parking system by connecting all the parking stations of any city or town via the internet and make the data accessible to the users. This helps the users to know the parking slot left in real time and also helps them to find the best closest parking station for them. This reduces the time consumption in finding the right parking station.
Also, this offers the users to check their amount that they have to give to the parking station.
Moreover, this technology does not need any extra cost to implement from the consumer end since nowadays almost all cars have FASTag. And this project also implements the same technology. Only the Government or the Companies need to spend initially to build the system to access the FASTag data, for vehicle identification and implement this on the Parking Stations.
Components Required
Arduino UNO R4 Wi-Fi - 1X
Arduino Nano - 3X
RC522 RFID - 3X
MG995 Servo Motor - 3X
IR Sensor - 6X
Buzzer - 3X
Red LED - 3X
Green LED - 3X
400 Pin Breadboard - 3X
Jumper Wires
Navigate to This YouTube Video for Full Demonstration of the Project
The idea is to use the FASTag system that is RFID's to build a parking ecosystem for a town or city using the Arduino UNO R4 Wi-Fi board.
The Arduino UNO R4 Wi-Fi board is send to me by DigiKey.
DigiKey is a global leader in cutting edge commerce distribution of electronic components and automation products worldwide. They provide more than 15 million components from over 2900 manufactures and supply worldwide with immediate shipments.
For demonstration of the Project, I have built three parking stations which are connected to the Parking Station Center or Host via I2C Protocol. This will send the parking slot data as well as the vehicle which entered the parking or exit the parking. Which will further be portrayed onto the Web Dashboard (local web server).
Parking Station Working
Each parking consists of two IR sensors on either side of the gate. The RFID sensor records the tag data of each vehicle. The servo motor acts as a gate that rotates from 0 to 90 degrees and vice versa. Now when any vehicle approaches the IR sensor outside the gate, then the RFID sensor check the vehicle tag. Now if the parking is full, it will give an indication. And if the parking has one or more slots left then it will verify if the Vehicle is registered or not. If it is registered then it will open the gate and send the data to the UNO R4 Wi-Fi. Otherwise, it will give the unconfirmed signal.
Building the Project
To build the Project first I had to build the parking stations separately. I made use of 400 pin breadboard to connect all the components. Later Connected the IR sensors with Male to Female jumpers.
Then I build the indicators using double sided PCB Prototype board, a buzzer, a red led and a green led for each of the three Indicators.
These indicators basically indicate the status of the parking, indicates if any vehicle is scanned or not and lastly indicate if the vehicle is registered or not. I the parking is full both the red and green led will turn on and the buzzer will turn on for 1500 milli seconds. If a vehicle is scanned then only the green led and the buzzer will turn on for 500 milli seconds and if any vehicle is unregistered then the red led and the buzzer turn on and off for 5 times with an interval of 500 milli seconds.
After this the parking stations look like this without the indicators.
And like this with the indicators.
Next, I took a plywood of dimensions 60cm x 40 cm. I marked the 20 cm and 40cm marks to roughly divide the ply into three equal sections. Then Positioned the three parking stations with hot glue.
Then I printed the road track design on A4 sheets and attached them using masking tape to make the project look classy. Then I used the wasted PCBs to put some heigh to the servo motors so that they don't touch the plywood. And finally connected the Arduino UNO R4 Wi-Fi board. And to improve the look of the project I have used some markers and highlighted the position pointers, parking slots and the parking stations.
Now let me explain how the Parking Station Tracker works. I have made 15 pointers (numbered 1 to 15). So the project consists of three parking stations at position 5, 10 and 15 respectively. Now the tracking system works by finding the nearest parking station, which is first priority. And secondly it checks if the parking station is full or not and according to that data the tracking system provides data to the user (Web dashboard).
Here just to show the parking stations I have used green dots and for the rest of the pointers I have used red dots.
This is how I design everything for the demonstration after connecting the parking stations with the UNO R4 Wi-Fi.
Each of the Parking Station look like this.
Circuit Diagram with Explanation
I have connected the IR sensors in digital pins 5 and 6 of Arduino Nano respectively. The buzzer is connected on digital pin 2 and the green led and the red led are connected in pins 3 and 4 respectively.
Now all the parking stations are connected to the UNO R4 Wi-Fi via the SCL, SDL and the common ground pins.
The complete circuit is using 5v. Here I have used 5v/ 4A power supply to power the three parking stations. The USB Hub is distributing the power among the three Parking Stations. To power the servo motor I have used a 5v/ 2A power supply. And the UNO R4 Wi-Fi is powered by a 5v/ 1A power supply.
This is how the final project looks like.
Code
Now let me explain the Arduino Codes one by one.
Parking Station Code
Firstly, initialized all the required libraries. Then declared all the global variables and the necessary pins.
The String array stores the vehicle tag details that I have scanned and registered.
Setup Function
The setup function Initializes serial communication, configures pin modes, and attaches the servo to the pin.
Looping Function
The loop function scans all the sensors and record data and call the other functions accordingly. Also, it evacuates the send variable that sends the data to the UNO R4 Wi-Fi.
Supporting Functions
The requestEvent function sends the data via I2C pins.
The unconfirmed, scan and full functions are the indication functions are are called by the loop function accordingly.
The getRFIDValue function receive the RFID data.
The findIndexof function finds the vehicle tag number if registered and returns -1 is not registered.
Parking Station Host Code
Firstly, initialized all the required libraries. Then added the Wi-Fi credentials declared all the global variables and the necessary pins.
Again, here the String array stores the vehicle tag details that I have scanned and registered.
The slot1, slot2 and slot3 stores the slot data, and the other variables are used for the calculation purposes except the VehicleInfo variable. The hour and minute variable are used to store the time in the arrays accordingly.
Setup Function
The setup function Initializes serial communication and begins the built-in RTC.
Looping Function
The loop part is establishing the Wi-Fi connection and then receiving data from each parking station. Then we build the basic web dashboard using HTML and added the three parking slot data, drop down menu, search bars and enter buttons. We also added my social media accounts on the top. This exchanges data to and from the UNO R4 Wi-Fi and the local web server.
Supporting Functions
We have the amount function that calculates the amount that a vehicle has to pay and the parking_point function that calculates the best parking station.
Lastly, we have the findIndexof function finds the vehicle tag number and the CalculateTimeDifference function that calculates the time difference.
Working Demonstration of the RFID Parking System: ParKIFY
After uploading the code to each of the Arduino Nano's the Parking Stations are ready.
Then I uploaded the code to the UNO R4 Wi-Fi board. Then I reset the board and waited for the system to connect to the network. After some time, it connected successfully and I get the Local IP address in the serial monitor. Copy that can paste in the web browser. The Web Dashboard opens.
That's how the Web dashboard look like.
I have attached all the supporting pictures of the project demonstration.
**Note I am not using any car model to demonstrate the project. I am just using the cards that is the vehicle tag to show.
Checking the Amount feature.
Check Amount by entering the vehicle tag details.
Parking Station Demonstration
Vehicle enters the Parking Station (the green led and the buzzer will turn on for 500 milli seconds).
Parking Station is full (both the red and green led will turn on and the buzzer will turn on for 1500 milli seconds).
Vehicle is not registered (the red led and the buzzer turn on and off for 5 times with an interval of 500 milli seconds).
Some more pictures for better understanding.
Click on the GitHub Image to view or download code