Ipl Final Merged

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 37

B.N.M.

Institute of Technology
An Autonomous Institution under VTU, Approved by AICTE

Department of Information Science and Engineering

22ISE137-Innovative Project Lab Report

on

Smart Street Light System

Submitted

by

M PRAMATH 1BG22IS022
POOJA K N S 1BG22IS029
PRANAVA BHARADWAJ K 1BG22IS033
SHARATH CHANDRA A N 1BG22IS048

Academic Year 2023 – 2024


B.N.M. Institute of Technology
An Autonomous Institution under VTU

DEPARTMENT OF INFORMATION SCIENCE & ENGINEERING

CERTIFICATE

Certified that the IPL project entitled Smart Street Light System has been carried out
internally during 3rd Semester by M Pramath 1BG22IS022, Pooja K N S
1BG22IS029, Pranava Bharadwaj K 1BG22IS033, Sharath Chandra A N
1BG22IS048, the bonafide students of B.N.M Institute of Technology in partial
fulfillment for the award of Bachelor of Engineering in Information Science &
Engineering of the Visveswaraya Technological University, Belagavi during the year
2023-24. Candidates have fulfilled all the requirements prescribed in the curriculum.
The project has incorporated all the corrections/suggestions indicated during the
Internal Assessment. The Innovative Project Lab report has been approved as it
satisfies the curriculum requirements for the said Degree.

Mrs. Sindhu N Dr. S. Srividhya Dr. Krishnamurthy G N


Asst. Professor Prof. & Head Principal,
Dept. of ISE, BNMIT Dept. of ISE, BNMIT BNMIT
ACKNOWLEDGEMENT

We consider it a privilege to express through the pages of this report, a few words of
gratitude to all those distinguished personalities who guided and inspired me in the
completion of this Innovative Project Lab.

We would like to thank Shri. Narayan Rao R Maanay, Secretary, BNMIT, Bengaluru for
providing an excellent academic environment in college.

We would like to thank Prof. T.J. Rama Murthy, Director, BNMIT, Bengaluru for having
extended his support and encouragement during the course of work.

We would like to thank Dr. S.Y. Kulkarni, Additional Director, BNMIT, Bengaluru for his
extended support and encouragement during the course of work.

We would like to express my gratitude to Prof. Eishwar N Maanay, Dean, BNMIT,


Bengaluru for his relentless support, guidance, and encouragement.

We would like to thank Dr. Krishnamurthy G.N., Principal, BNMIT, Bengaluru forhis
constant encouragement.

We would like to thank Dr.S.Srividhya, Professor and Head of the Department of Information
Science and Engineering, BNMIT, Bengaluru, for her support and encouragement towards the
completion of the Innovative Project Lab project.

We would like to express our gratitude to our guide Mrs. Sindhu N, Asst. Professor,
Department of Information Science and Engineering, BNMIT, Bengaluru, who has given us
all the support and guidance in completing the Innovative Project Lab project successfully.

We would like to thank our Innovative Project Lab coordinator Mrs Divyashree S R,
Assistant Professor, Department of Information Science and Engineering, BNMIT, for being
the guiding force towards the successful completion of our Innovative Project Lab.

M Pramath 1BG22IS022
Pooja K N S 1BG22IS029
Pranava Bharadwaj K 1BG22IS033
Sharath Chandra A N 1BG22IS048
ABSTRACT

Our smart street light project integrates ESP8266 microcontrollers, LDR sensors, bulbs,
and Arduino programming to create an intelligent lighting system. By strategically
placing LDR sensors on each street light, the system autonomously adjusts the
illumination based on ambient light levels. This automation significantly reduces
manual intervention, leading to improved efficiency and cost savings. The Arduino
code governs the behavior of the ESP8266 microcontroller, instructing it to turn the
LED bulbs on or off depending on the detected light intensity. Data from the LDR
sensors is transmitted to the ThingSpeak server, where it is visualized in various ways.
The Field chart displays a graphical representation of LDR values over time, providing
insights into light intensity trends. Additionally, ThingSpeak offers manual light control
functionality, allowing administrators to override automatic settings as needed, such as
during cloudy days or emergencies. The system's real-time monitoring capabilities
enhance street light management, ensuring optimal lighting conditions while
conserving energy.
TABLE OF CONTENTS

Chapter No. NAME Page No.

1. INTRODUCTION 1
1.1 Motivation 1
1.2 Problem Statement 2
1.3 Objective 2
1.4 Summary 3
2. LITERATURE SURVEY 5
3. SYSTEM REQUIREMENTS 7
4. SYSTEM DESIGN AND DEVELOPMENT 15
5. IMPLEMENTATION 18
6. TESTING 22
7. RESULTS 25
8. CONCLUSION AND FUTURE ENHANCEMENT 29
REFERENCES
List of Figures

Chapter No. Figure No. Description Page No.

3 Fig 3.1 ESP8266 7

Fig 3.2 Bulb 7

Fig 3.3 Breadboard 8

Fig 3.4 LDR 9

Fig 3.5 Battery 10

Fig 3.6 Relay 11

Fig 3.7 Arduino 12

Fig 3.8 ThingSpeak 13

4 Fig 4.1 Block Diagram 15

Fig 4.2 Circuit diagram 16

6 Fig 6.1 Components Setup 22

Fig 6.2 Output displayed on Serial monitor 24

7 Fig 7.1 When its daytime or environmental 25


light is high
Fig 7.2 When its nighttime or environmental 26
light is low
Fig 7.3 ThingSpeak server display 27

Fig 7.4 Excel sheet displaying the values 28


CHAPTER 1
INTRODUCTION
Streetlights are a significant source of energy consumption. Often, Streetlights still remain on
even when there’s nobody within the street. With the assistance of this IOT-Based streetlight
monitoring system, we will efficiently monitor and optimize the energy consumption of
streetlights. In this, streetlights are fitted with LDR sensors that can monitor the movement of
humans or vehicles in the street. If the sensor can catch any movement in the street, it signals
the microcontroller, which the turns on the streetlight. Similarly, if there’s movement in the
street, the microcontroller switches the light off. This way, a considerable amount of energy
are often saved. The daily lighting system has limited to only two ON and OFF options, and
is not effective, this type of operation results in power lose due to continued peak voltage. The
diversion of electricity from street lights is therefore one among the apparent power losses,
but with the utilization of automation, this leads to many new energy and money savings
method. LDR is employed as a sensor during this module. The aim is to provide an efficient
and energy-saving lighting system by determining the present lighting condition and changing
the lights accordingly. The circuit consists of a sensing component known as LDR, followed
by Relay. The input is given from the direct supply and the relay converts them to a required
voltage and then the switching on the lights takes place.

1.1 Motivation
Presently, in our country more than 28 million street lights are lit up during night consisting
mainly CFL, metal halides or sodium vapour lights. From several sources we found that the
demand of electricity usage to lit up street lights falls between 20% to 40% of the total energy
produced in our country. So as the need of the hour, even our government is considering to
implement LED technology to reduce this energy requirement to a much lower level. [1]. The
glitches faced by the street lights include:

• Lights not working: No reference data to find what is the number of lights that are not
working. The next point is that there is no record to understand which of the lights is working
or not and how long is the lifespan.

Dept. of ISE, BNMIT 2023-24 1


Smart Street Light System

• Stealing of electricity Electricity: stealing is a big issue in India. No statistics on the amount
of electricity used by a light every night is available and on a wider level there is no statistics
summarizing the amount of electricity that a phase is consuming.
• Redundant wastage: Inspite of the fact that it is a country with a shortage of electricity, the
conventional street lights lead to wastage of power due to unnecessary on time. This entail to
develop a system which understand and avoid electricity wastage in street lights.

1.2 Problem Statement

Implement a smart street lighting system leveraging IoT technologies to dynamically adjust
lighting levels based on real-time environmental conditions, aiming to optimize energy
consumption and enhance safety in urban environments.
In urban areas, conventional street lighting systems are inefficient, leading to unnecessary
energy consumption and high operational costs. The lack of adaptability results in lights being
on when not needed, contributing to light pollution and environmental impact. This project
aims to develop an intelligent and energy-efficient Smart Street Light System that
dynamically adjusts light status based on real-time conditions, incorporating sensors and data
analytics
Addressing the pressing need for sustainable and efficient urban lighting solutions, this project
aims to design, develop, and deploy a smart street lighting system powered by NodeMCU and
LDR technology. By harnessing the capabilities of IoT, the system will autonomously sense
ambient light levels using LDR sensors and intelligently control LED illumination, effectively
reducing energy consumption, minimizing environmental impact.

1.3 Objectives
Energy Efficiency: Implement an automated lighting system that optimizes energy usage by
activating LED lights only when ambient light levels are low, thus reducing overall energy
consumption.

Sustainability: Contribute to environmental sustainability by reducing carbon emissions


associated with traditional street lighting systems through efficient energy management.

Dept. of ISE, BNMIT 2023-24 2


Smart Street Light System

Cost Reduction: Decrease operational costs for municipalities and organizations responsible
for street lighting by minimizing unnecessary energy expenditure during daylight hours.

Safety Enhancement: Enhance safety for pedestrians and motorists by ensuring adequate
illumination during dark hours, thereby reducing the risk of accidents and improving overall
visibility.

Automation: Implement a fully automated system that eliminates the need for manual
intervention in controlling street lights, enhancing operational efficiency and convenience.

IoT Integration: Demonstrate the integration of IoT technology to enable real-time


monitoring and control of street lighting systems, facilitating remote management and
diagnostics.

Scalability: Design a scalable solution that can be easily adapted and deployed in various
urban environments, accommodating different lighting requirements and infrastructure
configurations.

Reliability: Develop a robust and reliable system that can withstand environmental factors
and operate seamlessly under varying conditions to ensure continuous and uninterrupted
lighting functionality.

Stakeholder Engagement: Engage stakeholders, including local authorities, residents, and


businesses, to gather feedback and support for the implementation and adoption of smart street
lighting solutions.

Innovation Showcase: Showcase innovative use of NodeMCU and LDR technology to


inspire further advancements in smart city initiatives and promote the adoption of sustainable
urban development practices.

1.4 Summary

The smart street light project, employing NodeMCU and LDR technology, aims to address the
challenges associated with traditional urban lighting systems by introducing a novel, energy-

Dept. of ISE, BNMIT 2023-24 3


Smart Street Light System

efficient, and automated solution. The project's primary objective is to optimize energy usage
by activating LED lights only when ambient light levels indicate darkness, thus reducing
overall energy consumption and minimizing associated costs. This approach contributes
significantly to sustainability efforts by mitigating carbon emissions and promoting eco-
friendly practices.

Moreover, the project prioritizes safety by ensuring adequate illumination during dark hours,
thereby enhancing visibility for pedestrians and motorists and reducing the risk of accidents.
The system's automation capabilities eliminate the need for manual intervention in controlling
street lights, enhancing operational efficiency and convenience for maintenance personnel.
Key features of the project include the integration of IoT technology, which enables real-time
monitoring and control of street lighting systems. This allows for remote management and
diagnostics, improving system reliability and facilitating proactive maintenance. Additionally,
the project emphasizes scalability, ensuring that the solution can be easily adapted and
deployed in various urban environments with different lighting requirements and
infrastructure configurations.

Stakeholder engagement is a crucial aspect of the project, as it involves collaborating with


local authorities, residents, and businesses to gather feedback and support for the
implementation and adoption of smart street lighting solutions. By showcasing innovative use
of NodeMCU and LDR technology, the project aims to inspire further advancements in smart
city initiatives and promote the adoption of sustainable urban development practices on a
broader scale.

In summary, the smart street light project using NodeMCU and LDR technology represents a
comprehensive approach to modernizing urban lighting systems. By prioritizing energy
efficiency, sustainability, safety, scalability, and stakeholder engagement, the project aims to
contribute to the creation of smarter, greener, and more livable cities.

Dept. of ISE, BNMIT 2023-24 4


Smart Street Light System

CHAPTER 2
LITERATURE SURVEY

[1] K. H. Bachanek, B. Tundys, T. Wiśniewski, E. Puzio, and A. Maroušková, “Intelligent


street lighting in a smart city concepts

Description-This report may provide insights into various concepts and strategies related to
intelligent street lighting, which could include the use of sensors, automation, and data
analytics to enhance energy efficiency, optimize lighting levels based on environmental
conditions or human activity, improve safety, and reduce operational costs. Additionally, it
may discuss the integration of these intelligent lighting systems into broader smart city
initiatives aimed at enhancing overall urban functionality and sustainability.

[2] Z. Chen, C. B. Sivaparthipan, and B. A. Muthu, “IoT based smart and intelligent
smart city energy optimization,” Sustainable Energy Technologies and Assessments.
Description-This report may delve into the utilization of IoT devices and sensors to collect
real-time data on energy consumption patterns, infrastructure performance, and environmental
factors. By leveraging this data, the report may discuss strategies for enhancing energy
efficiency, reducing wastage, and improving overall sustainability in urban environments. The
focus could be on smart city initiatives aimed at integrating IoT solutions into energy
management systems to achieve intelligent energy optimization and contribute to more
sustainable and resilient urban development.

[3] K. A. Kabir, P. L. Sikdar, and P. K. G. Thakurta, “Energy efficient street


lighting
Description-This report may discuss various approaches to reducing energy consumption in
street lighting, such as the use of LED lighting, smart lighting controls, motion sensors, and
advanced lighting management systems. It may also analyze the potential benefits of energy-
efficient street lighting, including cost savings, reduced environmental impact, and improved
visibility and safety in urban areas.

Dept. of ISE, BNMIT 2023-24 5


Smart Street Light System

[4] D. K. Srivatsa, B. Preethi, R. Parinitha, G. Sumana and A. Kumar, “Street Lightning


System”
Description-This report may discuss the integration of advanced technologies such as Internet
of Things (IoT), sensors, and automation to create a smart street lighting infrastructure. It could
delve into topics such as adaptive lighting control, energy efficiency optimization, remote
monitoring and management, as well as the potential socio-economic and environmental
impacts of deploying such systems in urban environments.

[5] Y. M. Yusoff, R. Rosli, M. U. Karnaluddin and M. Samad: ”Smart technology for


Street Light
Description-This report may discuss the design and deployment of sensors or meters
integrated into street lights to monitor factors such as energy consumption, light intensity, and
operational status. It could explore how data collected from these meters can be utilized for
various purposes, such as optimizing energy usage, detecting faults or malfunctions in the
lighting system, and facilitating predictive maintenance.

Dept. of ISE, BNMIT 2023-24 6


Smart Street Light

CHAPTER 3
SYSTEM REQUIREMENTS
3.1 Hardware requirements
3.1.1: ESP8266

Fig 3.1- ESP8266

In a smart street light system is employed for automatic light control based on ambient light
levels, ensuring lights turn on in darkness and off during the day without requiring
manual intervention. This will be the brain of your project, responsible for gathering data from
the LDR sensor and controlling the LED. Utilize the Arduino IDE or another suitable
development environment to write the code for your ESP8266.Implement a program that reads
the analog value from the LDR sensor. This value will be higher in bright light and lower in
darkness.Based on the LDR reading, determine a threshold value that indicates whether it's
dark or light.Write logic to control the LED. If the LDR reading falls below the threshold, turn
on the LED; otherwise, turn it off. Implement a loop to continuously monitor the LDR sensor
and adjust the LED accordingly.

Dept. of ISE, BNMIT 2023-24 7


Smart Street Light

3.1.2: Bulb

Fig 3.2- Bulb

In smart street light systems use LDR sensors to automatically turn on in the dark and off
during the day, optimizing energy efficiency without manual intervention. In the smart street
light project utilizing an ESP8266 microcontroller, the traditional LED light source can be
replaced with a bulb by connecting it to a relay module or suitable transistor circuit controlled
by one of the digital output pins of the ESP8266. This modification allows the ESP8266 to
regulate the bulb based on ambient light levels sensedby the LDR sensor. The code logic
remains the same, with the ESP8266 toggling the digital output pin to turn the bulb on/off as
needed. It's crucial to select a bulb compatible with the power supply and outdoor applications
if deployed as a street light. Additionally, the power supply should accommodate the power
requirements of both the ESP8266 and the bulb, ensuring proper functionality and preventing
overheating or malfunctioning. After testing the system to ensure correct operation, it can be
deployed with appropriate weatherproofing and protection measures for outdoor use.

3.1.3: Bread board

Fig 3.3- Breadboard

Dept. of ISE, BNMIT 2023-24 8


Smart Street Light

It is used for prototyping and testing electronic circuits by providing a platform


for easily connecting and disconnecting components without soldering. In the smart street
light project using an ESP8266 microcontroller, an essential component such as the
breadboard facilitates the prototyping and testing phases of the project. The breadboard serves
as a platform for connecting various electronic components such as the ESP8266, LDR sensor,
relay module or transistor circuit, and power supply in a temporary and non-destructive
manner. This allows for easy experimentation with different circuit configurations and
component placements without the need for soldering. Specifically, the ESP8266 and other
components can be securely plugged into the breadboard, and jumper wires can be used to
establish connections between them according to the circuit diagram. Additionally, the
breadboard provides a stable base for the components during testing and development,
enabling quick modifications and troubleshooting. Therefore, the breadboard plays a crucial
role in facilitating the initial stages of the project by providing a versatile and user-friendly
platform for prototyping and testing the electronic circuitry before deployment.

3.1.4: LDR sensor

Fig 3.4- LDR

In a smart street light system detects ambient light levels, enabling automatic on/off control
by triggering lights to turn on in the dark and off in daylight without manual intervention. In
the smart street light project utilizing an ESP8266 microcontroller, the LDR (Light Dependent
Resistor) sensor plays a pivotal role in automatically adjusting the light output of the street
light based on ambient lighting conditions. The LDR sensor functions as a light detector,
varying its resistance based on the intensity of light falling on it. When it's dark, the resistance
of the LDR increases, and when it's bright, the resistance decreases. This property allows the

Dept. of ISE, BNMIT 2023-24 9


Smart Street Light

ESP8266 microcontroller to sense the ambient light levels by measuring the resistance of the
LDR. The ESP8266 then uses this information to determine whether to turn on or off the street
light. Specifically, when the ambient light levels detected by the LDR sensor fall below a
predefined threshold, indicating darkness, the ESP8266 activates the street light. Conversely,
when the ambient light levels rise above the threshold, indicating daylight, the ESP8266
switches off the street light to conserve energy. Therefore, the LDR sensor serves as a crucial
component in the smart street light project, enabling automatic light control based on
environmental conditions for enhanced energy efficiency and convenience.

3.1.5: Battery

Fig 3.5- Battery

In the smart street light project utilizing an ESP8266 microcontroller, a battery can be
integrated to provide power to the system in scenarios where a traditional power grid
connection is unavailable or impractical. The battery serves as a backup or primary power
source, ensuring continuous operation of the street light even during power outages or in
remote locations. The ESP8266, LDR sensor, and other components can be powered by the
battery through appropriate voltage regulation and management circuitry. Additionally, the
battery's capacity should be chosen to meet the power requirements of the system, taking into
account factors such as the power consumption of the ESP8266, LED or bulb, and any
additional components

Dept. of ISE, BNMIT 2023-24 10


Smart Street Light

3.1.6: Relay

Fig 3.6- Relay

In the smart street light project using an ESP8266 microcontroller, a relay can be employed as
a crucial component to control the power supply to the LED or bulb. The relay acts as a switch
that is controlled by the ESP8266, allowing it to turn the street light on or off based on the
ambient light levels detected by the LDR sensor. When the ESP8266 determines that it's dark
and the street light needs to be illuminated, it activates the relay, allowing electricity to flow
to the LED or bulb, thereby turning it on. Conversely, when the ESP8266 senses that it's bright
enough and the street light should be turned off to conserve energy, it deactivates the relay,
interrupting the power supply to the LED or bulb and turning it off. The relay serves as an
intermediary between the ESP8266 and the high-power LED or bulb, ensuring safe and
efficient control of the street light while preventing the microcontroller from directly handling
high voltage/current loads. This setup enhances the reliability and safety of the smart street
light project while facilitating seamless integration with the ESP8266 microcontroller for
automatic light control based on environmental conditions.

Dept. of ISE, BNMIT 2023-24 11


Smart Street Light

3.2 Software Requirements


3.2.1: Arduino

Fig 3.7- Arduino

In the smart street light project using an ESP8266 microcontroller, the Arduino software (IDE)
can be utilized for programming the ESP8266 and developing the firmware to control the
system. Here's how Arduino software plays a role in this project:

Programming Environment: The Arduino software provides an integrated development


environment (IDE) where you can write, compile, and upload code to the ESP8266
microcontroller. It offers a user-friendly interface with features like syntax highlighting, code
completion, and a serial monitor for debugging.

ESP8266 Board Support: The Arduino IDE supports programming ESP8266-based boards
like NodeMCU or ESP-01. You can easily add ESP8266 board support to the Arduino IDE by
installing the ESP8266 core using the Board Manager.

Writing Firmware: Using the Arduino programming language (based on C/C++), you can
write firmware for the ESP8266 that reads data from the LDR sensor, controls the relay to turn
the street light on/off based on ambient light levels, and handles other tasks such as Wi-Fi
connectivity for remote monitoring or control.

Libraries and Examples: Arduino software comes with a vast collection of libraries and
examples that can be used to simplify programming tasks. For example, you can find libraries

Dept. of ISE, BNMIT 2023-24 12


Smart Street Light

for interfacing with the ESP8266's Wi-Fi module, ADC (Analog-to-Digital Converter) for
reading analog sensor values, and controlling GPIO pins to interface with the relay.

Compiling and Uploading: Once you've written your firmware code, you can compile it within
the Arduino IDE to check for errors and generate the binary file. Then, you can upload the
compiled firmware to the ESP8266 microcontroller via USB or OTA (Over-The-Air)
programming, depending on your setup.

Debugging and Serial Monitoring: Arduino software provides tools for debugging your code
and monitoring the serial output of the ESP8266 microcontroller. This allows you to observe
sensor readings, debug code execution, and troubleshoot any issues during development or
testing.

Overall, the Arduino software serves as a powerful tool for developing the firmware for the
smart street light project using an ESP8266 microcontroller. It offers a familiar and easy-to-
use environment for writing code, compiling firmware, and uploading it to the microcontroller,
making it an ideal choice for IoT projects like this.

3.2.2: Thing Speak

Fig 3.8- ThingSpeak

In the smart street light project using an ESP8266 microcontroller, ThingSpeak can be used as
an IoT platform to collect, analyze, and visualize data from the project. Here's how
ThingSpeak software can be integrated into the project:

Dept. of ISE, BNMIT 2023-24 13


Smart Street Light

Data Logging: ThingSpeak provides APIs (Application Programming Interfaces) that allow
the ESP8266 microcontroller to send data to ThingSpeak servers over the internet. This
enables real-time logging of data such as ambient light levels sensed by the LDR sensor, street
light status (on/off), and other relevant parameters.

Visualization: ThingSpeak offers built-in tools for visualizing data in the form of graphs,
charts, and gauges. This allows you to monitor trends and patterns in ambient light levels and
street light usage over time. You can customize the visualizations to suit your specific project
requirements.

Data Analysis: ThingSpeak provides capabilities for performing basic data analysis on the
collected data. You can set up MATLAB® Analysis to perform more advanced analytics if
needed. This can help in gaining insights into the performance of the street light system and
identifying potential areas for improvement.

Alerts and Notifications: ThingSpeak allows you to set up alerts and notifications based on
predefined conditions. For example, you can configure alerts to notify you when the street
light malfunctions or when certain thresholds for ambient light levels are exceeded.

Integration with Other Services: ThingSpeak can be integrated with other IoT platforms,
services, and applications through its APIs. This allows for seamless integration with existing
IoT ecosystems or third-party services for additional functionality or automation.

Remote Monitoring and Control: With ThingSpeak, you can remotely monitor the status of
the street light system and even control it if needed. For example, you can remotely toggle the
street light on/off based on specific conditions or user commands.

Overall, integrating ThingSpeak software into the smart street light project enhances its
capabilities by providing real-time data logging, visualization, analysis, and remote
monitoring/control functionalities. This allows for better management, optimization, and
automation of the street light system while leveraging the power of IoT technology

Dept. of ISE, BNMIT 2023-24 14


CHAPTER 4

SYSTEM DESIGN AND DEVELOPMENT

Fig 4.1- Block diagram

Dept. of ISE, BNMIT 2023-24 15


Smart Street Light System

Fig 4.2- Circuit diagram

Dept. of ISE, BNMIT 2023-24 16


Smart Street Light System

METHODOLOGY
Our project uses ESP8266, bulb, breadboard, LDR sensors, Batteries and Relay. We put the
code in Arduino and connect all the components to the esp8266 to their respective pins.
LDR sensors are installed to the street light. When the sunlight falls on it, LDR sensed the
light intensity of the surrounding and returns an integer value. Based on the
returned signal, the LED’s are turned on and off. After LDR senses and detects, if the
surrounding light intensity is high then we send a signal such that LED switches OFF and if
the light intensity of the surrounding is low then LED switches ON. The same data
is shown on the ThingSpeak server and Serial monitor. We link the esp32 board to the
ThingSpeak server. We install LDR sensors in each Street light so that the each sensor detects
and operated accordingly. This reduces manual work and increases efficiently and cost
utilisation. After the LDR sensor detects low intensity of light it sends a signal to bulb, and
the bulb glows. If its day time, the serial monitor shows that “It’s day time, Turn Off the
Light:”, if its dark, the serial monitor shows that “Its Night time, Turn On the Light”.

The ThingSpeak is a backend server where we can operate and see the data management from
there. This server consists of three components, the Field chart which consists of a graph. This
graph has LDR value on y-axis and the time on x-axis. This graph updates us with the value
of LDR at a particular time. This is very helpful in street light monitoring.

Its also consists of Light control where one can manually switch ON or OFF the bulb of the
street light. This feature is very helpful in case of cloudy days, where the administrator need
to manually switch on the blubs, or any other case when light is needed.

It also consists of LDR chart where it shows the current LDR value. This value keeps updating
whenever we click the update button, it also shows a indication which says, how many minutes
or hours back is the value displayed which was updated previously.

Dept. of ISE, BNMIT 2023-24 17


CHAPTER 5
IMPLEMENTATION
1. ESP8266 Module:
• The ESP8266 is a Wi-Fi enabled microcontroller widely used in IoT projects.
• It provides built-in Wi-Fi connectivity, making it suitable for applications requiring internet
connectivity.
• The ESP8266 can be programmed using the Arduino IDE or other compatible development
environments.
• It can read data from sensors, control peripherals, and communicate with other devices or
platforms over Wi-Fi.

2. LDR Sensor Module:


• The LDR (Light Dependent Resistor) sensor is a passive electronic component that changes
resistance based on ambient light levels.
• It typically consists of a semiconductor material whose resistance decreases as the intensity of
light increases.
• LDR sensors are commonly used in light-sensitive applications such as street lights, outdoor
lighting, and automatic lighting systems.
• In this project, the LDR sensor provides analog input to the ESP8266, allowing it to detect
whether it's dark or bright.

3. Relay Module:
• A relay module is an electromechanical switch that uses an electromagnet to mechanically
open or close electrical contacts.
• It allows low-power microcontrollers like the ESP8266 to control high-power devices such as
LEDs, bulbs, or electrical appliances.
• A relay module typically consists of a control circuit (triggered by the microcontroller) and
one or more relay switches.

Dept. of ISE, BNMIT 2023-24 18


Smart Street Light System

• In this project, the relay module is used to switch the LED or bulb on/off based on commands
from the ESP8266.

4. Wi-Fi Module:
• While the ESP8266 itself includes Wi-Fi functionality, the Wi-Fi module in this context refers
to the ESP8266's ability to connect to a Wi-Fi network.
• The ESP8266 can be configured to connect to a local Wi-Fi network using SSID (Wi-Fi
network name) and password credentials.
• Once connected to Wi-Fi, the ESP8266 can communicate with other devices or platforms over
the internet, enabling remote monitoring and control.

5. ThingSpeak Integration Module:


• ThingSpeak is an IoT platform that allows users to collect, analyze, and visualize data from
connected devices.
• The ThingSpeak integration module in this project involves using ThingSpeak APIs to send
sensor data (e.g., ambient light levels) to a ThingSpeak channel for logging and visualization.
• It may also involve receiving commands from the ThingSpeak platform to control the street
light remotely, such as turning the light on/off based on specific conditions or user commands.

By combining these modules, the smart street light project achieves automatic light control
based on ambient light levels sensed by the LDR sensor, with the ESP8266 serving as the
central microcontroller for data processing and communication with other
modules and platforms.

Pseudo Code

1. Include necessary libraries: ESP8266WiFi.h, ESP8266HTTPClient.h, and ThingSpeak.h


2. Define Wi-Fi settings:
- ssid: WiFi network name (SSID)
- password: WiFi network password

3. Initialize WiFiClient object: client

Dept. of ISE, BNMIT 2023-24 19


Smart Street Light System

4. Define ThingSpeak settings:


- channelID: Your ThingSpeak Channel ID
- writeAPIKey: Write API key for your ThingSpeak Channel
- server: ThingSpeak server address
- checkTalkBackInterval: Time interval in milliseconds to check TalkBack commands
5. Define pin connections:
- ldrPin: Pin connected to the LDR sensor
- relayInput: Pin connected to the relay input for controlling the street light
6. Setup function:
a. Initialize serial communication with a baud rate of 9600
b. Set pin modes for relayInput and ldrPin
c. Connect to WiFi network using ssid and password
d. Begin ThingSpeak communication with the client
7. Loop function:
a. Read the LDR sensor value (ldrStatus) using analogRead on ldrPin
b. Update ThingSpeak field 1 with the ldrStatus value
c. Write fields to ThingSpeak channel using channelID and writeAPIKey
d. Check if ldrStatus indicates it's nighttime (ldrStatus <= 200):
- If true, turn on the street light by setting relayInput pin HIGH
- If false, turn off the street light by setting relayInput pin LOW
e. Check for TalkBack commands every checkTalkBackInterval milliseconds
f. Delay for 1 second before repeating the loop
8. checkLightControlTalkBack function:
a. Define talkBackAPIKey and talkBackID for the Light Control TalkBack
b. Define talkBackURL to construct the TalkBack API URL
c. Initialize HTTPClient object: http
d. Make a GET request to the TalkBack API using http.begin with talkBackURL
e. Check if the request was successful (httpCode > 0):

Dept. of ISE, BNMIT 2023-24 20


Smart Street Light System

- If true, get the TalkBack command response from http.getString()


- Check the received command:
- If the command is "TURN_ON", turn on the street light by setting relayInput pin HIGH
- If the command is "TURN_OFF", turn off the street light by setting relayInput pin LOW
- End the HTTP connection using http.end()
f. Flush serial communication and delay for 1 second

Dept. of ISE, BNMIT 2023-24 21


CHAPTER 6
TESTING

Fig 6.1-Components Setup


In Fig 6.1, the components are set for testing. Relay is connected to D5 digital pin of
ESP8266 and LDR is connected to A0 pin of ESP8266.

Dept. of ISE, BNMIT 2023-24 22


Smart Street Light System

Hardware Testing
Connectivity: Verify that all hardware components, including the ESP8266 module, LDR
sensor, relay module, and any additional peripherals, are properly connected according to the
circuit diagram.

Power Supply: Ensure that the power supply to the system is stable and provides the required
voltage and current to all components.

Sensor Calibration: Test the LDR sensor by exposing it to different light conditions (e.g.,
darkness and brightness) and observing its response. Verify that it accurately detects changes
in ambient light levels.

Software Testing
Firmware Upload: Upload the firmware code to the ESP8266 microcontroller using the
Arduino IDE or another compatible development environment.
Serial Output: Monitor the serial output from the ESP8266 to verify that it connects to the
Wi-Fi network successfully, reads data from the LDR sensor, and sends data to ThingSpeak.
Automatic Light Control: Test the automatic light control logic by simulating different light
conditions (e.g., covering the LDR sensor to simulate darkness and exposing it to light). Verify
that the LED or bulb turns on/off accordingly.
ThingSpeak Integration: Check if the ESP8266 successfully sends data to the ThingSpeak
channel and if any commands received from ThingSpeak are correctly interpreted to control
the street light.
ThingSpeak Testing:

ThingSpeak Testing

Data Logging: Verify that data sent from the ESP8266 is logged correctly on the ThingSpeak
channel. Check if the logged data matches the expected values based on ambient light levels.
Visualization: Access the ThingSpeak channel dashboard to visualize the logged data using
graphs, charts, or other visualizations. Ensure that the data is displayed accurately and is
updated in real-time.
Remote Control: Test the remote control functionality by sending commands from the
ThingSpeak platform to the ESP8266 to control the street light

Dept. of ISE, BNMIT 2023-24 23


Smart Street Light System

Integration Testing:
System Integration: Test the integrated system as a whole by verifying that the hardware
components and software modules work together seamlessly to achieve the desired
functionality.
Reliability: Conduct stress tests and prolonged operation tests to ensure the reliability and
stability of the system under various conditions, such as fluctuating Wi-Fi connectivity or
changes in ambient light levels.

Fig 6.2-Output displayed on Serial monitor


In Fig 6.2, it shows how the output is displayed on the serial monitor when the code is run on
Arduino. When LDR detects light intensity less than 200, its indicted on the serial monitor
saying “Its Night time, Turn on the Light.” When LDR detects light intensity greater than 200,
then its printed as “Its day time, Turn off the light.” After the code is uploaded, this output is
generated 1000ms once that is every 1s once, LDR checks and is reflected on the screen.

Dept. of ISE, BNMIT 2023-24 24


CHAPTER 7
RESULTS

Fig 7.1- When its daytime or environmental light is high

In Fig 7.1, LDR detects a light intensity greater than 200. This suggests that there's a
predefined threshold value (200 in this case) against which the LDR's output is compared to
determine whether the light intensity is high or low. When the detected light intensity exceeds
the threshold (greater than 200), a message is printed on the Serial monitor. The message
states, "It's daytime, Turn OFF the light." This message likely serves as a notification or
instruction indicating that since it's already daytime and the ambient light is high, there's no
need for additional artificial light sources, hence the suggestion to turn off the light.
ThingSpeak is an Internet of Things (IoT) platform that allows users to collect, analyze, and
visualize data from sensors or other devices. In this scenario, ThingSpeak is used to display
the current value of the LDR (presumably the light intensity), as well as a graph showing how
the LDR value changes over time. This real-time data visualization can provide insights into
the fluctuation of light intensity in the environment.

Dept. of ISE, BNMIT 2023-24 25


Smart Street Light System

Fig 7.2- When its night time or environmental light is low

LDR detects a light intensity less than 200. This suggests that there's a predefined threshold
value (200 in this case) against which the LDR's output is compared to determine whether the
light intensity is high or low. When the detected light intensity is less than the threshold, a
message is printed on the Serial monitor. The message states, "It's nighttime, Turn ON the
light." This message likely serves as a notification or instruction indicating that since it's
already daytime and the ambient light is high, there's no need for additional artificial light
sources, hence the suggestion to turn off the light. ThingSpeak is an Internet of Things (IoT)
platform that allows users to collect, analyze, and visualize data from sensors or other devices.
In this scenario, ThingSpeak is used to display the current value of the LDR (presumably the
light intensity), as well as a graph showing how the LDR value changes over time. This real-
time data visualization can provide insights into the fluctuation of light intensity in
the environment.

Dept. of ISE, BNMIT 2023-24 26


Smart Street Light System

Fig 7.3-ThingSpeak server display

In Fig 7.3, ThingSpeak displays three components. First one is the graph, which displays the
LDR verses time graph, which represents the value of LDR at a particular time. There is a
manual button provided, where one can manually switch ON or OFF the street light in some
cases. A LDR value displayer where it displays the current detected LDR value.

Dept. of ISE, BNMIT 2023-24 27


Smart Street Light System

Fig 7.4- Excel sheet displaying the values

The ThingSpeak lets us to download the data into a excel sheet where it shows the data such
as the time at which LDR value was measured, LDR value at that time and the entry_id field
number.

Dept. of ISE, BNMIT 2023-24 28


CHAPTER 8
CONCLUSION AND FUTURE ENHANCEMENT
Conclusion
In conclusion, the smart street light project utilizing an ESP8266 microcontroller, LDR sensor,
relay module, and ThingSpeak integration demonstrates an effective solution for automatic
light control based on ambient light levels. By leveraging the capabilities of these components
and platforms, the project achieves the following objectives:

1. Energy Efficiency: The project optimizes energy usage by automatically switching the street
light on/off based on detected ambient light levels. This reduces energy consumption during
daylight hours and ensures illumination when needed during darker periods.
2. Remote Monitoring and Control: Integration with ThingSpeak enables remote monitoring
of ambient light levels and street light status. Additionally, the project supports remote control
functionalities, allowing users to manually toggle the street light state if necessary.
3. Data Logging and Analysis: The project utilizes ThingSpeak for data logging, providing
valuable insights into ambient light trends and street light usage over time. This data can be
analyzed to optimize lighting strategies, identify patterns, and enhance overall system
performance.
4. Reliability and Automation: Through robust hardware components and software logic, the
project ensures reliable and automated operation of the street light system. The ESP8266
microcontroller effectively processes sensor data, controls the relay module, and
communicates with external platforms for seamless integration.

Future Enhancement

1. Adaptive Lighting Control: Implement advanced algorithms to dynamically adjust street


light intensity based on real-time environmental factors such as traffic flow, weather
conditions, and pedestrian activity. This could enhance energy efficiency and improve safety
in varying scenarios.

Dept. of ISE, BNMIT 2023-24 29


Smart Street Light System

2. Fault Detection and Diagnostics: Integrate additional sensors or mechanisms for fault
detection and diagnostics to identify and address issues such as bulb failure, sensor
malfunction, or connectivity problems. This would enhance system reliability and reduce
maintenance downtime.
3. User Interface Development: Create a user-friendly interface, such as a web-based
dashboard or mobile application, to allow users to monitor street light status, configure
settings, and receive alerts or notifications. This enhances user interaction and facilitates
remote management of the system.
4. Integration with Smart City Infrastructure: Explore opportunities to integrate the smart
street light system with broader smart city initiatives and infrastructure. This could involve
interoperability with other IoT devices, municipal networks, or urban planning platforms to
optimize city services and resource allocation.

Overall, the smart street light project presents a scalable and adaptable solution for
modernizing urban lighting infrastructure while promoting energy efficiency, sustainability,
and smart city development. Continued innovation and enhancement can further elevate its
impact and effectiveness in addressing evolving urban challenges.

Dept. of ISE, BNMIT 2023-24 30


REFERENCES
[1] K. H. Bachanek, B. Tundys, T. Wiśniewski, E. Puzio, and A. Maroušková, “Intelligent street
lighting in a smart city concepts.

[2] Z. Chen, C. B. Sivaparthipan, and B. A. Muthu, “IoT based smart and intelligent smart city
energy optimization,” Sustainable Energy Technologies and Assessments

[3] K. A. Kabir, P. L. Sikdar, and P. K. G. Thakurta, “Energy efficient street


lighting: a GIS approach

[4] D. K. Srivatsa, B. Preethi, R. Parinitha, G. Sumana and A. Kumar: “Power usage and brilliance
of the streets”.

[5] Y. M. Yusoff, R. Rosli, M. U. Karnaluddin and M. Samad: Paper helped us in learning how
to control the light intensity of the LEDs

You might also like