Auotmatic Street Lights Control Using LDR and Arduino

Introduction: 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.

3 People Made This Project!

Recommendations

  • Game Design: Student Design Challenge

    Game Design: Student Design Challenge
  • For the Home Contest

    For the Home Contest
  • Big and Small Contest

    Big and Small Contest

20 Comments

0
kalyani.cc.66
kalyani.cc.66

Question 1 year ago on Step 2

Hi, in this project you are reading the voltage across 4.7k resistor.Instead I took a 1k resistor .if I take voltage across LDR as analog input , modified code accordingly the circuit works and led glows brightly when there is no light.If I take voltage across resistor as analog input with code being modified the circuit works but led doesn't glow bright.is there any relation between analog input voltage and digital output voltage?

1617182503397791057034.jpg1617182596017401585971.jpg
0
manjuKR
manjuKR

Question 4 years ago on Introduction

led not glowing what to do please tell asap

0
ramesh798
ramesh798

4 years ago

tank you for sharing information :)

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

more about ldr

0
OulkarRD
OulkarRD

Question 4 years ago

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

0
OulkarRD
OulkarRD

Question 4 years ago

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

0
CGA1
CGA1

4 years ago

thanx for sharing information with us

1
Addssingrox
Addssingrox

Question 4 years ago on Step 2

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

0
Addssingrox
Addssingrox

Question 4 years ago on Introduction

What if increase or decrease the threshold value for the LDR

0
npawar
npawar

5 years 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
suseeln
suseeln

5 years ago

pllzee give the circutr diagram

0
GirivardhanV
GirivardhanV

5 years ago

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

0
Kevin SunnyT
Kevin SunnyT

6 years 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
Ashworth3271
Ashworth3271

6 years ago

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

0
YashK31
YashK31

6 years ago

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

0
ArbabA1
ArbabA1

7 years ago

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

0
D6equj5
D6equj5

7 years ago on Step 2

A good idea although Is your circuit diagram correct?

0
TechPonder
TechPonder

Reply 7 years ago on Step 2

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

0
elelor
elelor

7 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