Introduction: IoT Based Smart Parking System Using NodeMCU ESP8266

About: IoT projects, DIY projects, Arduino projects, Raspberry pi projects, NodeMCU based projects, Articles, Electronics projects.

Nowadays finding parking in busy areas is very hard and there is no system to get the details of parking availability online. Imagine if you can get the parking slot availability information on your phone and you don’t have roaming around to check the availability. This problem can be solved by the IoT based smart parking system. Using the IoT based parking system, you can easily access the parking slot availability over the internet. This system can completely automate the car parking system. From your entry to the payment, and exit, all can be done automatically.

So here we are building an IoT based Car Parking System using NodeMCU, five IR sensors, and two servo motors. Two IR sensors are used at the entry and exit gate to detect the car while three IR sensors are used to detect the parking slot availability. Servo motors are used to open and close the gates according to the sensor value. Here we are using the Adafruit IO platform to show publish the data on the cloud which can be monitored from anywhere in the world.

Step 1: Components Required


Online Services

  • Adafruit IO

Step 2: IoT Based Smart Parking Circuit Diagram

In this Smart Parking System using IoT, we are using five IR Sensors and two servo motors. IR sensors and Servo motors are connected to the NodeMCU. NodeMCU controls the complete process and sends the parking availability and parking time information to Adafruit IO so that it can be monitored from anywhere in the world using this platform. Two IR sensors are used at entry and exit gate so that it can detect the cars at entry and exit gate and automatically open and close the gate. We previously used Adafruit IO cloud in many IoT projects, follow the link to learn more.

Two servo motors are used as entry and exit gate, so whenever the IR sensor detects a car, the servo motor automatically rotates from 45° to 140°, and after a delay, it will return to its initial position. Another three IR sensors are used to detect if the parking slot is available or occupied and send the data to NodeMCU. Adafruit IO dashboard also has two buttons to manually operate the entry and exit gate.

Step 3: Adafruit IO Setup for IOT Parking System

Adafruit IO is an open data platform that allows you to aggregate, visualize, and analyze live data on the cloud. Using Adafruit IO, you can upload, display, and monitor your data over the internet, and make your project IoT enabled. You can control motors, read sensor data, and make cool IoT applications over the internet using Adafruit IO. For test and try, with some limitation, Adafruit IO is free to use. We have also used Adafruit IO with Raspberry Pi previously.

1. To use Adafruit IO, first, you have to create an account on Adafruit IO. To do this, go to the Adafruit IO website and click on ‘Get started for Free’ on the top right of the screen.

2. After finishing the account creation process, log in to your account and click on ‘AIO Key’ on the top right corner to get your account username and AIO key.

When you click on ‘AIO Key,’ a window will pop up with your Adafruit IO AIO Key and username. Copy this key and username, it will be needed later in the code.

3. Now, after this, you need to create a feed. To create a feed, click on ‘Feed.’ Then click on ‘Actions,’ and then on ‘Create a New Feed’ as shown in the image below.

4. After this, a new window will open to enter the Name and Description of the feed. The writing description is optional.

5. Click on ‘Create,’ after this; you will be redirected to your newly created feed. For this project, we created a total of nine feeds for exit gate, entry gate, slot 1 entry & exit, slot 2 entry & exit, and slot 3 entry & exit. After creating feeds, now create an Adafruit IO dashboard to show all of these feeds on a single page. To create a dashboard, click on the Dashboard option and then click on the ‘Action,’ and after this, click on ‘Create a New Dashboard.’ In the next window, enter the name for your dashboard and click on ‘Create.’

6. As the dashboard is created now, we will add our feeds to the dashboard. To add a feed, click on the ‘+’ in the top right corner.

First, we will add two RESET buttons blocks for Entry and Exit gate and then seven TEXT blocks for parking details. To add a button on the dashboard click on the RESET block.

In the next window it will ask you to choose the feed, so click on the entry gate feed.

In this final step, give your block a title and customize it accordingly. Change the press value from ‘1’ to ‘ON’. So whenever the button is pressed it will send the ‘ON’ string to NodeMCU, and NodeMCU will perform the further task. If you don’t want to change the press value here, then you can change the condition in the program.

After this, follow the same procedure to create another block for the exit gate. To create the rest of the blocks follow the same procedure, but instead of creating a RESET block, create a TEXT block so that you can show the parking details. After creating all the blocks, my dashboard looks like below. You can edit the dashboard by clicking on the settings buttons.

Step 4: Programming NodeMCU for IOT Parking System

To program NodeMCU with Arduino IDE go to File–>Perferences–>Settings.

Enter https:// into the ‘Additional Board Manager URL’ field and click ‘Ok’.

Now go to Tools > Board > Boards Manager.

In the Boards Manager window, Type esp in the search box, esp8266 will be listed there below. Now select the latest version of the board and click on install.

After installation is complete, go to Tools >Board >and select NodeMCU 1.0(ESP-12E Module).

Now you can program NodeMCU with Arduino IDE.

So this is how a Smart Parking System using IoT can be built. You can add more sensors to increase the parking slots and can also add a payment system to automatically pay the parking fee. Comment below if you have any doubts regarding this project.

Step 5: IoT Based Smart Car Parking System Working Video