0% found this document useful (0 votes)
15 views4 pages

Smart IoT Street Light System Guide

The document outlines a project for a Smart Street Light System using NodeMCU, LDR sensors, and Adafruit IO for remote monitoring. It details the aim, required software and hardware, procedural steps for setup, and advantages of the system, emphasizing energy efficiency and automation. The project demonstrates a sustainable solution for urban lighting, with potential applications in smart cities and industrial areas.

Uploaded by

22eg104d51
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views4 pages

Smart IoT Street Light System Guide

The document outlines a project for a Smart Street Light System using NodeMCU, LDR sensors, and Adafruit IO for remote monitoring. It details the aim, required software and hardware, procedural steps for setup, and advantages of the system, emphasizing energy efficiency and automation. The project demonstrates a sustainable solution for urban lighting, with potential applications in smart cities and industrial areas.

Uploaded by

22eg104d51
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Name: N.

TEJASRI Date: 03 / 03 / 2025


Roll Number: 23EG504A08 Page No:

EMBEDDED SYSTEM & IOT

Smart Street Light System

AIM: To write a program on NODE MCU to adapaitvely control street light and send data into Adafruit,io cloud using
MQTT protocol.

SOFTWARE REQUIRED: Arduino IDE.

HARDWARE REQUIRED: Node MCU, [Link] Cloud , LDR sensor , led board , jumper wires.

THEORY:
This project demonstrates an IoT-based smart street light system using NodeMCU ESP8266, LDR (Light
Dependent Resistor), and LED. The system automatically turns the LED ON in the dark and OFF in bright light.
It also sends real-time LDR readings and LED status to Adafruit IO Cloud, enabling remote monitoring.
The implementation of smart lighting systems is crucial in modern cities to enhance energy efficiency and
reduce operational costs. Traditional street lighting systems operate based on pre-set timers, which may not
always align with actual lighting conditions. This can lead to unnecessary power consumption during daylight
hours or insufficient illumination at night. By integrating light-dependent sensors (LDR) and cloud-based IoT
platforms such as Adafruit IO, this project ensures dynamic control of street lighting based on real-time
environmental conditions.
Additionally, the remote monitoring feature provided by Adafruit IO allows city administrators or users to track
the performance of streetlights, analyze light patterns, and optimize operational efficiency. This setup
significantly reduces energy wastage, promotes sustainable urban development, and enhances public safety by
ensuring well-lit streets in darkness.

Embedded Systems & IOT Lab ECE Department Anurag University


Name: [Link] Date: 03 / 03 / 2025
Roll Number: 23EG504A08 Page No:

PROCEDURE:
Step 1: Setting Up the Hardware
1. Gather all required components.
2. Connect the LDR sensor to the A0 pin of the NodeMCU.
3. Connect the LED to D2 (GPIO4) of the NodeMCU with the cathode connected to GND.
4. Power the NodeMCU using a 5V USB adapter.
Step 2: Configuring Adafruit IO
1. Create an account at Adafruit IO.
2. Navigate to Feeds → Create two feeds: "LDR_Value" and "LED_Status".
3. Go to Dashboards → Create a new dashboard and add widgets for LDR & LED status.
4. Navigate to API Keys and copy your AIO Username and AIO Key.
Step 3: Writing and Uploading the Code
1. Open the Arduino IDE and install the necessary libraries (ESP8266WiFi, Adafruit MQTT).
2. Copy and paste the provided Arduino code into the IDE.
3. Replace Wi-Fi credentials and Adafruit IO credentials in the code.
4. Select NodeMCU 1.0 as the board and upload the code to the NodeMCU.
Step 4: Testing and Monitoring
1. Open the Serial Monitor in Arduino IDE to check real-time LDR values.
2. Observe the LED turning ON/OFF based on ambient light.
3. Log in to Adafruit IO Dashboard and check if LDR readings & LED status are updated.
4. Test by covering/uncovering the LDR sensor and observing LED behavior.

SOURCE CODE:
#include <ESP8266WiFi.h>
#include "Adafruit_MQTT.h"
#include "Adafruit_MQTT_Client.h"

#define WIFI_SSID "Your_WiFi_SSID"


#define WIFI_PASS "Your_WiFi_Password"
#define AIO_SERVER "[Link]"
#define AIO_USERNAME "Your_Adafruit_IO_Username"
#define AIO_KEY "Your_Adafruit_IO_Key"

WiFiClient client;
Adafruit_MQTT_Client mqtt(&client, AIO_SERVER, 1883, AIO_USERNAME, AIO_KEY);

Adafruit_MQTT_Publish ldrFeed = Adafruit_MQTT_Publish(&mqtt, AIO_USERNAME "/feeds/LDR_Value");


Adafruit_MQTT_Publish ledFeed = Adafruit_MQTT_Publish(&mqtt, AIO_USERNAME "/feeds/LED_Status");

const int ldrPin = A0; // LDR connected to A0


const int ledPin = D2; // LED connected to D2

Embedded Systems & IOT Lab ECE Department Anurag University


Name: [Link] Date: 03 / 03 / 2025
Roll Number: 23EG504A08 Page No:

int threshold = 500; // Adjust based on LDR sensitivity

void connectWiFi() {
[Link]("Connecting to WiFi...");
[Link](WIFI_SSID, WIFI_PASS);
while ([Link]() != WL_CONNECTED) {
delay(500);
[Link](".");
}
[Link](" Connected!");
}

void connectMQTT() {
while ([Link]() == false) {
[Link]("Connecting to Adafruit IO...");
if ([Link]()) {
[Link](" Connected!");
} else {
[Link](" Failed. Retrying...");
delay(2000);
}
}
}

void setup() {
[Link](115200);
connectWiFi();
pinMode(ledPin, OUTPUT);
}

void loop() {
connectMQTT();

int ldrValue = analogRead(ldrPin);


[Link]("LDR Value: ");
[Link](ldrValue);

bool ledStatus;
if (ldrValue < threshold) {
digitalWrite(ledPin, HIGH); // Turn ON LED in darkness
ledStatus = 1;
} else {
digitalWrite(ledPin, LOW); // Turn OFF LED in brightness
ledStatus = 0;
}

// Publish LDR and LED data to Adafruit IO


if (![Link](ldrValue)) {
[Link]("Failed to send LDR value");
}
if (![Link](ledStatus)) {
[Link]("Failed to send LED status");
}

delay(15000); // Send data every 15 seconds


}

Embedded Systems & IOT Lab ECE Department Anurag University


Name: [Link] Date: 03 / 03 / 2025
Roll Number: 23EG504A08 Page No:

Advantages:

1. Energy Efficiency: Reduces power consumption by turning on lights only when needed.
2. Remote Monitoring: Enables real-time tracking of streetlights via Adafruit IO.
3. Cost-Effective: Requires minimal components and low maintenance.
4. Automation: Eliminates manual switching and enhances reliability.
5. Scalability: Can be extended with motion sensors, solar panels, and advanced analytics.

Applications

1. Smart Cities: Used for intelligent street lighting in urban areas.


2. Parking Lots: Provides automated lighting control based on ambient light.
3. Highways & Roads: Ensures safety and visibility during nighttime.
4. Gardens & Pathways: Suitable for outdoor lighting automation.
5. Industrial Areas: Enhances energy savings in factories and warehouses.

RESULT:

NodeMCU-based Smart Street Light System is an automatic, energy-efficient IoT lighting solution. It ensures
optimized energy consumption by automating streetlights based on real-time light intensity. The integration
with Adafruit IO enables remote monitoring, making it a smart and sustainable solution for urban infrastructure.
This system can be further enhanced with motion sensing, cloud analytics, and solar energy for broader
applications.

Embedded Systems & IOT Lab ECE Department Anurag University

Common questions

Powered by AI

The system can be enhanced by integrating motion sensors, cloud analytics, and solar energy solutions. Motion sensors allow for more targeted lighting control, turning lights on only when movement is detected, further increasing energy savings. Cloud analytics provide advanced insights into usage patterns, helping in predictive maintenance and better resource allocation. Solar energy integration transforms the system into a self-sustaining one, ideal for remote or off-grid locations, broadening its application scope in smart city infrastructure, gardens, highways, industrial areas, and more .

Automation in the smart street light system significantly enhances public safety by ensuring that streets are always well-lit when needed, reducing the risk of accidents or crime in poorly illuminated areas. In terms of energy consumption, automation ensures lights are only on during dark conditions, thus significantly minimizing wasted energy and lowering operational costs. This balance between safety and efficiency highlights the relevance of automation in modern urban environments .

To configure Adafruit IO for a smart street light system, first, create an account on Adafruit IO. Then, navigate to Feeds to create two feeds named 'LDR_Value' and 'LED_Status'. Next, go to Dashboards to create a new dashboard and add widgets for these feeds. Finally, go to API Keys and copy your AIO Username and AIO Key, which are necessary for integrating with the NodeMCU .

The document describes remote monitoring as a key facilitator of operational efficiency in smart cities. Through platforms like Adafruit IO, real-time data on street lighting allows administrators to monitor performance remotely, ensuring lights are functioning optimally, promptly addressing any issues, and preventing energy wastage. This level of control helps in the efficient allocation of resources and enhances the reliability and sustainability of urban lighting infrastructure .

The key components required for building an IoT-based smart street light system include a NodeMCU ESP8266, an LDR (Light Dependent Resistor), an LED board, jumper wires, and access to the Adafruit.io Cloud. The system also utilizes the MQTT protocol for data transmission .

The real-time data about light intensity is used to automatically turn the LEDs on or off depending on the ambient light detected by the LDR sensor. This data, along with the current status of the LED, is sent to the Adafruit IO Cloud via the MQTT protocol. This enables remote monitoring, where city administrators or users can track street light performance, analyze light patterns, and make adjustments to optimize operational efficiency .

Integration of LDR sensors allows streetlights to adaptively control themselves by turning on during darkness and off in bright conditions. IoT platforms like Adafruit IO enable real-time monitoring and control over streetlights, helping to ensure that lighting is only used when needed, thereby reducing power consumption and operational costs. This dynamic control based on real-time conditions prevents energy wastage and enhances urban sustainability .

Including a cloud-based platform such as Adafruit IO enhances the scalability of a smart street lighting system by facilitating the easy addition of new components and features, such as additional sensors or analytics tools. The platform's ability to monitor, control, and analyze real-time data from multiple devices simultaneously allows the system to expand without losing efficiency, thus making it suitable for varying urban development scales .

The advantages include energy efficiency by reducing power consumption, remote monitoring capabilities via Adafruit IO, cost-effectiveness due to minimal components and low maintenance, automation that eliminates manual switching, and the scalability to integrate additional features such as motion sensors and solar panels .

Traditional street lighting systems are less efficient because they typically operate based on pre-set timers, which may not align with actual ambient lighting conditions. This misalignment leads to unnecessary power consumption during daylight or inadequate illumination at night. In contrast, the IoT-based system described uses real-time data from LDR sensors to dynamically control lighting, thus enhancing energy efficiency by aligning operation precisely with environmental light levels .

You might also like