Table of Contents
overview
In this tutorial, you will learn how to create an IOT-based car parking space monitoring system using Arduino, Nodemcu esp8266 wifi module and the Blynk app. With the help of the Nodemcu esp8266 wifi module and the Blynk app, parking spaces can be monitored from anywhere in the world. In this tutorial, we can monitor the parking slots empty or full by using the IR module.
Bill of Materials
S.No | COMPONENTS NAME | QUANTITY | Purchase link |
1 | Esp8266 | 1 | ESP8266 Nodemcu |
2 | Ir sensor | 1 | IR Proximity Sensor |
3 | Connecting Wires | 25 | Jumper Wires |
4 | Breadboard | 1 | Bread Board |
Block diagram
Esp8266 pinout
IR sensor pinout
Programming Code Explanation
The complete code for monitoring the intelligent parking system using Blynk App and ESP8266. Include all the required libraries for ESP8266 and Blynk App in the code, as shown below:
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
Enter the Auth Token in the code, which you can get from the Blynk App or the mail you received from Blynk.
char auth[ ] = "YourAuthToken";
example : “TRZhGbb6BRToVVw57N_h8RDiqtNf-O6X”
To connect with WIFI enter your SSID name and password
char ssid[ ] = "YourNetworkName";
char pass[ ] = "YourPassword";
Example :
char ssid[] = "MEVIHUB";
char pass[] = "12345678";
Final code
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
char auth[] = "TRZhGbb6BRToVVw57N_h8RDiqtNf-O6X";
char ssid[] = "MEVIHUB";
char pass[] = "12345678";
WidgetLED led1(V1);
WidgetLED led2(V2);
WidgetLED led3(V3);
WidgetLED led4(V4);
WidgetLED led5(V5);
//#define IR D0
#define Parking1_Slot_1 D1
#define Parking2_Slot_2 D2
#define Parking3_Slot_3 D3
#define Parking4_Slot_4 D4
bool ir,Parking1_Slot_1,Parking2_Slot_2,Parking3_Slot_3,Parking4_Slot_4;
void setup() {
Serial.begin(15200);
pinMode(D0, INPUT);
pinMode(Parking1_Slot_1, INPUT);
pinMode(Parking2_Slot_2, INPUT);
pinMode(Parking3_Slot_3, INPUT);
pinMode(Parking4_Slot_4, INPUT);
Blynk.begin(auth, ssid, pass);
}
void loop() {
ir = digitalRead(D0);
Parking1_Slot_1 = digitalRead(Parking1_Slot_1);
Parking2_Slot_2 = digitalRead(Parking2_Slot_2);
Parking3_Slot_3 = digitalRead(Parking3_Slot_3);
Parking4_Slot_4 = digitalRead(Parking4_Slot_4);
if(ir == 0)
{
led1.on();
}
else if (ir == 1)
{
led1.off();
}
if(Parking1_Slot_1 == 0)
{
led2.on();
}
else if (Parking1_Slot_1 == 1)
{
led2.off();
}
if(Parking2_Slot_2 == 0)
{
led3.on();
}
else if (Parking2_Slot_2 == 1)
{
led3.off();
}
if(Parking3_Slot_3 == 0)
{
led4.on();
}
else if (Parking3_Slot_3 == 1)
{
led4.off();
}
if(Parking4_Slot_4 == 0)
{
led5.on();
}
else if (Parking4_Slot_4 == 1)
{
led5.off();
}
Blynk.run();
}