Project tutorial
Automatic Street Light Controller

Automatic Street Light Controller © Apache-2.0

The streetlight is controlled by using the LDR sensor.

  • 2,509 views
  • 4 comments
  • 7 respects

Components and supplies

Apps and online services

About this project

Automatic street light control is used to control the street lights(Turn on and off based on the light). Here we make use of LDR (Light Dependent Resistor) and LED(Light Emitting diode) and Arduino.

Hard Ware Components Required:

  • LDR
  • LED
  • 4.7k Resistor
  • Bread Board
  • Connecting wires
  • Arduino

LDR is used to detect the light, Arduino is used to on/off the Light. For LDR Basics and Principles Please go through the below link. http://www.electrical4u.com/light-dependent-resist...

For LED interfacing Please follow the below link. https://www.instructables.com/id/LED-blinking-using...

Hardware Connections:

  • Arduino 3rd pin connected to LED +ve
  • Arduino GND connected to LED -ve through 4.7k
  • Arduino +5v is connected to LDR One End
  • Arduino A0 pin is connected to LDR other end
  • Arduino GND is connected to LDR other end with 4.7k
  • Arduino

Step 1: Programming, Compiling and Uploading to Arduino

#include<SoftwareSerial.h>
int sensorPin=A0;
int sensorValue = 0;
int led = 3;
void setup() {
 pinMode(led, OUTPUT);
 Serial.begin(9600);
 // put your setup code here, to run once:
}
void loop() {
 Serial.println("Welcome to LDR tutorial");
 sensorValue = analogRead(sensorPin);
 Serial.println(sensorValue);
 if(sensorValue < 100)
 {
   Serial.println("LED light on");
   digitalWrite(led,HIGH);
   delay(1000);
 }
 digitalWrite(led,LOW);
 delay(sensorValue);
 // put your main code here, to run repeatedly:
}

Step 2: Results

Results are displayed on the serial window.

When there is low amount of light the light automatically glows and when there is sufficient amount of light it automatically turns off the light.

Here based on our room condition the threshold value we took is 100 for the LDR sensor.

When we place a hand on LDR(Not allowing any light on LDR) arduino automatically turns on the LED.

When we remove our hand on LDR. Arduino automatically Turns Off LED.

Code

automatic street light controllerArduino
#include <SoftwareSerial.h>

int sensorPin = A0; // select the input pin for the LDR

int sensorValue = 0; // variable to store the value coming from the sensor

int led = 3;

void setup() { // declare the ledPin as an OUTPUT:

pinMode(led, OUTPUT);

Serial.begin(9600); }

void loop()

{

Serial.println("Welcome to TechPonder LDR Tutorial");

sensorValue = analogRead(sensorPin);

Serial.println(sensorValue);

if (sensorValue < 100)

{

Serial.println("LED light on");

digitalWrite(led,HIGH);

delay(1000);

}

digitalWrite(led,LOW);

delay(sensorValue);

}

Custom parts and enclosures

automatic street light controller
Auto mzkejh1wnz

Schematics

automatic street light controller
Auto 7sd7sd1uxb

Comments

Similar projects you might like

Controlling LED light intensity using smartphone light senso

Project tutorial by Nikola Travis

  • 1,915 views
  • 0 comments
  • 3 respects

Portable - Non-Invasive Light Controller & More

Project tutorial by Emmanuel Garuz

  • 477 views
  • 0 comments
  • 2 respects

Fluid Level Indicator and Controller

Project tutorial by Rushabh Jain

  • 4,750 views
  • 8 comments
  • 20 respects

Anna: Alexa Powered Interactive Light

Project tutorial by vincent wong

  • 1,733 views
  • 0 comments
  • 7 respects

WIZnet S2E Light Control

Project tutorial by Team S2ELighting

  • 1,448 views
  • 0 comments
  • 7 respects
Add projectSign up / Login