Professional Documents
Culture Documents
Page 1 of 9
Aim:
To design Intelligent Smart Parking System(Dynamic cost allocated) with WiFi module and feed
the data to the ThingSpeak
Components Required:
1. Arduino Uno-1
2. Relay SPDT-1
3. Resisters(different resistances)
4. RGB Led-1
5. Jumping wire
6. ESP8266 Module
7. LCD 16x2- 1
8. Micro Servo- 2
9. Ultrasonic Distance Sensor- 1
10. PIR Sensor- 1
11. NeoPixel Ring- 1
12. Tinkercad, ThingSpeak Platform
Procedure:
1. Design the circuit as shown below with above listed components
2. Now, we need to write the logic in the code section and have to execute. Here the cost of
parking is allocated dynamically and every time the LCD shows the parking cost/hour.
3. Next we need to test the design by entering the vehicles from Entry Gate and leaving the
vehicle from Exit Gate. The results are shown below at different scenario.
Page 2 of 9
Results:
Fig.2 When the vehicle enters the entry gate(dis.<50cm) then Entry Gate opens, free slots and charge is displayed
Page 3 of 9
• The cost is directly proportional to No. Of Vehicles parked. If the free slots are less then charge
would be high accordingly.
• We can also observe the free slots and parked slots over NeoPixel Ring. Each and every time
when ever a vehicle enters the data is saved in ThingSpeak in graph formate with costs.
Fig.3 When the vehicle leaves then Exit Gate opens and charge is displayed on LCD
Working:
• When the Ultra-Sonic sensor detects a vehicle, the entry gate opens, and after a certain amount
of time, the gate closes automatically. Similarly, at exit, the PIR Sensor detects movement and
opens the Exit Gate to allow vehicle movement.
• The cost is proportionate to the number of parked vehicles. If there are fewer free spots, the cost
will be higher.
• The data feed for the system is shown in the ThingSpeak as shown below figure.
Page 4 of 9
• Vehicles and Charges/Hour is shown, the as the no. of vehicles increases the charge
increases(since free slots becomes less, so will cost increases)
Conclusion:
We have successfully designed the Intelligent Smart Parking System(Dynamic cost allocated) with
WiFi module and feed the data to the ThingSpeak. This can be applied in real world scenario for
real time analytics of parking systems.
Page 5 of 9
Appendix:
Code for designed logic:
#include <LiquidCrystal.h>
#include <Adafruit_NeoPixel.h>
#include <Servo.h>
void setupESP8266(void) {
#define servopin 7
#define selectpin 8
#define pir 13
Servo myservo;
Page 6 of 9
int ledPin= 9;
int ledNo= 12;
char red=A0;
char green=A1;
int cars=0;
long readUltrasonicDistance(int triggerPin, int echoPin)
{
pinMode(triggerPin, OUTPUT); // Clear the trigger
digitalWrite(triggerPin, LOW);
delayMicroseconds(2);
// Sets the trigger pin to HIGH state for 10 microseconds
digitalWrite(triggerPin, HIGH);
delayMicroseconds(10);
digitalWrite(triggerPin, LOW);
pinMode(echoPin, INPUT);
// Reads the echo pin, and returns the sound wave travel time in microseconds
return 2*pulseIn(echoPin, HIGH);
}
strip.show();
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
Serial.begin(9600);
pinMode(red,OUTPUT);
pinMode(green,OUTPUT);
pinMode(ledPin, OUTPUT);
pinMode(selectpin, OUTPUT);
ringled(0);
myservo.attach(servopin);
myservo.write(0);
pinMode(pir,INPUT);
setupESP8266();
}
int price()
{
int free_slots = 12 - cars;
return 18 - free_slots;
}
void checkpwd()
{
delay(1000);
cars+=1;
Page 7 of 9
ringled(cars);
lcd.setCursor(0, 0);
lcd.print("Free Slots - "+String(12-cars));
delay(1000);
lcd.setCursor(0, 1);
lcd.print(String(price())+"$ /hour");
digitalWrite(selectpin, LOW);
for(int i=0;i<=90;i+=1)
{
myservo.write(i);
delay(50);
for(int i=90;i>=0;i-=1)
{
myservo.write(i);
delay(50);
int flag = 0;
void loop() {
lcd.setCursor(0, 0);
int cm = 0.01723 * readUltrasonicDistance(6,6);
Serial.println(cm);
digitalWrite(selectpin, HIGH);
for(int i=0;i<=90;i+=1)
{
myservo.write(i);
Page 8 of 9
delay(10);
}
for(int i=90;i>=0;i-=1)
{
myservo.write(i);
delay(10);
}
}
thingspeakWrite(cars, price());
}
Page 9 of 9