Auotmatic Street Lights Control Using LDR and Arduino

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:

1) LDR

2)LED

3)4.7k Resistor

4)Bread Board

5)Connecting wires

6)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

// Program related to LDR and LED interfacing to Arduino

#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);

}

Copy and Paste the code in arduino new sketch folder later compile and upload the program as show in the images.

Please click on serial window, which is located top right corner of the Arduino IDE to view the results.

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.

Thanks,

TechPonder.

Share

Recommendations

  • PCB Contest

    PCB Contest
  • Make it Glow Contest 2018

    Make it Glow Contest 2018
  • Toys Contest

    Toys Contest

18 Discussions

0
None
manjuKR

Question 2 months ago on Introduction

led not glowing what to do please tell asap

0
None
ramesh798

4 months ago

tank you for sharing information :)

i found one web page it also give good info about diode

more about ldr

0
None
OulkarRD

Question 7 months ago

Sir please send me advantages and disadvantages and applications and circuit diagram of this project

0
None
OulkarRD

Question 7 months ago

Sir please send me advantages and disadvantages and applications and circuit diagram of this project

0
None
CGA1

7 months ago

thanx for sharing information with us

0
None
Addssingrox

Question 8 months ago on Step 2

What if we increase or decrease the threshold value of the LDR

0
None
Addssingrox

Question 8 months ago on Introduction

What if increase or decrease the threshold value for the LDR

0
None
npawar

12 months ago

In Auotmatic Street Lights Control Using LDR and Arduino I want to make it for 3 LEDs so , what should I do ?

What will be circuit diagram ?

What changes should be done in Program ?

0
None
suseeln

1 year ago

pllzee give the circutr diagram

0
None
GirivardhanV

1 year ago

can the connections be shown properly..please....

0
None
Kevin SunnyT

1 year ago

GUYS CAN ANONE PLS TELL ME HOW TO MAKE A BUZZER RING WITH A ULTASONIC SENNSOR AND LDR TOGETHER. I MEAN BUZZER SHOULD RING WHEN TRIGGERED BY LDR OR ULTRASONIC SENSOR

ULTRASONIC SHOULD TRIGGER WITHIN 2 M

AND LDR WHEN LASER IS REMOVED

PLS PLSPLS CN U HELP ME WITH THIS THIS IS URGENT

0
None
Ashworth3271

2 years ago

What if I have more than 1 streetlamp and will like to have delays in all ?

0
None
YashK31

2 years ago

Can you please explain the wiring for this project. The circuit diagram was a little confusing about the input/output jumpers

0
None
ArbabA1

3 years ago

thanks Good JOB...Keep it up and shares such types of Project circuits..

0
None
TechPonderD6equj5

Reply 3 years ago on Step 2

To my knowledge its correct, If u have any changes please let me know.

0
None
elelor

3 years ago on Introduction

I think you need to know more about other electronic devices, i found site where i read about diodes etc.
http://911electronic.com