Auotmatic Street Lights Control Using LDR and Arduino

Published

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.

Share

Recommendations

  • Woodworking Contest

    Woodworking Contest
  • Casting Contest

    Casting Contest
  • Planter Challenge

    Planter Challenge
user

We have a be nice policy.
Please be positive and constructive.

Tips

4 Questions

0

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

0

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

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

What if increase or decrease the threshold value for the LDR

12 Comments

user

thanx for sharing information with us

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 ?

pllzee give the circutr diagram

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

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

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

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

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

A good idea although Is your circuit diagram correct?

1 reply

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

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