IOT Based Street Automation Project
IOT Based Street Automation Project
Session (2020-2024)
Approved by
……………………………………………………………………………………………...
We declare that we are the sole authors of this project. It is the actual copy of the project
that was accepted by our advisor(s) including any necessary revisions. We also grant
Bahauddin Zakariya University permission to reproduce and distribute electronic or paper
copies of this project.
ii
STATEMENT OF CONTRIBUTIONS
In our "IOT-Based Street Automation System" project, everyone played a key role, each
team member made important contributions in the project. We all started by looking at
previous research and similar projects. Muhammad Atif (Roll No. 2020-EE-09) worked
on the software side, writing the code to control the street lights using the Blynk IOT app.
He also checked other studies to make sure our project was new and up-to-date. Luqman
Shah (Roll No. 2020-EE-21) took care of the hardware. He found and gathered all the
necessary parts, built the system, and tested it to make sure it worked correctly. His work
was based on looking at past projects to make our project better and feasible. Nazif Ullah
(Roll No. 2020-EE-47) wrote the thesis report, which included detailed explaination of
our project and added insights from earlier studies to improve our research. Throughout
the project, we all helped each other and used our combined knowledge to make
improvements. This teamwork and our review of existing research were key to
successfully making our IOT based street light automation system.
iii
EXECUTIVE SUMMARY
Our project, "IOT-Based Street Automation System," aims to update street lighting with smart
technology to make it more efficient and save money. Traditional street lights often stay on all
night, wasting energy and increasing costs even when no one is around. Our system solves this
problem by using advanced sensors that adjust the lights based on what’s happening around them.
For example, the sensors check how bright it is outside and if there are people or vehicles nearby,
and then the system changes the lights—turning them on, dimming them, or turning them off as
needed. This helps save a lot of energy and cuts down on maintenance and electricity bills.
Additionally, city officials can use an app to monitor and control the lights from anywhere,
making it easier to manage and fix any issues quickly. By making sure the lights are only on
when necessary, our system makes streets safer for everyone and provides a more efficient way
to manage city lighting.
iv
ABSTRACT
In this modern era, saving energy is one of the most important challenges we face. Most of our
energy comes from sources like coal, oil, and natural gas, which are limited and harm the
environment. Traditional street lighting systems are usually turned on manually at sunset and
stay on until sunrise, even if they’re not needed all night. This leads to a lot of wasted power, as
the lights stay on even when no one is around. These systems also need maintenance and are
expensive to install and operate, leading to high electricity bills and unnecessary power loss.
To solve these problems, there is a proposed solution called "IoT-Based Street Light
Automation." The goal of this project is to create a smart street lighting system that can
automatically control street lights based on real-time conditions. Using advanced technology, the
system reduces energy use, lowers operating costs, and greatly improves the overall performance
of street lighting. The ability to use adaptive lighting techniques and advanced control methods
further reduces energy use and improves lighting efficiency.
In that project, the BMP180 sensor, an important part of the automation system, measures air
pressure to help the system understand weather changes that might affect the need for street
lighting. The LM2596 sensor acts as a voltage regulator, making sure that all parts of the system
receive a stable and steady power supply, preventing problems that could cause the lights to fail.
The ESP32 microcontroller serves as system's 'brain,' processing information from all sensors.
We use IR proximity sensors to detect when vehicles or people are nearby automatically turning
the light on or increasing its brightness. When no one is around, the light will dim or turn off,
saving energy. This automatic on/off feature not only saves power but also reduces the need for
manual operation. Additionally, the system’s ability to detect number of vehicles and people in
a particular area allows it to adjust the brightness of the street lights accordingly, further reducing
energy use and environmental impact. Remote monitoring and control provided by IoT also result
in better maintenance, less downtime, and improved safety. In this project, the Arduino BM180
barometric sensor, which provides additional environmental data to further optimize lighting
control. An LCD display allows users to monitor system status and collect environmental data in
real-time. For lighting, LED lights are used. LEDs use less power, produce bright and focused
light, and last a long time, making them an ideal choice for a smart lighting system. By
automatically controlling lights based on real-time data, the system can reduce energy use by up
to 35%. Additionally, the use of energy-efficient components like LEDs and voltage regulators
can lower maintenance costs, resulting in an overall cost reduction of up to 42%.
v
ACKNOWLEDGMENTS
vi
DEDICATION
We dedicate this project to those who have supported us and played a crucial role in making the
research. We dedicate this project to those who played a crucial role in making it a reality. Our
deepest thanks go to Sir Adil Bashir, our supervisor. His guidance was invaluable to us, and his
help was crucial in shaping our research and guiding us through the project. His insights and
encouragement helped us navigate the complexities of our research and ensured we stayed on the
right path.
We dedicate this work to our parents, whose love, encouragement, and sacrifices have been the
foundation of our educational endeavors. Their support has been a source of inspiration and has
made all our hard work meaningful. We also wish to acknowledge our friends, whose support
and understanding have been a source of strength throughout this project. This dedication reflects
our appreciation for the dedication and help we received from these exceptional individuals.
Without their contributions, this project would not have been possible.
vii
TABLE OF CONTENTS
Table of Contents
AUTHOR’S DECLARATION .................................................................................................................................... II
STATEMENT OF CONTRIBUTIONS ........................................................................................................................ 3
EXECUTIVE SUMMARY........................................................................................................................................ IV
ABSTRACT ........................................................................................................................................................... V
ACKNOWLEDGMENTS ........................................................................................................................................ VI
DEDICATION ......................................................................................................................................................VII
CHAPTER 1 INTRODUCTION ................................................................................................................................. 2
1.1 INTRODUCTION: .................................................................................................................................................... 2
1.2 MOTIVATION: ....................................................................................................................................................... 5
1.3 OBJECTIVES: ......................................................................................................................................................... 5
1.4 PROBLEM STATEMENT: ........................................................................................................................................... 5
1.5 BACKGROUND: ...................................................................................................................................................... 6
CHAPTER 2 LITERATURE REVIEW ......................................................................................................................... 8
CHAPTER 3 METHODOLOGY .............................................................................................................................. 15
3.1 INTRODUCTION: .................................................................................................................................................. 15
3.2 ESP32 WROOM MODULE .................................................................................................................................. 16
3.3 IR SENSOR MODULE ............................................................................................................................................ 16
3.4 5V RELAY MODULE.............................................................................................................................................. 17
3.5 WHITE LEDS (1 WATT) ........................................................................................................................................ 17
3.6 DHT11 HUMIDITY AND TEMPERATURE SENSOR ........................................................................................................ 18
3.7 12V 3 AMPS POWER SUPPLY................................................................................................................................. 18
3.8 BUCK CONVERTER MODULE................................................................................................................................... 19
3.9 20X4 LCD DISPLAY WITH I2C MODULE ................................................................................................................... 19
3.10 BMP180 ATMOSPHERIC PRESSURE SENSOR .......................................................................................................... 20
3.11 2N2222 NPN TRANSISTOR ................................................................................................................................ 20
3.12 PCB CONNECTORS............................................................................................................................................. 21
3.13 PCB HEADER PINS ............................................................................................................................................. 21
3.14 3D PRINTED STREET LIGHT MOUNTS ..................................................................................................................... 21
3.15 JUMPER WIRES ................................................................................................................................................. 21
3.16 SINGLE-SIDED FIBERGLASS VERO BOARD ................................................................................................................ 22
3.17ACRYLIC SHEET FOR MODEL ................................................................................................................................. 22
3.18 IR SENSOR MODULE 3D PRINTED MOUNTS............................................................................................................ 22
3.2 OPERATION OF THE IOT-BASED STREET LIGHT AUTOMATION SYSTEM ........................................................ 23
3.3 BLOCK DIAGRAM ......................................................................................................................................... 24
3.4 EXPLANATION OF BLOCK DIAGRAM ............................................................................................................ 25
CHAPTER 4 RESULTS AND DISCUSSION .............................................................................................................. 26
4.1 HARDWARE IMPLEMENTATION ............................................................................................................................... 27
4.2 HARDWARE SETUP 1 ............................................................................................................................................ 27
4.3 HARDWARE SETUP 2 ............................................................................................................................................ 28
4.4 HARDWARE SETUP 3 ............................................................................................................................................ 29
4.5 CAR PASSING TEST ............................................................................................................................................... 32
4.6 OUTPUT RESPONSE AND RESULT............................................................................................................................. 34
viii
CHAPTER 5 CONCLUSIONS ................................................................................................................................. 35
5.1 CONCLUSION ...................................................................................................................................................... 35
5.2 FUTURE WORK.................................................................................................................................................... 35
REFERENCES ...................................................................................................................................................... 36
APPENDIX.......................................................................................................................................................... 39
DESIGNED CODE........................................................................................................................................................ 39
ix
LIST OF FIGURES
Figure 1 ESP32 WROOM Module ............................................................................................................. 16
Figure 2 IR sensor module ....................................................................................................................... 16
Figure 3 5V relay module ......................................................................................................................... 17
Figure 4 White LEDs (1 Watt)................................................................................................................... 17
Figure 5 DHT11 humidity and temperature sensor ................................................................................. 18
Figure 6 12V 3 Amps power supply ......................................................................................................... 18
Figure 7 buck converter Module.............................................................................................................. 19
Figure 8 20x4 LCD Display with I2C Module......................................................................................... 19
Figure 9 BMP180 Atmospheric Pressure sensor...................................................................................... 20
Figure 10 2N2222 NPN Transistor ........................................................................................................... 20
Figure 11 PCB Connectors........................................................................................................................ 21
Figure 12 Jumper Wires ........................................................................................................................... 22
Figure 13single-sided fiberglass zero board ............................................................................................ 22
Figure 14 Hardware implementation on Warm Board ............................................................................ 27
Figure 15 Hardware Implementation on Warm Board ............................................................................ 28
Figure 16 Street Lights with Designed Road ............................................................................................ 29
Figure 17 Output Results ......................................................................................................................... 30
Figure 18 Output Results ......................................................................................................................... 31
Figure 19 Car Passing 1 ............................................................................................................................ 32
Figure 20 Car Passing 2 ............................................................................................................................ 32
Figure 21 LCD Display Readings ............................................................................................................... 33
Figure 22 Warm Boards ........................................................................................................................... 33
x
LIST OF ABBREVIATIONS
DC Direct Current
AI Artificial Intelligence
I2C Internal Integrated circuit
IR Infrared
AC Alternating Current
HTTPS Hypertext Transfer Protocol Secure
LDR Light Dependent Resistor
LED Light Emitting Diode
LCD Liquid Crystal Display
GPS Global Positioning System
xi
UNITED NATIONS SUSTAINABLE DEVELOPMENT GOALS
The Sustainable Development Goals (SDGs) are the blueprint to achieve a better and
more sustainable future for all. They address the global challenges we face, including
poverty, inequality, climate change, environmental degradation, peace and justice. There is
a total of 17 SDGs as mentioned below. Check the appropriate SDGs related to the
project.
No Poverty
Zero Hunger
Quality Education
Gender Equality
Reduced Inequalities
Climate Action
Life on Land
xii
SIMILARITY INDEX REPORT
Following students have compiled the final year report on the topic given below for partial
fulfillment of the requirement for Bachelor’s degree in _____________________.
Project Title
1.
2.
3.
This is to certify that Plagiarism test was conducted on complete report, and overall similarity
index was found to be less than 20%, with maximum 5% from single source, as required.
..................................
[Name of Advisor] [Plagiarism Test must be conducted on the project report by the project
advisor using Turnitin Software, or any other software approved by the university. Project
Advisor is required to sign the Plagiarism Certificate if the similarity is found as per rules defined
in the guidelines. Plagiarism report must be included (only the first and last page) generated by
Turnitin. A sample of the plagiarism test report is provided with the FYP template package.]
xiii
[Attach here the first and last page of the plagiarism report generated by Turnitin.
xiv
CHAPTER 1 INTRODUCTION
1.1 Introduction:
With the increase in population and cities, the need for smarter and more efficient systems
becomes more important. With a growing focus on saving energy and building cities in a way
that’s good for the environment, smart city projects are becoming more popular. One
important area for improvement is street lighting. Street lights are used everywhere in cities
and use a lot of energy, so they are a big target for new technology. Using the IoT technology
in street lighting can help cities manage their energy use better and make their lighting
systems more efficient and responsive to what’s needed at any moment. Traditional street
lighting systems are often turned on manually at sunset and stay on until sunrise, even if
they’re not needed all night. This wastes a lot of energy, as the lights stay on even when no
one is around [1]. These systems also need regular maintenance and are expensive to install
and run, leading to high electricity bills and wasted energy.
To solve these problems, we can use IoT technology. IoT technology connects devices to the
internet, allowing them to communicate to each other and be controlled remotely [2]. For
street lights, this means they can automatically turn on or off based on real-time conditions,
like how much natural light there is or whether there are cars or people nearby. This not only
saves energy but also makes sure streets are always properly lighted for safety. The push for
energy efficiency and smart city solutions has made street lighting a key area for innovation.
Traditional street lights, which rely on manual controls and fixed schedules, can’t adjust to
changing conditions, making them inefficient and more costly to maintain. Our project, "IoT-
Based Street Light Automation," aims to solve these problems by creating a smart street
lighting system using IoT technology. This system will use various sensors and controllers to
adjust the lighting based on real-time data [3]. For example, it will use sensors to detect how
much natural light there is and whether there are people or vehicles nearby, then adjust the
brightness of the lights accordingly. The "IoT-Based Street Light Automation" project not
only aims to reduce energy use but also helps make urban areas safer. By making sure streets
are well-lighted during times of low visibility, the system increases safety for both pedestrians
and vehicles, possibly reducing accidents and crime.
One project suggested a system that uses ARM7 microcontrollers and IoT-based wireless
communication to manage street lamps more efficiently [4]. The system uses sensors to
control lighting based on environmental conditions, like daylight and the presence of vehicles,
2
leading to significant energy savings. This project showed that it’s possible to save up to
80.8% of energy in outdoor street lighting. The Intelligent Street Light Monitoring and
Control project automatically manages street lighting based on real-time conditions. This
project uses IR sensors to detect vehicle movement and adjust the brightness of the street
lights accordingly. When there’s no activity, the lights dim to save energy, but they brighten
up when vehicles are detected. Additionally, an LDR sensor ensures that the lights are only
on when it’s dark. The system is controlled by an ARM7 microcontroller, which connects to
an IoT module that allows for remote monitoring and control over the internet. This project
closely aligns with the goals of our own IoT-based street light automation system. Both
projects focus on using sensors to save energy, integrating IoT for remote management, and
reducing unnecessary energy use by adjusting to real-time conditions.
In our project, various components are used to improve street lighting efficiency and
responsiveness. The BMP180 sensor measures air pressure to help the system understand
weather conditions for better lighting control. The LM2596 sensor ensures a stable power
supply to prevent malfunctions. The ESP32 microcontroller processes sensor data and
manages the lighting. IR proximity sensors detect nearby vehicles or pedestrians, adjusting
light intensity to enhance safety and save energy. The Arduino BM180 barometric sensor
provides extra environmental data for better lighting decisions. An LCD display shows real-
time updates on the system’s status, making it easier to manage. We use energy-efficient
street LED lights that use less power and last longer than traditional lights [5]. Together, the
system’s five LED lights and five IR sensors deliver smart, adaptable street lighting. The
project aims to create a smart street lighting system that can automatically control street lights
based on real-time conditions. By using advanced technology, the system can reduce energy
use, lower costs, and improve the overall performance of street lighting. Our system uses
several key components to achieve these goals.
Implementing an IoT-based street lighting system comes with some challenges. One of the
main issues is the initial cost of setting up such a system. Installing sensors, controllers, and
communication tools requires a significant amount of initial investment. However, these costs
can be balanced by the long-term savings in energy and maintenance. Also, connecting IoT
devices to existing street lighting systems can be tricky, especially in older cities with
outdated systems. To address this, our project can focus on creating flexible solutions that
work with a wide range of existing systems. Another challenge is the security of IoT systems.
3
As street lighting becomes connected to the internet, it may be exposed to hacking or other
security risks. To protect the system from such problems, it’s important to use strong security
measures, like coding and secure ways of communication. Managing and maintaining a large
IoT-based lighting system might also be hard for city authorities [6]. To make this easier, the
system could be designed with simple, easy-to-use controls and automatic monitoring tools.
Training programs for city workers could help them learn how to manage and maintain the
system effectively.
Looking ahead, there are many ways to expand and improve IoT-based street lighting
systems. One promising idea is to add renewable energy sources, like solar panels, to make
the system even more environmentally friendly [7]. By using solar energy during the day, the
system could store power for use at night. Another possible improvement is AI to make
lighting control even smarter. AI could study data from the sensors to predict patterns in how
people and vehicles move, allowing the system to adjust lighting ahead of time. This could
lead to even greater energy savings and better safety [8]. The system could also be expanded
to include other smart city uses. For example, connecting the street lighting system with traffic
management systems could help improve traffic flow and reduce congestion. Additionally,
the system could be used for public safety, such as keeping an eye out for unusual activity or
helping in emergencies.
4
1.2 Motivation:
An "IoT-Based Street Light Automation" system comes from the need to save energy and
improve street lighting in cities. Traditional street lights use a lot of power because they stay
on all night, even when they’re not needed. This leads to loses energy and higher electricity
bills. As we know that the world running out of non-renewable energy like coal and oil, it’s
important to find smarter ways to use electricity. This project "IoT-Based Street Light
Automation" solves this problem by creating a smart lighting system using IoT technology.
The system uses sensors to automatically adjust the brightness of street lights depending on
real-time conditions, like how bright it is outside or if there are cars or people nearby. This
helps save energy by turning the lights on only when they’re needed. It also makes streets
safer by ensuring proper lighting for pedestrians and drivers. Additionally, the system reduces
the cost of maintenance by allowing remote control and monitoring of the lights, making it a
practical and efficient solution for modern cities.
1.3 Objectives:
The main goal of the "IoT-Based Street Light Automation" project is to create a smart street
lighting system that saves energy and works more efficiently. The system will use sensors
and IoT technology to automatically control the street lights. It can adjust the brightness
depending on real-time conditions, like how much sunlight there is or if there are people or
cars nearby. This will help reduce electricity use, lower costs, and keep streets safer by
ensuring proper lighting when needed. The system can also be controlled and monitored
remotely, making maintenance easier and helping cities become more energy-efficient and
sustainable.
1.5 Background:
Street lighting is very important for keeping people safe, especially at night. However, the
way we light streets hasn’t changed much over the years. Usually, street lights are turned on
at sunset and stay on until sunrise, no matter if they’re needed all night or not. This old method
wastes a lot of energy and money because the lights stay on even when there’s no one around.
As cities grow bigger and the number of street lights increases, the waste and costs grow too.
In a time when saving energy and protecting the environment are so important, it’s clear that
we need better ways to manage street lighting. Traditional systems not only use too much
energy, but they also need a lot of repairs, which makes them even more costly and bad for
the environment. The rise of the IoT technology gives us a chance to improve street lighting
and make it smarter. IoT allows devices to connect and be controlled from a distance, which
means street lights can be automated to work based on real-time conditions. For example,
street lights could change their brightness depending on how much natural light is available
or if there are people or cars nearby. This kind of smart system could save a lot of energy,
reduce costs, and make our streets safer. In recent years, many studies and projects have
looked at how smart street lighting using IoT can make a big difference. These systems have
shown they can cut energy use by only lighting areas when needed and adjusting the
brightness of the lights as required. Using energy-saving components like LED lights makes
these systems even better and helps create more sustainable cities.
The "IoT-Based Street Light Automation" project is based on these new ideas and aims to
create a system that uses sensors and controllers to make street lighting more efficient. With
6
IoT, the system can be watched and managed from afar, making it easier to fix problems like
broken lights and better manage city resources. This project aims to solve the problems with
traditional street lighting and offer a more practical, cost-effective solution that can be used
widely in modern cities.
7
CHAPTER 2 LITERATURE REVIEW
The Smart Street Lights with Sensors system is designed to automatically control street lights
to enhance energy savings and reduce manual adjustments. It uses two types of sensors to
achieve this: LDR sensors and IR sensors. LDR sensors measure the level of natural light
around the street lights [9]. When it gets dark, these sensors signal the lights to turn on, and
when it becomes light again, they turn the lights off. IR sensors, detect whether people are
nearby or far away. When these sensors sense movement, they can make the lights brighter,
ensuring better visibility. The system features energy-efficient LED lights that can be dimmed
or brightened based on the needs detected by the sensors. It is powered by solar panels, which
makes it environmentally friendly and significantly cuts down on energy use by 48%. This
combination of features makes the system both cost-effective and sustainable, reducing the
need for manual control and lowering overall energy consumption [10].
The IoT-Based Street Lighting Network uses internet technology to create a smart system for
managing street lights. Each street light has sensors that collect information about various
things: traffic sensors track how many cars are on the road and how they’re moving,
pedestrian sensors detect when people are walking by, and environmental sensors check
natural light levels and weather conditions [11]. This information is sent over the internet to
a central system, which looks at the data to understand what’s happening. Based on this
information, the central system adjusts the brightness of each street light. For example, it can
make the lights brighter during busy traffic to help drivers see better or dim them when there
are no people around to save energy. The lights use energy-saving LED bulbs that can change
their brightness. The system also allows city officials to monitor and fix problems from afar,
without needing to visit each street light. By working with other smart city technologies, the
network makes the city more efficient and safer overall [12].
This research focuses on creating a smart street lighting system that is both affordable and
energy-efficient. The goal of the system is to cut down on energy use and reduce CO2
emissions by automatically adjusting the brightness of street lights based on real-time
conditions [13]. It uses sensors to detect the presence and amount of traffic. For example,
when there is less traffic or during a full moon when there’s enough natural light, the street
lights dim to save energy. These sensors are connected to a control unit that processes the
data and adjusts the light brightness as needed. The implementation of this system
demonstrated a significant reduction in energy usage. By changing the brightness of street
8
lights based on actual needs instead of keeping them at the same level all the time, the system
provides an effective and eco-friendly solution to energy problems. This research
demonstrates how simple yet smart technologies can be applied to everyday city
infrastructure, leading to substantial energy savings and a positive impact on the environment
[14].
An automated street lighting system using IoT technology to make street lighting more
energy-efficient and easier to manage [15]. The system includes parts like Arduino
controllers, sensors, and communication tools that work together to control the street lights
based on the surrounding conditions. The system working in 3 modes. During the day, when
there’s enough natural light, the lights stay off, and the system charges its batteries using solar
power; as it gets darker, the system automatically turns on and activates motion sensors; and
when the sensors detect people or vehicles nearby, the lights turn on and then turn off after a
set time if no movement is detected. The research shows that this smart street lighting system
can greatly reduce energy use by adjusting the lights based on real-time needs. By using
renewable energy like solar power and optimizing when the lights are on, the system not only
saves electricity but also helps protect the environment by lowering carbon emissions [16].
This approach also addresses common issues with older systems, such as wasting energy
when lights are left on unnecessarily and the high costs of maintaining traditional bulbs. The
study highlights the potential for further improvements by connecting this system with other
smart city technologies, making it a promising solution for modern urban areas.
H.N Lokhande focuses on creating a smart street lighting system that saves energy and keeps
people safe. The system uses simple technology, including sensors and small computers, to
automatically adjust the brightness of street lights based on the time of day and the amount
of traffic [17]. Sensors measure how much natural light is around and how many cars or
people are present. If there is enough natural light, like during the day or a bright night, the
lights dim to save energy. But if the sensors detect more traffic or low light conditions, the
lights get brighter to ensure everyone can see well. The central control unit, or the "brain" of
the system, processes all the information from the sensors and decides how bright the lights
should be. The street lights used are energy-efficient LED lights that can easily change their
brightness. The system is also connected to the internet, allowing city officials to monitor and
control the lights remotely and collect data for future improvements. Overall, this smart street
lighting system has been shown to greatly cut energy use and maintenance costs. By using
9
the right amount of light only when needed, this system helps save money and protect the
environment. This research demonstrates how simple technologies can improve our cities,
making them more efficient and eco-friendlier [18].
The "LED Smart Lighting Street Technology in Iraq" project aims to improve street lighting
by switching from old high-pressure sodium (HPS) lamps to new, energy-saving LED lamps
[19]. This change is important because it helps save energy and cut down on costs, which is
especially needed in cities. LED lamps are better because they use less electricity and last
much longer than HPS lamps, leading to big savings on electricity bills and less money spent
on replacing or fixing the lights. The project also looks at adding smart technology, like
sensors and controllers, to make the street lights work automatically. These smart lights can
adjust based on things like the weather, time of day, or if someone is nearby. This way, the
lights use just the right amount of energy, keeping the streets safe while not wasting power.
The project even considers using solar panels to power the street lights, which would reduce
the need to rely on the main power grid and be better for the environment. Overall, this system
offers many advantages, including saving money, using energy more efficiently, being kinder
to the environment, and fitting in with modern smart city plans. It’s a smart and forward-
thinking way to help cities develop in a more sustainable way [20].
Recent research into smart street lighting systems highlights the development of automated
technologies designed to enhance energy efficiency and reduce costs. Traditional street lights
remain on all the time, regardless of whether there are cars or people on the road. This leads
to unnecessary energy consumption and higher maintenance expenses. To address these
issues, the new smart street lighting system integrates several advanced technologies. Firstly,
solar panels are used to collect energy from the sun during the day. The energy is stored in
stored in the batteries and then used at night to power the street lights. This reduces the
reliance on grid electricity and lowers overall energy costs. The system also uses motion
sensors, such as infrared (IR) and passive infrared (PIR) sensors, to detect the presence of
vehicles [21]. When these sensors detect traffic, they turn on the street lights only in the areas
where vehicles are present. When there is no traffic, the lights are turned off or dimmed to
save energy. This means that the lights are not wasting power when they are not needed.
Additionally, the system includes a dust cleaning mechanism for the solar panels. Dust and
dirt can reduce the efficiency of solar panels, so this feature helps keep the panels clean and
functioning effectively.
10
Badri Narayan Sahoo's research, "Automatic Street Light Control System," examine how
automation can make street lighting more efficient and cut energy use. This system uses a
microcontroller, GPS, and a real-time clock (RTC) to manage street lights based on the time
of day and seasonal changes. By using GPS for accurate time, the system fixes timing
mistakes found in older models. The microcontroller uses this time information to
automatically turn the lights on and off, while the RTC ensures the system keeps working
even if there are interruptions. This automation reduces the need for manual control, leading
to significant energy savings as lights are only used when needed. The system also uses
energy-saving LED lights, which use less power and last longer than older types of lights.
Sahoo’s research solves problems like timing errors and battery issues, offering a better and
more efficient street lighting solution [22]. In contrast of the project "IoT-Based Street Light
Automation" takes this a step further by using modern IoT components and sensors. Your
system includes the ESP32 WROOM module for real-time data collection and remote control,
and sensors like the DHT11 and BMP180 for detailed environmental information. The IR
sensor module adjusts light brightness based on traffic conditions [23]. This project also
features a 20x4 LCD display for showing system information, and a buck converter module
for better power management. The use of a 5V relay module and custom 3D-printed parts
highlights a more advanced, customizable approach, providing more precise and efficient
street light control compared to older methods.
Fanoon and Shafana worked on a "Smart Lighting System for Efficient Street Lighting" to
address global energy management issues by proposing an advanced street lighting solution
for Sri Lanka. Their system uses IoT technology along with sensors and controllers in street
lamps to improve efficiency and cut down on energy waste. It includes a smart web server
that creates regular reports, sends email alerts for issues, and tracks electricity use and lamp
lifespan. It has dimmers to adjust light brightness, light sensors (LDRs) to detect ambient
light and control the lamps, and energy meters to monitor real-time energy use. Additionally,
it uses passive infrared (PIR) sensors to detect motion and temperature sensors to help with
motion detection. Data from these sensors are sent using various internet protocols, including
HTTP, HTTPS, MQTT, and Modbus, to ensure street lights are active only when needed
based on schedules, environmental conditions, and detected motion. This system offers a
more effective and cost-efficient solution for street lighting [24]. The "IoT-Based Street Light
Automation" project matches Fanoon and Shafana's research but adds several improvements.
11
Both projects aim to enhance energy efficiency and use IoT technology with sensors to control
street lights. However, IoT-Based Street Light Automation goes further by including a wider
range of sensors, such as temperature and pressure sensors, and using advanced components
like the ESP32 WROOM module and custom 3D-printed mounts. These upgrades provide
more precise control, real-time monitoring, and better power management, making the system
more adaptable and efficient.
Harshita Gupta's research on the "Energy-Efficient Intelligent Street Lighting System"
focuses on improving street lighting by making it more energy-efficient and reducing light
pollution. The system addresses issues with traditional street lights that often waste energy
by operating even when it’s not needed, such as during daylight or in bad weather. Gupta's
system combines several advanced features to tackle these problems. It uses motion sensors
to detect traffic and automatically adjust the lighting based on current conditions. Lights are
controlled by a relay switch connected to an Android board with Wi-Fi, allowing them to be
turned on or off depending on light levels or traffic. Energy consumption is monitored with
sensors that track the voltage and current of each light, logging any failures. The system also
includes temperature sensors to monitor the operating temperature of the lights and light
sensors to determine day or night conditions, ensuring that the lights are only active when
necessary. This approach improves efficiency by adjusting the lighting in real-time based on
various factors, thus saving energy and extending the life of the street lights [25]. "IoT-Based
Street Light Automation," aligns with Harshita Gupta's "Energy-Efficient Intelligent Street
Lighting System" by focusing on energy efficiency and smart lighting control using IoT and
sensors. Gupta’s system uses sensors to turn street lights on and off based on traffic and
weather conditions, which helps save energy. IoT-Based Street Light Automation also uses
sensors but adds extra ones for tracking things like humidity and pressure. It includes
advanced components such as the ESP32 module and custom-made parts. This means your
system can manage street lighting more precisely and efficiently, offering better real-time
control than Gupta’s system.
A Study on IoT-based Smart Street Light Systems, explores how IoT technology can improve
street lighting efficiency. It highlights that current street lights often waste energy because
they are operated manually. The study proposes using IoT to automate the lighting process.
This means using sensors and devices, like temperature sensors, weather sensors, Raspberry
Pi, and Arduino UNO, to control the lights. The system can automatically turn the lights on
12
when it gets dark and off when there is enough light, thanks to a Light Dependent Resistor
(LDR) sensor that works like human vision. This method aims to save energy and make street
lighting more effective [26]. Use IoT technology to make street lights smarter and save energy
by using sensors to control lighting based on the surroundings. However, IoT-Based Street
Light Automation goes further by including advanced components, like the ESP32 WROOM
module, and more types of sensors for better control and real-time monitoring.
Jeetendra Swami's research, "IoT-Based Street Light Automation System," offers a smart and
energy-saving way to manage street lights. The study focuses on using IoT technology to cut
down on energy use and make street lighting more efficient. The system uses an Arduino
microcontroller to control the lights based on infrared (IR) and microwave sensors [27]. An
IR receiver measures the amount of infrared light around, while a microwave sensor detects
movement over a large area. The system automatically turns the lights on or off based on the
amount of infrared light and whether motion is detected. On highways, the lights stay off
unless motion is detected, turning on for a set time when a vehicle is seen. For streets, the
lights stay on but dim, getting brighter only when motion is detected. This setup removes the
need for manual control, adjusts lighting in real-time, and uses sensors to save energy and
improve lighting efficiency. The system uses hardware like Arduino Uno, IR receivers,
microwave sensors, relays, and other electronic parts, along with software to program the
Arduino. This smart system greatly improves on old street lighting by using less energy and
working more efficiently. Intelligent Street Light Monitoring and Control using Micro
Controller, introduces a new way to manage street lights that helps save a lot of energy. The
study uses a special microcontroller, the ARM7, which is more energy-efficient than older
models. The system uses IoT technology and wireless devices to control street lights more
effectively. It includes IR sensors and Light Dependent Resistors (LDRs) to turn the lights on
or off automatically based on the amount of sunlight and the presence of vehicles [28]. During
the day, the LDR senses the sunlight and turns the lights off. At night, the lights stay dim to
save energy but will brighten up when an IR sensor detects a vehicle. A Real-Time Clock
(RTC) helps adjust the light levels based on the time and weather conditions. All the
information about the lights can be checked online from a PC or mobile device. This system
can reduce energy use by about 80.8% compared to traditional street lighting, cutting down
on the need for manual control and providing a more efficient way to manage street lights .
IoT based street light automation is align with Intelligent Street Light Monitoring because
13
both aim to make street lights more efficient by using technology. The project uses sensors to
control the lights automatically. However, IoT based street light automation goes a step
further by including more types of sensors and advanced components, which help manage the
lights even better and make them more adaptable to different conditions.
The research on the "Sensor-Based Automatic Street Lighting System" introduces a way to
save energy by automatically controlling street lights based on vehicle movement. The system
uses sensors to detect when a vehicle is approaching and turns on only the lights in front of it
while turning off the lights behind it to save energy. This is especially useful on highways,
where all lights usually stay on throughout the night, even when there are no vehicles, leading
to wasted electricity. The system uses two main types of sensors: a light sensor that detects
darkness to prepare the lights to turn on, and a photoelectric sensor that detects the movement
of vehicles to activate the street lights. The lights can either be fully turned off when not
needed or dimmed to 10% brightness, increasing to full brightness as a vehicle approaches.
The system is controlled by an 8051 microcontroller, which is programmed to manage the
lights based on the data received from the sensors. The research highlights that using this
smart lighting system can significantly reduce energy consumption, especially in countries
where electricity is scarce. Additionally, the system can be further improved by adding
features like detecting failed lights and notifying the maintenance department through a GSM
modem [29].
The research on the "Internet of Things-based Smart Street System" explores a way to save
electricity by making street lights smarter. The system uses LED lights that automatically turn
on when it gets dark, thanks to a light sensor called LDR. These lights stay dim when no one
is around but become bright when someone or a vehicle passes by, detected by an IR sensor.
Additionally, the system uses a piezoelectric sensor that turns the pressure from vehicles on
the road into electricity. This electricity is stored in a battery and used to power the street
lights. The research shows that this method saves a lot of energy because the lights only get
bright when needed. An Arduino Uno controller manages everything, making the system a
smart and efficient way to light streets while cutting down on energy waste [30].
14
CHAPTER 3 METHODOLOGY
3.1 Introduction:
IoT-Based Street Light Automation is a research project focused on creating a smart street
lighting system that automatically controls street lights based on what’s happening around
them. The system uses simple technology to sense things like how bright it is outside, the
temperature, and whether people or vehicles are nearby. This lets the lights turn on, off, or
change their brightness automatically, without needing anyone to do it by hand. This helps
save energy because the lights are only on when they’re needed. The project also connects to
the internet, allowing for easy monitoring and control from a distance, making it simpler to
manage street lighting. The overall goal is to make street lighting smarter, save energy, and
make sure it works well for everyday needs. In this chapter, we will explain the working of
‘IoT-Based Street Light Automation’. This system consists of the following components:
Esp32 wroom module
Buck converter module
20x4 lcd display with I2c module
Dht11 humidity and temperature sensor
BMP180 atmospheric pressure sensor
IR sensor module
2N2222 npn transistor
PCB connectors
PCB header pins
3d printed street light mount
Jumper wires
Single sided fiberglass zero board
5volt relay module
White LEDs 1watt
12volt 3 amps power supply
Acrylic sheet for model
Screws nut bolts
IR sensor module 3d printed mounts.
Each one is explained in detail in the following.
15
3.2 ESP32 WROOM Module
The ESP32 WROOM is a small, yet powerful microcontroller module that serves as the
central processing unit of the project. It is equipped with both Wi-Fi and Bluetooth
capabilities, allowing it to connect to the internet and communicate with other devices
wirelessly. This makes the ESP32 ideal for IoT street light automation project. The ESP32
processes data from various sensors and makes decisions based on that data, such as turning
the street lights on or off. It can also send data to a remote server or receive commands from
a remote controller, making it possible to monitor and control the street lights from anywhere
with an internet connection.
16
3.4 5V Relay Module
The 5V relay module acts as a switch that allows the low-power signals from the ESP32 to
control high-power devices, such as the street lights. The relay module is connected to both
the ESP32 and the street lights. When the ESP32 sends a signal to the relay, it triggers the
relay to close or open a circuit, turning the lights on or off. This is crucial because the ESP32
operates at low voltage and current, but the street lights require much higher power. The relay
safely bridges this gap, allowing the ESP32 to control the lights without being directly
exposed to the high voltage.
17
3.6 DHT11 Humidity and Temperature Sensor
The DHT11 is a sensor that measures both the temperature and humidity of the surrounding
environment. It provides digital data to the ESP32, which can use this information to monitor
environmental conditions. For instance, the system could log temperature and humidity data
to track weather patterns, or adjust the operation of the street lights based on certain
environmental conditions, such as turning lights on earlier if the humidity suggests foggy
conditions. The DHT11 is a simple yet effective sensor that adds valuable environmental
awareness to IoT based street light automation system.
18
3.8 Buck Converter Module
The buck converter is a device that reduces the voltage from a higher level to a lower level.
In IoT based street light automation system, the power supply provides 12 volts, but many of
your components, like the ESP32 and some sensors, require only 5 volts. The buck converter
steps down the voltage from 12V to 5V in an efficient way, meaning it doesn't waste much
energy in the process. This is important for protecting the components and ensuring they get
the correct amount of power. Without the buck converter, these components could be
damaged by too much voltage.
20
3.12 PCB Connectors
PCB connectors are used to attach various components to the PCB. They provide a secure
and reliable way to connect wires and modules to the board, making sure that everything stays
in place and works correctly. PCB connectors are important for ensuring that our project is
easy to assemble and maintain. They allow us to make connections that are both strong and
easy to detach if needed, which is helpful for testing, troubleshooting, and upgrading the
system.
21
interruption or loss.
23
3.3 Block Diagram
LCD Display
20*4 BLYNK IoT
Mobile App
5V Relay
Buck
Convertor ESP 32 Module
Module
Atmospheric Pressure
Sensor BMD-80
IR IR IR IR IR
Sensor Sensor Sensor Sensor Sensor
1 2 3 4 5
Light Control
Block Diagram 1
3.4 Explanation of Block Diagram
1: Initialization
When the system powers on, the ESP32 initializes all components: the sensors, the LCD
display, the relay and the Wi-Fi connection to the Blynk application.
2: Environmental Monitoring
Sensors continuously collect data: For sensing the environment, the DHT-11 is used as a
temperature-humidity sensor, the BMD-80 is used as pressure sensor and the ambient light is
sensed by the LDR.
This data is displayed on the LCD for the local users and at the same time sent to the Blynk
application for remote users.
3: Lighting Control
This decides light levels depending on the LDR. If the ambient light goes below the set limit,
the ESP32 turns on the relay switching on the street lights.
By day, when light on the room or area is bright, the LDR provides enough light to the ESP32
which shuts off the relay to disconnect the light.
The IR sensors add extra inputs for the lighting configuration if the motion actinic lighting is
wanted, switching on the lights in response to motion nearby the sensors.
25
CHAPTER 4 RESULTS AND DISCUSSION
The proposed street lighting system, designed with IoT technology, has greatly improved how
street light’s function, making them smarter and more energy-efficient. ESP32 WROOM
module used to connect several sensors that help control the lights based on real-time
conditions. For example, the DHT11 sensor gives us information about temperature and
humidity, and the BMP180 sensor measures air pressure. This data helps the system adjust
the brightness of the lights according to the current weather.
A key feature of our system is the IR sensor, which detects when vehicles or people are
nearby. When something or someone is detected, the lights automatically brighten, and when
the area is empty, the lights either dim or turn off. This smart control method saves a lot of
energy because the lights are only fully on when needed, unlike traditional systems where
lights stay on at full brightness all night.
Blynk IoT mobile app used to control the entire system, making it easy to manage and monitor
the lights remotely. The system is also very reliable, working well in different weather
conditions, even when there are changes in humidity or air pressure. The LCD display
provides real-time monitoring, making it easy to identify and fix any problems quickly,
ensuring that the system keeps running smoothly. Additionally, a buck converter module used
to make the system even more energy-efficient by providing a stable power supply and
reducing waste.
This project shows how automation can improve city infrastructure by reducing energy use
and increasing public safety. In the future, we could make the system even better by adding
more advanced sensors to optimize light control and possibly integrating solar panels to make
it even more environmentally friendly. Overall, our system offers a smart solution to urban
lighting challenges, showing how modern technology can create more efficient and
sustainable cities.
26
4.1 Hardware Implementation
IoT based Street light automation circuit consist of the following components. Esp32 wroom
module, Buck converter module, 20x4 lcd display with I2c module, Dht11 humidity and
temperature sensor, BMP180 atmospheric pressure sensor, IR sensor module, 1k resistors,
2N2222 npn transistor, PCB connectors, Pcb header pins, 3d printed street light mounts
Jumper wires, Single sided fiberglass vero board, 5volt relay module, White LEDs 1watt,
12volt, 3 amps power supply, Acrylic sheet for model, Screws nut bolts, IR sensor module
3d printed mounts
To operate the lights, we have a MOSFET-based driver circuit. When the signal comes from
IR module, passing from controller then switch it to operate transistor but it will amplify
and de amplify it value. This entire setup is mounted on a single-sided fiberglass PCB.
27
4.3 Hardware Setup 2
28
This Circuit contain ESP32 Wifi Controller also known as Node M3 (upgraded version), Dht11
humidity and temperature sensor, BMP180 atmospheric pressure sensor, 5volt relay module
(control overall automation in turn-on condition), 2N2222 npn transistor (to make compatible
ESP32 with Dht11).
The light bulbs sensors totally depends on LDR Module. The intensity of the light will
increase according to the measured light intensity. The light will turn on when the sensors
operate properly. When the sensor detects human presence, the pole light will turn on. The
light intensity will depend on the ambient light level. For instance, in low sunlight, it will not
activate, as it’s designed to work primarily at night. However, when there's ample natural
light, it won’t be as visible. Additionally, we have five IR sensor modules for common
detection tasks, and the system will operate according to these inputs.
29
Figure 17 Output Results
Turning of light totally depends on each sensor of the light. When the car is passing from
the first sensor then the sensor automatically turn on the light and then automatically turn
off the light when the car passed.
30
(C)
(D)
Figure 18 Output Results
31
4.5 Car Passing Test
Turning of light totally depends on each sensor of the light. When something like car is
passing through the sensors then the sensor automatically turn on the light and then
automatically turn off the light.
32
Same procedures are used for all the lights. Turning of light totally depends on each sensor
of the light. When something like car is passing through the sensors then the sensor
automatically turn on the light and then automatically turn off the light.
33
4.6 Output Response and Result
In this system several sensors work together to make the street lights smart and efficient. The
BMP180 and Arduino BM180 sensors check the weather, helping the system decide how
bright the lights should be. The LM2596 sensor keeps the power steady so the lights work
smoothly. The ESP32 microcontroller is like the brain of the system. It gathers information
from all the sensors and controls the lights, turning them on or adjusting their brightness when
people or vehicles are nearby, detected by IR proximity sensors. The LCD display shows the
current status of the system so it can be easily monitored. All these sensors help create a street
lighting system that saves energy, improves safety, and works well in different conditions.
34
CHAPTER 5 CONCLUSIONS
5.1 Conclusion
The "IoT-Based Street Light Automation" project introduces a smart way to manage street
lighting using modern technology. Traditional streetlights often waste energy because they
run on fixed schedules and are not adjusted based on actual need. This can lead to lights being
on when they aren't necessary, increasing electricity bills and contributing to environmental
harm.
The proposed project changes this by using a system that can automatically adjust the
brightness of streetlights based on real-time conditions. For example, if it gets dark earlier
due to weather, the lights will turn on sooner. If no one is around, the lights can dim to save
energy. This is made possible by using sensors to detect vehicles and pedestrians, so lights
are only fully on when needed. This smart approach not only cuts down energy use by up to
35%, saving money, but it also helps keep streets safer by ensuring they are well-lit when
people are around. If there is ever a problem with a light, the system can alert authorities,
allowing for quick repairs. Moreover, this system is flexible and can be easily added to
existing street lighting setups or included in new city developments. It can also be upgraded
over time, making it a future-proof solution for cities looking to become more sustainable.
35
REFERENCES
36
[14] S. A. Y M Jagadeesh, "Intelligent Street Lights," Panimalar Engineering Collage,
Chennai, India, 2015.
[15] S. M. W. Prashanth Keni, "Automated Street Lighting System using IoT," Bellary,
Karnataka, 2018.
[16] M. S. D. B. Fares S. El-Faouri, "A Smart Street Lighting System usnig Solar Energy,"
Electrical Engineering Department, Princess Sumaya University For Technology,
Amman Jorden, 2016.
[17] R. Kumar, "Intelligent Street Light Monitoring and Control using Micro Controller,"
Institute of Engineering and Technology, Hyderabad, 2016.
[18] S. M. H.N. Lokhande, "Adaptive Street Light Controlling For Smart Cities," NBN
School of Engineering Pune, India, 2018.
[19] T. Somefun, "DEPLOYMENT OF SMART STREET LIGHTING SYSTEM USING
SENSORS," Ogun State, Nigeria, 2019.
[20] J. K. Muhammad, "Reduction cost and energy consumption for led smart lighting street
technology in Iraq," Communication Engineering Department, University of
Technology-Iraq, Iraq, 2020.
[21] T. S. Sri, "Automated Street Lighting System," K.L University A.P. India, 2019.
[22] B. N. Sahoo, "Automated Street Light Control System," Odisha, India, 2019.
[23] Lakshmiprasad, "SMART STREET LIGHTS," Deparment of Electrical & Electronic
Engineering Kumaraguru Collage, Coimbatore, India , 2014.
[24] A. Fanoon, "Smart Lighting System for Efficient Street Lighting," South Eastern
University of Sri Lanka, University Park, Oluvil, 2021.
[25] P. T. Harshita Gupta, "Energy-Efficient Intelligent Street lighting System," RMD
Sinhgad School of Engineering, Warje, Pune, Maharashtra, 2017.
[26] K. V. Dr. A. Senthil Kumar, "A Study on IoT based Smart Street Light Systems,"
Department of Electronics & Communication Engineering Kings Engineering Collage
Tamil Nadu, India, 2020.
[27] H. P. Jeetendra Swami, "IoT Based Street Light Automation System," Department of
Computer Engineering Madhya Pardesh, India, 2019.
[28] R. S. Kumar, "Intelligent Street Light Monitoring and Control using Mirco Controler,"
37
Barat Institute of Engineering and Technology, Hyderabad, 2016.
[29] B. M. T. Deepanshu Khandelwal, "Sensor Based Automatic Street Lighting System,"
Department of Electronic & Communication Engineering Modinagar, Ghaziabad, 2015.
[30] T. R. V. Chandla Ellis, "Internet of Things based Smart Street System," R.M.K.
Engineering College, Chennai, Tamil Nadu, India, 2021.
38
APPENDIX
Designed Code
#include <LiquidCrystal_I2C.h>
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <WiFi.h>
#include <BlynkSimpleEsp32.h>
#define IRSensor1 34
#define IRSensor2 35
#define IRSensor3 32
#define IRSensor4 17
#define IRSensor5 19
#include <DHT.h>
#define light 33
#define Relay1 14
int waterLevel=0;
SFE_BMP180 bmp;
BLYNK_WRITE(V0) {
39
digitalWrite(27, param.asInt());
digitalWrite(27, param.asInt());
}
double T, P;
char status;
void sendSensor()
{
float h = dht.readHumidity();
float t = dht.readTemperature(); // or dht.readTemperature(true) for Fahrenheit
if (isnan(h) || isnan(t)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// You can send any value at any time.
// Please don't send more that 10 values per second.
Serial.println(h);
Serial.println(t);
lcd.setCursor(0, 0);
lcd.print("R.T:");
lcd.setCursor(5, 0);
lcd.print(t);
lcd.setCursor(11, 0);
lcd.print("R.H");
lcd.setCursor(15, 0);
lcd.print(h);
40
{ digitalWrite(14, LOW );
}
Blynk.virtualWrite(V5, h); //V5 is for Humidity
Blynk.virtualWrite(V6, t); //V6 is for Temperature
}
void setup()
{
Serial.begin(115200);
Blynk.begin(auth, ssid, pass);
pinMode(light, INPUT);
pinMode(IRSensor1, INPUT);
pinMode(IRSensor2, INPUT);
pinMode(IRSensor3, INPUT);
pinMode(IRSensor4, INPUT);
pinMode(IRSensor5, INPUT);
dht.begin();
bmp.begin();
lcd.init();
lcd.backlight();
lcd.setCursor(2, 0);
lcd.print("IOT Based Street");
lcd.setCursor(0, 1);
lcd.print(" Automation");
lcd.setCursor(6, 2);
lcd.print("System");
delay(4000);
lcd.clear();
pinMode(Relay1, OUTPUT);
pinMode(27, OUTPUT);
// Setup a function to be called every second
timer.setInterval(100L, sendSensor);
41
timer.setInterval(1000L, sendSensor2);
timer.setInterval(10000L, pressure);
timer.setInterval(100L, sendSensorIR1);
timer.setInterval(100L, sendSensorIR2);
timer.setInterval(100L, sendSensorIR3);
timer.setInterval(100L, sendSensorIR4);
timer.setInterval(100L, sendSensorIR5);
}
void pressure() {
status = bmp.startTemperature();
if (status != 0) {
delay(status);
status = bmp.getTemperature(T);
status = bmp.startPressure(3);// 0 to 3
if (status != 0) {
delay(status);
status = bmp.getPressure(P, T);
if (status != 0) {
}
}
}
Blynk.virtualWrite(V3, P);
lcd.setCursor(11, 3);
lcd.print("A.P:");
lcd.setCursor(16, 3);
lcd.print(P);
}
//Get the LDR sensor values
void sendSensor2() {
bool value = digitalRead(light);
if (value == 0) {
WidgetLED LED(V4);
42
LED.on();
} else {
WidgetLED LED(V4);
LED.off();
}
}
void sendSensorIR1() {
bool value = digitalRead(IRSensor1);
if (value == 0) {
WidgetLED LED(V11);
LED.on();
} else {
WidgetLED LED(V11);
LED.off();
}
}
void sendSensorIR2() {
bool value = digitalRead(IRSensor2);
if (value == 0) {
WidgetLED LED(V12);
LED.on();
} else {
WidgetLED LED(V12);
LED.off();
}
}
void sendSensorIR3() {
bool value = digitalRead(IRSensor3);
if (value == 0) {
WidgetLED LED(V13);
LED.on();
} else {
43
WidgetLED LED(V13);
LED.off();
}
}
void sendSensorIR4() {
bool value = digitalRead(IRSensor4);
if (value == 0) {
WidgetLED LED(V14);
LED.on();
} else {
WidgetLED LED(V14);
LED.off();
}
}
void sendSensorIR5() {
bool value = digitalRead(IRSensor5);
if (value == 0) {
WidgetLED LED(V15);
LED.on();
} else {
WidgetLED LED(V15);
LED.off();
}
}
void loop()
{
timer.run(); // Initiates SimpleTimer
Blynk.run();
}
/***************************************************
* Send Sensor data to Blynk
**************************************************
44