ROHINI COLLEGE OF ENGINEERING AND
TECHNOLOGY
DEPARMENT OF ELECTRONICS AND COMMUNICATION
ENGINEERING
IoT BASED WEATHER ADAPTIVE STREET LIGHTING SYSTEM
TEAM MEMBERS:
I .AZEER LAL (Leader) 963320106027
A.ANANTH 963320106016
A.S.ABULIN SHIJO 963320106010
B.GODWIN 963320106049
Team ID NM2023TMID1158
IOT Based Weather Adaptive street Lighting
Project Name System
Faculty Mentor Name Dr.M.Reji
1. INTRODUCTION
1.1 Project Overview
1.2 Purpose
2. IDEATION & PROPOSED SOLUTION
2.1 Problem Statement Definition
2.2 Empathy Map Canvas
2.3 Ideation & Brainstorming
2.4 Proposed Solution
3. REQUIREMENT ANALYSIS
3.1 Functional requirement
3.2 Non-Functional requirements
4. PROJECT DESIGN
4.1 Data Flow Diagrams
4.2 Solution & Technical Architecture
4.3 User Stories
5. CODING & SOLUTIONING
5.1 Feature 1
5.2 Feature 2
5.3 Database Schema (if Applicable)
6. RESULTS
6.1 Performance Metrics
7. ADVANTAGES & DISADVANTAGES
7.1 Advantages
7.2 Disadvantages
8. CONCLUSION
9. FUTURE SCOPE
10. APPENDIX
10.1 Source Code
Team ID NM2023TMID1158
Project Name IOT Based Weather Adaptive street Lighting
System
1.INTRODUCTION
1.1 PROJECT OVERVIEW:
Internet of Things (IoT) represents a general concept for the ability of network
devices to sense and collect data from the world around us, and then share that
data across the internet where it can be processed and utilized for various
practical purposes in different aspects of life. The reach of loT based systems in
industrial areas is still limited, but it has huge potential.
The system is mainly used for smart and weather adaptive lighting in street
lights. The project is implemented with smart embedded system that controls
the street light based on detection of sunlight. During the night time the street
light gets automatically ON and during the day time it gets automatically OFF.
The ON/OFF can be accessed anywhere anytime through internet. A camera is
placed on top of the street light to track the actions performed on the road where
the footages are stored in a server. In addition to this, a panic button is placed on
the pole, in-case of any emergency or danger, the person in danger can press
this button which raises an alarm at the nearby police station. Whenever the
panic button is pressed, the footage at that time recorded by the camera is sent
directly to the cloud account. The access of the account is given to the particular
police station by which they can view the incident's spot. Each area's street
lights are connected to the particular area's police station and each of them has a
cloud accessible account. The manual operation using GSM technology is
completely eliminated. Thus the system is mainly designed to ensure safety and
to prevent energy wastage.
Team ID NM2023TMID1158
Project Name IOT Based Weather Adaptive street Lighting
System
1.2PURPOSE:
Whenever the sunlight is detected the light will be automatically madeOFF and
the same information can be accessed through internet, which can be made
ON/OFF using iot. The street light (ON OFF Status) can beaccessed from
anytime, anywhere through internet based on the real time system.
2.IDEATION AND PROPOSED SOLUTION
2.1 PROBLEM STAEMENT DEFINITION
Brightness (Road Luminance) depends on the light distribution of the luminaire,
the lumen output of the luminaire, the installation design of the street lighting,
and the reflective properties of the road surface. The higher the brightness level,
the better the lighting effect. It consumes large amount of electricity. Sometimes
it is an expensive process. During installation and maintenance, it may cause
traffic jam, etc. Riskof theft of the automatic street light system is relatively
higher since they are non-wired & are much expensive. Rechargeable batteries
of the automatic street light system are required to be replaced a few times.
Snow, dust or moisture can accumulate of PV panels which can hinder energy
production
Team ID NM2023TMID1158
Project Name IOT Based Weather Adaptive street Lighting
System
2.2 EMPATHY MAP CANVAS
Team ID NM2023TMID1158
Project Name IOT Based Weather Adaptive street Lighting
System
2.3 Ideation Phase Brainstorm & Idea Prioritization
Date 29 April 2023
Team ID NM2023TMID1158
Project Name IOT Based Weather Adaptive Street Lighting
System
Maximum Marks 4 Marks
Brainstorm & Idea Prioritization:
Brainstorming provides a free and open environment that encourages everyone within a team
to participate in the creative thinking process that leads to problem solving. Prioritizing
volume over value, out-of-the-box ideas are welcome and built upon, and all participants are
encouraged to collaborate, helping each other develop a rich amount of creative solutions.
IOT Based Weather Adaptive Street Lighting System:
Step-1: Team Gathering, Collaboration and Select the Problem Statement
Step-2: Brainstorm, Idea Listing and Grouping
Step-3: Idea Prioritization
Team ID NM2023TMID1158
Project Name IOT Based Weather Adaptive street Lighting
System
2.4 PROPOSED SOLUTION
S. Parameter Description
No.
1. Problem Statement (Problem to be Normal lighting systems are consume more energy because
solved)
The lights are not turned off when the lights are doesn’t needed.
And this lights (incandescent ,high pressure sodium, low
pressure sodium, mercury vapour) are emits CO2 and
greenhouse gases which makes the carbon footprint and this
affecting the earth environment.
2. Idea / Solution description Using IOT light system set schedules to ensure that lights are off
when they aren’t needed, controlling lights depends on the
weather (brightness-dim or high) and save money by switching
to more efficient LED bulbs. These lights have less carbon
emission. So, that it can be environment friendly.
3. Novelty / Uniqueness This IOT system can get information about the weather and the
lights controlled by according to that information.
4. Social Impact / Customer Satisfaction IOT lighting system is a cost-effective method, improving the
quality of life, reducing carbon footprints and reducing light
pollution and it also creates environmental awareness to people.
5. Business Model (Revenue Model) IOT helps organizations to collect a large number of users and
product information through the insights provided by IOT
solutions.
With these details businesses can improve customer experience
and increase the profit level of their organization.
6. Scalability of the Solution Using of this IOT lighting system power consumption of light is
less compared to normal lights and these systems emit less
greenhouse gases. Finally it’s provides the user the efficient life.
Team ID NM2023TMID1158
Project Name IOT Based Weather Adaptive street Lighting
System
3. REQUIRMENT ANALYSIS
3.1 Functional Requirements:
Following are the functional requirements of the proposed solution.
FR Functional Sub Requirement (Story / Sub-Task)
No. Requirement (Epic)
FR-1 User Registration Registration through Gmail
FR-2 User Confirmation Confirmation via Email
FR-3 User Login Sign up using the registered account
FR-4 Accept the Policies User read and accept the policies
FR-5 Transactions User if need premium account, user
processing must to purchase it
FR-6 Reporting If user find any difficult or bug or
crash, user can free to report
Team ID NM2023TMID1158
Project Name IOT Based Weather Adaptive street Lighting
System
3.2 Non-functional Requirements:
Following are the non-functional requirements of the proposed solution.
FR Non-Functional Requirement Description
No.
NFR-1 Usability Easily and effectively an IOT device can be used
by different end users
NFR-2 Security Security is the act of securing internet devices
and the networks they’re connected to from
threats and breaches by protecting, identifying
and monitoring risks
NFR-3 Reliability Making networks more secure against cyber
threats and intelligent edge-based data storage
and computation
NFR-4 Performance Simulate devices from different locations with
required network technologies like
2G,3G,4G,Bluetooth, etc.
NFR-5 Availability User can control the lights whenever they want,
and it can optimize the lights brightness
NFR-6 Scalability The ability to go from prototype to production in
a seamless way
Team ID NM2023TMID1158
Project Name IOT Based Weather Adaptive street Lighting
System
4. PROJECT DESIGN
4.1 DATA FLOW DIAGRAM
1. The Light Sensor detects the ambient light intensity.
2. The ESP32, a microcontroller board, collects data from the Light Sensor.
3. The ESP32 connects to the MQTT Broker, a messaging server.
4. The MQTT Broker receives the data from the ESP32 and publishes it to subscribed clients.
5. Node-RED, a visual programming tool, is used to create a flow that subscribes to the MQTT
Broker, processes the data, and performs actions based on the defined logic. It can integrate
with other services and devices.
6. The Node-RED Flow receives the data from the MQTT Broker and performs actions like
adjusting street lighting based on the ambient light intensity and weather conditions.
7. The IBM Watson IoT Platform acts as a hub for receiving and managing data from multiple
devices, including the ESP32.
8. The Data Storage component stores the collected data for further analysis and reporting
4.2 SOLUTION & TECHNICAL ARCHITECTURE
PROJECT OBJECTIVES
By the end of the project, you will:
• Gain knowledge of Watson IoT Platform
• Explore Wokwi Platform
• Explore the devices and its simulation of the wokwi platform.
• Explore the libraries present in Wokwi.
• Will be able to code to connect the devices across the cloud platform.
• Connecting the devices on wokwi to the IoT platform device to exchange the sensor data.
• Gain knowledge of creating devices and platforms using IBM Watson IoT Platform.
• Gain knowledge of web application development through node-red.
Team ID NM2023TMID1158
Project Name IOT Based Weather Adaptive street Lighting
System
4.3USER STORIES :
1. As a city administrator, I want the street lights to automatically adjust their brightness based
on the time of day, ensuring optimal lighting conditions during both daytime and nighttime
for pedestrians and drivers.
2. As a city administrator, I want the street lights to intelligently adapt to changing weather
conditions such as fog, rain, or snow, by automatically adjusting their brightness or pattern to
enhance visibility and improve safety on the roads.
3. As a pedestrian, I want the street lights to detect my presence and increase their brightness as
I approach, providing a well-lit pathway and ensuring my safety during night time walks.
4. As a driver, I want the street lights to brighten up when approaching an intersection or a
crosswalk, alerting me to potential hazards and improving visibility for both pedestrians and
other vehicles.
5. As an energy-conscious citizen, I want the street lights to utilize energy-efficient technologies
such as LED bulbs and smart sensors to minimize energy consumption during periods of low
activity or when sufficient natural light is available.
These user stories focus on the key aspects of a Weather Adaptive Street Lighting System, including
adaptive brightness based on time of day, weather conditions, pedestrian detection,
intersection/crosswalk illumination, and energy efficiency. They address the needs and expectations
of various stakeholders involved, aiming to enhance safety, visibility, and energy conservation in
urban environments.
Team ID NM2023TMID1158
Project Name IOT Based Weather Adaptive street Lighting
System
5.CODING & SOLUTIONING
5.1 FEATURE 1
o First define the LEDs into the program
o Setting LDR ranges, threshold, and brightness of the lights
o Credential of IBM Account
o First user need to create IBM cloud account
o Only IBM cloud user can simulate the IOT device
o After that user need to define credentials
o Define Device type, Device ID, and Token
o After the credentials user need to customized the values
This customization can depend on the user’s desire
#include <WiFi.h>
#include <PubSubClient.h>
#define LED 5
#define LED2 4
#define LED3 2
int LDR = 32;
int LDRReading = 0;
int threshold_val = 800;
int lEDBrightness = 0;
int flag = 0;
void callback(char* subscribetopic, byte* payload, unsigned int payloadLength);
// Credentials of IBM Accounts
#define ORG "6yocvj"
#define DEVICE_TYPE "streetlight"
#define DEVICE_ID "12345"
#define TOKEN "12345678"
// Customized values
char server[] = ORG ".messaging.internetofthings.ibmcloud.com";
char publishTopic[] = "iot-2/evt/Data/fmt/json";
char subscribetopic[] = "iot-2/cmd/test/fmt/String";
char authMethod[] = "use-token-auth";
char token[] = TOKEN;
char clientId[] = "d:" ORG ":" DEVICE_TYPE ":" DEVICE_ID;
5.2 FEATURE 2
o Creating WIFI client
o Setup which LEDs are turn ON/OFF, creating delay between the function of the lights
o If the clients connection is failed , then it reconnecting to the server and it have some
delay
o After the client connected to the server and the wifi status as CONNECTED
o After that lights are can be turned ON and OFF by user however they wants
WiFiClient wifiClient;
PubSubClient client(server, 1883, callback, wifiClient);
void setup()
Serial.begin(115200);
pinMode(LED, OUTPUT);
pinMode(LED2, OUTPUT);
pinMode(LED3, OUTPUT);
delay(10);
Serial.println();
wificonnect();
mqttconnect();
void loop()
if (!client.loop()) {
mqttconnect();
void mqttconnect()
if (!client.connected()) {
Serial.print("Reconnecting client to ");
Serial.println(server);
while (!client.connect(clientId, authMethod, token)) {
Serial.print(".");
delay(500);
initManagedDevice();
Serial.println();
void wificonnect()
Serial.println();
Serial.print("Connecting to ");
WiFi.begin("Wokwi-GUEST", "", 6);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
void initManagedDevice() {
if (client.subscribe(subscribetopic)) {
Serial.println(subscribetopic);
Serial.println("subscribe to cmd OK");
} else {
Serial.println("subscribe to cmd FAILED");
}
Team ID NM2023TMID1158
Project Name IOT Based Weather Adaptive street Lighting
System
6.RESULTS
6.1 Model Performance Testing:
Project team shall fill the following information in the performance testing template .
Parameter Values Screenshot
1) Weather
Sensor
2) IoT Platform
3) Connectivity
4) User
Interface
5) Node Red
Team ID NM2023TMID1158
Project Name IOT Based Weather Adaptive street Lighting
System
6. ADVANTAGES & DISADVANTAGES
7.1 ADVANTAGES
Solar street light is independent of grid as a result of this operating cost is much
low. Maintenance cost is much low compared to conventional street light.
• Intensity of LED can be controlled effectively without changes in its light
color.
• Risk of accidents is very low.
• It is environmental friendly, no harmful emissions
.• Longer life compared to conventional street lights.
• Power consumption is much lower.
• LDRs are sensitive, inexpensive and readily available devices. They have
good power
• and voltage handling capabilities, similar to those of a conventional resistor.
They are small enough to fit into virtually any electronic device and used all
around the world as a basis component in many electrical systems. Photo
resistors convert light into electricity and are not dependent on any other force.
• Photo resistors are simply designed and are made from materials that are
widely
• available, allowing hundreds of thousands of units to be produced each year.
A LDR may be connected either way round and no special precautions are
required when soldering.
Team ID NM2023TMID1158
Project Name IOT Based Weather Adaptive street Lighting
System
7.2 DISADVANTAGES
Initial investment is very high.
• Rechargeable batteries have to be replaced from time to time.
• Non-availability of sunlight during rainy and winter seasons is a problem.
• Dust accumulation on the surface of panel creates a problem.
• It is sensitive to ambient light and require careful shielding
.• Can be more complicated to align detector pairs.
• Photo resistors are only sensitive to light and no other force can power it
without risking damage. Also, they are unable to detect low light levels and
may take a few seconds to deliver a charge while their electrons build up
momentum.
Team ID NM2023TMID1158
Project Name IOT Based Weather Adaptive street Lighting
System
8.CONCLUSION
In conclusion, an IoT-based Weather Adaptive Street Lighting System
offers significant advantages and benefits for modern cities and urban
environments. By integrating sensors, connectivity, and intelligent
control algorithms, the system can dynamically adjust lighting levels
based on weather conditions, ambient light intensity, and other
relevant factors.
The merits of such a system include energy efficiency, cost savings,
environmental sustainability, enhanced safety, adaptive lighting,
remote monitoring and control, data analytics, scalability,
customization, and real-time alerts. These advantages contribute to
optimized energy usage, reduced operational costs, improved
visibility and safety, and a more sustainable and responsive urban
infrastructure.
Furthermore, the future scope of IoT-based Weather Adaptive Street
Lighting Systems holds promising opportunities for advancements.
These may include advanced data analytics, machine learning,
integration with smart city systems, wireless sensor networks,
renewable energy integration, edge computing, autonomous
maintenance, smart grid integration, and citizen engagement.
Overall, IoT-based Weather Adaptive Street Lighting Systems pave
the way for smarter, more efficient, and sustainable cities, enhancing
the quality of life for residents and promoting environmental
stewardship. With continued advancements and innovations, these
systems will play a crucial role in shaping the cities of the future.
Team ID NM2023TMID1158
Project Name IOT Based Weather Adaptive street Lighting
System
9.FUTURE SCOPE
The future scope of an IoT-based Weather Adaptive Street Lighting System includes several
possibilities for advancements and improvements:
1. Advanced Data Analytics: Further enhancement of data analytics capabilities to
derive more insights from sensor data, enabling better optimization of street lighting
operations and energy usage.
2. Machine Learning and AI: Integration of machine learning and artificial intelligence
algorithms to predict weather patterns, optimize lighting levels, and improve energy
efficiency based on historical and real-time data.
3. Smart City Integration: Integration with other smart city systems, such as traffic
management, public safety, and waste management, to create a comprehensive and
interconnected urban infrastructure.
4. Adaptive Control Algorithms: Development of more sophisticated control algorithms
that can dynamically adjust lighting levels based on multiple factors, such as
pedestrian density, traffic flow, and weather forecasts.
5. Wireless Sensor Networks: Implementation of wireless sensor networks for improved
scalability and ease of deployment, allowing for efficient expansion of the street
lighting system.
6. Renewable Energy Integration: Integration of renewable energy sources, such as solar
or wind power, to further reduce the environmental impact and dependency on the
electrical grid.
7. Edge Computing: Utilization of edge computing capabilities to process data locally at
the street lighting nodes, reducing latency and improving real-time responsiveness.
8. Autonomous Maintenance: Implementation of self-diagnostic and predictive
maintenance capabilities, allowing the system to identify and address maintenance
needs proactively, minimizing downtime and optimizing maintenance schedules.
9. Smart Grid Integration: Integration with smart grid infrastructure to enable demand
response capabilities and better energy management.
10. Citizen Engagement: Involvement of citizens through mobile applications and
interactive interfaces to provide feedback, report issues, and contribute to the overall
improvement of the street lighting system.
These future advancements can further enhance the performance, efficiency, and
functionality of IoT-based Weather Adaptive Street Lighting Systems, contributing to the
development of smarter, more sustainable, and safer cities.
Team ID NM2023TMID1158
Project Name IOT Based Weather Adaptive street Lighting
System
10. APPENDIX
10.1 Source Code
Program :
#include <WiFi.h>//library for wifi
#include <PubSubClient.h>//library for MQtt
const int photoresistorPin = 32;
const int waterSystemPin = 15;
#define LED 5
#define LED2 4
#define LED3 2
int LDR = 32;
int LDRReading = 0;
int threshold_val = 800;
int lEDBrightness = 0;
int flag=0;
void callback(char* subscribetopic, byte* payload, unsigned int
payloadLength);
//-------credentials of IBM Accounts------
#define ORG "2u4hay"//IBM ORGANITION ID
#define DEVICE_TYPE "PROJECT"//Device type mentioned in ibm watson IOT
Platform
#define DEVICE_ID "12345" //Device ID mentioned in ibm watson IOT Platform
#define TOKEN "10101010" //Token
String data3;
float h, t;
//-------- Customise the above values --------
char server[] = ORG ".messaging.internetofthings.ibmcloud.com";// Server Name
char publishTopic[] = "iot-2/evt/Data/fmt/json";// topic name and type of
event perform and format in which data to be send
char subscribetopic[] = "iot-2/cmd/test/fmt/String";// cmd REPRESENT command
type AND COMMAND IS TEST OF FORMAT STRING
char authMethod[] = "use-token-auth";// authentication method
char token[] = TOKEN;
char clientId[] = "d:" ORG ":" DEVICE_TYPE ":" DEVICE_ID;//client id
//-----------------------------------------
WiFiClient wifiClient; // creating the instance for wificlient
PubSubClient client(server, 1883, callback ,wifiClient); //calling the
predefined client id by passing parameter like server id,portand
wificredential
void setup()// configureing the ESP32
{
Serial.begin(115200);
pinMode(LED,OUTPUT);
pinMode(LED2,OUTPUT);
pinMode(LED3,OUTPUT);
delay(10);
Serial.println();
wificonnect();
mqttconnect();
}
void loop()// Recursive Function
{
if (!client.loop()) {
mqttconnect();
}
}
void mqttconnect() {
if (!client.connected()) {
Serial.print("Reconnecting client to ");
Serial.println(server);
while (!!!client.connect(clientId, authMethod, token)) {
Serial.print(".");
delay(500);
}
initManagedDevice();
Serial.println();
}
}
void wificonnect() //function defination for wificonnect
{
Serial.println();
Serial.print("Connecting to ");
WiFi.begin("Wokwi-GUEST", "", 6);//passing the wifi credentials to establish
the connection
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
}
void initManagedDevice() {
if (client.subscribe(subscribetopic)) {
Serial.println((subscribetopic));
Serial.println("subscribe to cmd OK");
} else {
Serial.println("subscribe to cmd FAILED");
}
}
void callback(char* subscribetopic, byte* payload, unsigned int payloadLength)
{
Serial.print("callback invoked for topic: ");
Serial.println(subscribetopic);
for (int i = 0; i < payloadLength; i++) {
//Serial.print((char)payload[i]);
data3 += (char)payload[i];
}
Serial.println("data: "+ data3);
if(data3=="lighton1")
{
Serial.println(data3);
digitalWrite(LED,HIGH);
else if(data3=="lightoff1")
{
Serial.println(data3);
digitalWrite(LED,LOW);
}
else if(data3=="lighton2")
{
Serial.println(data3);
digitalWrite(LED2,HIGH);
else if(data3=="lightoff2")
{
Serial.println(data3);
digitalWrite(LED2,LOW);
}
else if(data3=="lighton3")
{
Serial.println(data3);
digitalWrite(LED3,HIGH);
else if(data3=="lightoff3")
{
Serial.println(data3);
digitalWrite(LED3,LOW);
}
data3="";
}
Team ID NM2023TMID1158
Project Name IOT Based Weather Adaptive street Lighting
System
WOKWI CIRCUIT DIAGRAM :
SOURCE LINK : https://wokwi.com/projects/365169641316071425
NODE-RED DESIGN :
NODE-RED WEB SERVER :
IBM CLOUD DATA BASE :
IBM CONNECTIONS:
Organization ID : 2u4hay
Device Type : PROJECT
Device ID : 12345
Authentication Method : use-token-auth
Authentication Token : 10101010
IBM CLOUD API KEY :
OUTPUT :
DEMO VIDEO LINK :
https://drive.google.com/file/d/1hgpFWAc3oo8M6nc3a8Hb25EMGsLhN47T/vi
ew?usp=share_link