You are on page 1of 17

11/27/2019 IOT based Car Parking System using Arduino and Nodemcu esp8266

This is Google's cache of https://www.electroniclinic.com/iot-based-car-parking-system-using-arduino-and-nodemcu-


esp8266/. It is a snapshot of the page as it appeared on 25 Nov 2019 13:37:20 GMT. The current page could have
changed in the meantime. Learn more.

Full version Text-only version View source


Tip: To quickly find your search term on this page, press Ctrl+F or ⌘ -F (Mac) and use the find bar.

Home
Privacy Policy
Disclaimer
DMCA
About Us
Contact Us
Sitemap
Advertise With Us

Search...

Menu

Articles
Arduino Projects
Advance Projects
Simple Projects
Arduino + vb.net Projects
Arduino + Image Processing
Arduino Robotic Projects
Arduino Wireless Projects
IOT Projects
Electronics Projects
Basic Electronics
Advance Electronics
Power Projects
Power Generation
Industrial Projects
Arduino Industrial Projects
PLC Projects
PLC and Scada Projects
raspberry pi projects
android
android app development

Pages
Home
Privacy Policy
Disclaimer
DMCA
About Us
Contact Us
Sitemap
Advertise With Us

Categories

Articles
Arduino Projects
Electronics Projects
Power Projects
webcache.googleusercontent.com/search?q=cache:https://www.electroniclinic.com/iot-based-car-parking-system-using-arduino-and-nodemcu-e… 1/17
11/27/2019 IOT based Car Parking System using Arduino and Nodemcu esp8266

Industrial Projects
raspberry pi projects
android

Arduino Projects

IOT based Car Parking System using Arduino and Nodemcu


esp8266
Engr Fahad — April 27, 2019 2 comments

(Last Updated On: October 26, 2019)

Table of Contents
Description:
The components and tools used in this project can be purchased from Amazon, the components Purchase
links are given below:
About the IR sensor Module:
About the Nodemcu ESP8266 WIFI Module:
Circuit Diagram:
Blynk Application of iot based car parking:
Programming of iot based car parking:
Arduino Programming:
Nodemcu esp8266 wifi module Programming of iot based car parking:
Watch Video Tutorial:

Description:
In this tutorial, you will learn how to make an IOT based Car Parking Slots monitoring system using
Arduino, Nodemcu esp8266 wifi module and Blynk application. With the help of Nodemcu esp8266 wifi
webcache.googleusercontent.com/search?q=cache:https://www.electroniclinic.com/iot-based-car-parking-system-using-arduino-and-nodemcu-e… 2/17
11/27/2019 IOT based Car Parking System using Arduino and Nodemcu esp8266

module and Blynk application, the parking slots can be monitored from anywhere around the world. In this
Tutorial, you will also learn how to use the tabs and led widgets in Blynk application.

The Parking Area is divided into two Parkings.

1. Parking 1
2. Parking 2

Each Parking has 3 Slots and every slot has one infrared sensor. So we have total of 6 infrared sensors.
Each sensor is used to detect the presence of Car in the Slot. These infrared sensors are connected with
the Arduino. So when a Car is parked in the slot, the Arduino sends a command to the Nodemcu esp8266
wifi module, then Nodemcu then sends the command to the Blynk application.

The components and tools used in this project can be purchased from Amazon, the
components Purchase links are given below:
Arduino Uno: https://amzn.to/2tVz1vu
Mega 2560: https://amzn.to/2ze1kdu
Infrared sensor: https://amzn.to/2Cw8Z6x
Nodemcu esp8266 wifi module: Best price: https://amzn.to/2NAvmiB
lm7805 Voltage Regulator: https://amzn.to/2IZEl5x
330-ohm resistors pack: https://amzn.to/2NtlAeh
female DC power jack socket: https://amzn.to/2KEo1gt
470 uf capacitors: https://amzn.to/2xDCOzf
5×7 cm vero board: https://amzn.to/2OHGbvn
female headers: https://amzn.to/2zqmtiJ
connection wires: https://amzn.to/2DpBuW7
Super Starter kit for Beginners: https://amzn.to/2KJvmKG
Jumper Wires: https://amzn.to/2KMoVXs
Bread Board: https://amzn.to/2MS4q8X
12v Adaptor: https://amzn.to/2Ntr6h1
PCB plate: https://amzn.to/2IUwpCt
Variable Supply: https://amzn.to/2MT4Qfj
Digital Multimeter: https://amzn.to/2Nvft9i
Vero Board / strip board: https://amzn.to/2MTf9jD
Soldering iron kit: “best” You guys should definitely purchase this: https://amzn.to/2zfoNuJ
Solder wire: https://amzn.to/2ufUMWf
Wire Stripper: https://amzn.to/2KOqxfU
wire cutter: https://amzn.to/2ucIq14
PCB small portable drill machine: https://amzn.to/2Nu62XF

*Please Note: These are affiliate links. I may make a commission if you buy the components through these
links. I would appreciate your support in this way!

About the IR sensor Module:

webcache.googleusercontent.com/search?q=cache:https://www.electroniclinic.com/iot-based-car-parking-system-using-arduino-and-nodemcu-e… 3/17
11/27/2019 IOT based Car Parking System using Arduino and Nodemcu esp8266

This is the IR sensor which I will be using for the cars detection. As you can see the three male headers
are clearly labeled with the VCC, GND, and OUT. The VCC pin is connected with the Arduino’s 5 volts. The
ground is connected with the Arduion’s ground. While the OUT pin is connected with Arduino’s IO pins.
which I will explain in the circuit diagram. While the black and white leds are the IR leds “one is the Tx while
the other one is the Rx”.

About the Nodemcu ESP8266 WIFI Module:

This is the Nodemcu ESP8266 wifi module, with the help of this module we can monitor the car parking
slots from anywhere around the world. As you can see clearly all the pins are clearly labeled. Never power
up the Nodemcu esp8266 wifi module using the Arduino’s 5 volts. If you power up this module using the

webcache.googleusercontent.com/search?q=cache:https://www.electroniclinic.com/iot-based-car-parking-system-using-arduino-and-nodemcu-e… 4/17
11/27/2019 IOT based Car Parking System using Arduino and Nodemcu esp8266

arduino’s 5 volt then this wifi module we will keep reseting. To solve this problem you can design a
separate power supply of this module using the LM7805 voltage regulator.

Circuit Diagram:

As you can see six infrared sensors are connected with the Arduino pins 4 to 9. The infrared sensor VCC
pins are connected with the Arduino’s 5v. Grounds are connected with the Arduino’s Ground while the out
pins of all the infrared sensors are connected with pin 4 to 9.

The Nodemcu module tx and Rx pins are connected with pin2 and pin3 of the Arduino. while the Vin pin of
the Nodemcu module is connected with the output of the voltage regulator. This is a regulated 5v power
supply based on the lm7805 voltage regulator.

Two 470uf capacitors are connected at the input and output side of the regulator. A 330-ohm resistor is
connected in series with a 2.5v led. This is a current limiting resistor. While J1 is a dc female socket, over
here you can connect a 12v adaptor or battery. But you can also power up the Nodemcu module using your
laptop USB port. I will be using two USB cables, I cable will be used for powering up the arduino and the
other usb cable will be used to power up the nodemcu.

Blynk Application of iot based car parking:


For the android or apple cell phone application designing you will need to download the Blynk application
from the App Store. After you download the Blynk application then you will need to register yourself for free
using Facebook or any other email id. The cell phone application making is explained in the video. The
video is available at the end of this Article.

Programming of iot based car parking:


In this project, two programs are used one for the Arduino and another one for the Nodemcu esp8266 wifi
module.

webcache.googleusercontent.com/search?q=cache:https://www.electroniclinic.com/iot-based-car-parking-system-using-arduino-and-nodemcu-e… 5/17
11/27/2019 IOT based Car Parking System using Arduino and Nodemcu esp8266

Arduino Programming:
Arduino Programming

#include

1 #include <SoftwareSerial.h>
2
3 SoftwareSerial nodemcu(2,3);
4
5 int parking1_slot1_ir_s = 4; // parking slot1 infrared sensor connected with pin number 4 of arduino
6 int parking1_slot2_ir_s = 5;
7 int parking1_slot3_ir_s = 6;
8
9 int parking2_slot1_ir_s = 7;
10 int parking2_slot2_ir_s = 8;
11 int parking2_slot3_ir_s = 9;
12
13 String sensor1;
14 String sensor2;
15 String sensor3;
16 String sensor4;
17 String sensor5;
18 String sensor6;
19
20
21 String cdata =""; // complete data, consisting of sensors values
22
23 void setup()
24 {
25 Serial.begin(9600);
26 nodemcu.begin(9600);
27
28 pinMode(parking1_slot1_ir_s, INPUT);
29 pinMode(parking1_slot2_ir_s, INPUT);
30 pinMode(parking1_slot3_ir_s, INPUT);
31
32 pinMode(parking2_slot1_ir_s, INPUT);
33 pinMode(parking2_slot2_ir_s, INPUT);
34 pinMode(parking2_slot3_ir_s, INPUT);
35
36
37 }
38
39 void loop()
40 {
41
42 p1slot1();
43 p1slot2();
44 p1slot3();
45
46 p2slot1();
47 p2slot2();
48 p2slot3();
49
50
51
52 cdata = cdata + sensor1 +"," + sensor2 + ","+ sensor3 +","+ sensor4 + "," + sensor5 + "," + sensor6 +","; // comma will be used a
53 delimeter
54 Serial.println(cdata);
55 nodemcu.println(cdata);
56 delay(6000); // 100 milli seconds
57 cdata = "";
58 digitalWrite(parking1_slot1_ir_s, HIGH);
59 digitalWrite(parking1_slot2_ir_s, HIGH);
60 digitalWrite(parking1_slot3_ir_s, HIGH);
61
62 digitalWrite(parking2_slot1_ir_s, HIGH);
63 digitalWrite(parking2_slot2_ir_s, HIGH);
64 digitalWrite(parking2_slot3_ir_s, HIGH);
65 }

webcache.googleusercontent.com/search?q=cache:https://www.electroniclinic.com/iot-based-car-parking-system-using-arduino-and-nodemcu-e… 6/17
11/27/2019 IOT based Car Parking System using Arduino and Nodemcu esp8266
66
67
68 void p1slot1() // parkng 1 slot1
69 {
70 if( digitalRead(parking1_slot1_ir_s) == LOW)
71 {
72 sensor1 = "255";
73 delay(200);
74 }
75 if( digitalRead(parking1_slot1_ir_s) == HIGH)
76 {
77 sensor1 = "0";
78 delay(200);
79 }
80
81 }
82
83 void p1slot2() // parking 1 slot2
84 {
85 if( digitalRead(parking1_slot2_ir_s) == LOW)
86 {
87 sensor2 = "255";
88 delay(200);
89 }
90 if( digitalRead(parking1_slot2_ir_s) == HIGH)
91 {
92 sensor2 = "0";
93 delay(200);
94 }
95 }
96
97
98 void p1slot3() // parking 1 slot3
99 {
100 if( digitalRead(parking1_slot3_ir_s) == LOW)
101 {
102 sensor3 = "255";
103 delay(200);
104 }
105 if( digitalRead(parking1_slot3_ir_s) == HIGH)
106 {
107 sensor3 = "0";
108 delay(200);
109 }
110 }
111
112
113 // now for parking 2
114
115 void p2slot1() // parking 1 slot3
116 {
117 if( digitalRead(parking2_slot1_ir_s) == LOW)
118 {
119 sensor4 = "255";
120 delay(200);
121 }
122 if( digitalRead(parking2_slot1_ir_s) == HIGH)
123 {
124 sensor4 = "0";
125 delay(200);
126 }
127 }
128
129
130 void p2slot2() // parking 1 slot3
131 {
132 if( digitalRead(parking2_slot2_ir_s) == LOW)
133 {
134 sensor5 = "255";
135 delay(200);
136 }
137 if( digitalRead(parking2_slot2_ir_s) == HIGH)
138 {

webcache.googleusercontent.com/search?q=cache:https://www.electroniclinic.com/iot-based-car-parking-system-using-arduino-and-nodemcu-e… 7/17
11/27/2019 IOT based Car Parking System using Arduino and Nodemcu esp8266
139 sensor5 = "0";
140 delay(200);
141 }
142 }
143
144
145 void p2slot3() // parking 1 slot3
146 {
147 if( digitalRead(parking2_slot3_ir_s) == LOW)
148 {
149 sensor6 = "255";
150 delay(200);
151 }
152 if( digitalRead(parking2_slot3_ir_s) == HIGH)
153 {
154 sensor6 = "0";
155 delay(200);
156 }
}

Nodemcu esp8266 wifi module Programming of iot based car parking:


nodemcu programming

#define
BLYNK_PRINT Serial

1 #define BLYNK_PRINT Serial


2
3
4 #include <ESP8266WiFi.h>
5 #include <BlynkSimpleEsp8266.h>
6 #include <SoftwareSerial.h>
7 #include <SimpleTimer.h>
8
9 char auth[] = "ac173b0527c94a91a6cde0dcdfe6bdef";
10
11 // Your WiFi credentials.
12 // Set password to "" for open networks.
13 char ssid[] = "ZONG MBB-E8231-6E63";
14 char pass[] = "08659650";
15
16 SimpleTimer timer;
17
18 String myString; // complete message from arduino, which consistors of snesors data
19 char rdata; // received charactors
20
21 int firstVal, secondVal,thirdVal; // sensors
22 int led1,led2,led3,led4,led5,led6;
23 // This function sends Arduino's up time every second to Virtual Pin (1).
24 // In the app, Widget's reading frequency should be set to PUSH. This means
25 // that you define how often to send data to Blynk App.
26 void myTimerEvent()
27 {
28 // You can send any value at any time.
29 // Please don't send more that 10 values per second.
30 Blynk.virtualWrite(V1, millis() / 1000);
31
32 }
33
34
35
36 void setup()
37 {
38 // Debug console
39 Serial.begin(9600);
40
41 Blynk.begin(auth, ssid, pass);
42
43 timer.setInterval(1000L,sensorvalue1);
webcache.googleusercontent.com/search?q=cache:https://www.electroniclinic.com/iot-based-car-parking-system-using-arduino-and-nodemcu-e… 8/17
11/27/2019 IOT based Car Parking System using Arduino and Nodemcu esp8266
44 timer.setInterval(1000L,sensorvalue2);
45 timer.setInterval(1000L,sensorvalue3);
46 timer.setInterval(1000L,sensorvalue4);
47 timer.setInterval(1000L,sensorvalue5);
48 timer.setInterval(1000L,sensorvalue6);
49
50
51 }
52
53 void loop()
54 {
55 if (Serial.available() == 0 )
56 {
57 Blynk.run();
58 timer.run(); // Initiates BlynkTimer
59 }
60
61 if (Serial.available() > 0 )
62 {
63 rdata = Serial.read();
64 myString = myString+ rdata;
65 // Serial.print(rdata);
66 if( rdata == '\n')
67 {
68 Serial.println(myString);
69 // Serial.println("fahad");
70 // new code
71 String l = getValue(myString, ',', 0);
72 String m = getValue(myString, ',', 1);
73 String n = getValue(myString, ',', 2);
74 String o = getValue(myString, ',', 3);
75 String p = getValue(myString, ',', 4);
76 String q = getValue(myString, ',', 5);
77
78
79 // these leds represents the leds used in Blynk application
80 led1 = l.toInt();
81 led2 = m.toInt();
82 led3 = n.toInt();
83 led4 = o.toInt();
84 led5 = p.toInt();
85 led6 = q.toInt();
86
87 myString = "";
88 // end new code
89 }
90 }
91
92 }
93
94 void sensorvalue1()
95 {
96 int sdata = led1;
97 // You can send any value at any time.
98 // Please don't send more that 10 values per second.
99 Blynk.virtualWrite(V10, sdata);
100
101 }
102 void sensorvalue2()
103 {
104 int sdata = led2;
105 // You can send any value at any time.
106 // Please don't send more that 10 values per second.
107 Blynk.virtualWrite(V11, sdata);
108
109 }
110
111 void sensorvalue3()
112 {
113 int sdata = led3;
114 // You can send any value at any time.
115 // Please don't send more that 10 values per second.
116 Blynk.virtualWrite(V12, sdata);

webcache.googleusercontent.com/search?q=cache:https://www.electroniclinic.com/iot-based-car-parking-system-using-arduino-and-nodemcu-e… 9/17
11/27/2019 IOT based Car Parking System using Arduino and Nodemcu esp8266
117
118 }
119
120 void sensorvalue4()
121 {
122 int sdata = led4;
123 // You can send any value at any time.
124 // Please don't send more that 10 values per second.
125 Blynk.virtualWrite(V13, sdata);
126
127 }
128
129 void sensorvalue5()
130 {
131 int sdata = led5;
132 // You can send any value at any time.
133 // Please don't send more that 10 values per second.
134 Blynk.virtualWrite(V14, sdata);
135
136 }
137
138 void sensorvalue6()
139 {
140 int sdata = led6;
141 // You can send any value at any time.
142 // Please don't send more that 10 values per second.
143 Blynk.virtualWrite(V15, sdata);
144
145 }
146
147
148
149
150
151
152 String getValue(String data, char separator, int index)
153 {
154 int found = 0;
155 int strIndex[] = { 0, -1 };
156 int maxIndex = data.length() - 1;
157
158 for (int i = 0; i <= maxIndex && found <= index; i++) {
159 if (data.charAt(i) == separator || i == maxIndex) {
160 found++;
161 strIndex[0] = strIndex[1] + 1;
162 strIndex[1] = (i == maxIndex) ? i+1 : i;
163 }
164 }
165 return found > index ? data.substring(strIndex[0], strIndex[1]) : "";
166 }

Watch Video Tutorial:

webcache.googleusercontent.com/search?q=cache:https://www.electroniclinic.com/iot-based-car-parking-system-using-arduino-and-nodemcu-… 10/17
11/27/2019 IOT based Car Parking System using Arduino and Nodemcu esp8266

Arduino Project: IOT Car Parking System using Nodemcu esp8266 wi + Blynk (Tabs…
(Tabs…

arduino esp8266 arduino iot car parking arduino nodemcu Blynk best Blynk Blynk car parking Blynk led
Blynk tab car car parking diy electronic clinic esp8266 esp8266 car parking iot iot car parking led nodemcu
nodemcu car parking parking programming system tabs using widgets widgets in Blynk wifi

Recommended For You

DIY IoT Weighing Scale using HX711 Load Cell, Nodemcu


ESP8266, & Arduino

webcache.googleusercontent.com/search?q=cache:https://www.electroniclinic.com/iot-based-car-parking-system-using-arduino-and-nodemcu-… 11/17
11/27/2019 IOT based Car Parking System using Arduino and Nodemcu esp8266

Remote Controlled Door Lock using Arduino & Electronic Lock

What is a Voltage Divider or Potential Divider, Formula and


Practical Uses?

Wall Climbing Robot Car using Arduino, Bluetooth & Android App
About the Author: Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site
engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel
"Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts *
Photography * Travelling * Make Sketches and so on...

2 Comments
1. shubham bhardwaj says:
May 2, 2019 at 2:24 am

Can the same thing be done on the thingspeak server instead of the app

Reply
2. faisal says:
May 5, 2019 at 12:35 pm

why you need arduino? NodeMCU has digital IO too.

Reply

Leave a Reply

webcache.googleusercontent.com/search?q=cache:https://www.electroniclinic.com/iot-based-car-parking-system-using-arduino-and-nodemcu-… 12/17
11/27/2019 IOT based Car Parking System using Arduino and Nodemcu esp8266

Enter your comment here...

Search … Search

webcache.googleusercontent.com/search?q=cache:https://www.electroniclinic.com/iot-based-car-parking-system-using-arduino-and-nodemcu-… 13/17
11/27/2019 IOT based Car Parking System using Arduino and Nodemcu esp8266

Recent Posts
webcache.googleusercontent.com/search?q=cache:https://www.electroniclinic.com/iot-based-car-parking-system-using-arduino-and-nodemcu-… 14/17
11/27/2019 IOT based Car Parking System using Arduino and Nodemcu esp8266

DIY IoT Weighing Scale using HX711 Load Cell, Nodemcu ESP8266, & Arduino
Raspberry Pi Home Automation using RC522 RFID, Smart Home
Raspberry Pi RFID RC522 NFC Reader, Tags Scanner python code
Remote Controlled Door Lock using Arduino & Electronic Lock
What is a Voltage Divider or Potential Divider, Formula and Practical Uses?

Recent Comments
mohammed omar on IOT Water level monitoring using Ultrasonic Sensor
mohammed omar on IOT Water level monitoring using Ultrasonic Sensor
faris on Arduino Libraries Download and Projects they are used in “Project codes”
satya on IOT Water level monitoring using Ultrasonic Sensor
Engr Fahad on IOT Water level monitoring using Ultrasonic Sensor

Archives
November 2019 (7)
October 2019 (16)
September 2019 (15)
August 2019 (22)
July 2019 (43)
June 2019 (11)
May 2019 (52)
April 2019 (20)

Categories
Advance Electronics (12)
Advance Projects (36)
android (2)
android app development (2)
Arduino + Image Processing (6)
Arduino + vb.net Projects (9)
Arduino Industrial Projects (5)
Arduino Projects (121)
Arduino Robotic Projects (4)
Arduino Wireless Projects (22)
Articles (6)
Basic Electronics (10)
Electronics Projects (13)
Industrial Projects (1)
IOT Projects (28)
PLC Projects (7)
Power Generation (2)
Power Projects (5)
raspberry pi projects (8)
Simple Projects (28)
Uncategorized (1)

webcache.googleusercontent.com/search?q=cache:https://www.electroniclinic.com/iot-based-car-parking-system-using-arduino-and-nodemcu-… 15/17
11/27/2019 IOT based Car Parking System using Arduino and Nodemcu esp8266

Subscribe for Updates


Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Email Address

Subscribe

Follow Us

Stay updated via social channels

Categories
Advance Electronics (12)
Advance Projects (36)
android (2)
android app development (2)
Arduino + Image Processing (6)
Arduino + vb.net Projects (9)
Arduino Industrial Projects (5)
Arduino Projects (121)
Arduino Robotic Projects (4)
Arduino Wireless Projects (22)
Articles (6)
Basic Electronics (10)
Electronics Projects (13)
Industrial Projects (1)
IOT Projects (28)
PLC Projects (7)
Power Generation (2)
Power Projects (5)
raspberry pi projects (8)
Simple Projects (28)
Uncategorized (1)

About Us

webcache.googleusercontent.com/search?q=cache:https://www.electroniclinic.com/iot-based-car-parking-system-using-arduino-and-nodemcu-… 16/17
11/27/2019 IOT based Car Parking System using Arduino and Nodemcu esp8266

“Electronic Clinic” is an Electrical and Electronics Engineering community built and run by professional
electrical engineers and computer experts. We share Electrical, Electronics, Power, Robotics, Software,
Communication, IOT “Internet Of Things”, GSM, Industrial and communication projects. Thus helping
students and professionals with their projects and work. We also offer innovative ideas and solutions.

© 2019 Electronic Clinic by Shahzada Fawad

Home
Privacy Policy
Disclaimer
DMCA
About Us
Contact Us
Sitemap
Advertise With Us

Close

webcache.googleusercontent.com/search?q=cache:https://www.electroniclinic.com/iot-based-car-parking-system-using-arduino-and-nodemcu-… 17/17

You might also like