loading

ABSTRACT

Here i am going to do a automated outside light system with arduino.
this is a simple circuit you can make it easily. when you make this circuit and connect to your street light or outside light the light will automatically turn on in night and turn off in day.

REQUIRED COMPONENTS

1) Arduino UNo or any other arduino development boards

2) One 5 V relay

3) One LDR

4) One LED

5) one resistor ( here i am using a variable resistor)

Step 1: CONNECT LDR

As written above here i am using a variable resistor.

1) Connect one terminal of the LDR to GND port of the arduino uno.

2) Connect the other terminal to the A0 port of the arduino uno.

3) Connect the one terminal of the resistor to A0 port of the arduino uno along with one terminal .

4) connect the another terminal of the resistor to +5V pin of the arduino uno.

upload the following program to the arduino uno and check the output value in serial monitor by placing the cicuit in both in some darkness and in day light. and note down the values.

int ldr=A0;

void setup() {

// put your setup code here, to run once:

pinMode(ldr,INPUT);

Serial.begin(9600);

}

void loop() {

// put your main code here, to run repeatedly:

int a=analogRead(ldr);

Serial.println(a);

delay(1000);

}

Enter the values with appropriate condition in the final code

Step 2: Connecting Relay With Arduino Uno

The relay is a device which switch a 230V supply with a 5V or a 12Vsignal from microprocessor or microcontroller. so i here uses a 5V relay which help me to turn on or off my outside light.

you should connect the relay by the following instructions

1) connect the vcc pin of the relay to +5V pin of the arduino uno.

2) connect the GND pin of the relay to GND pin of the arduino uno.

3) connect the IN pin of the relay to the digital pin 12 of the arduino uno ( you can use another digital pin of the arduino uno as you wish but you should change the pin numbor in the program)

4) connect the phase wire to the port in the relay as shown in the diagram

5) connect the bulb to the normally open port of the relay

Step 3: Connect the LED to Arduino Uno

This LED is used to know whether the circuit is ON or OFF. The +ve end of LED is connected to the 13 th pin of the arduino and the -ve pin of the LED is connected to the GND pin of the arduino uno.

POWER SUPPLY

The power supply to the board can be given by using batteries.

Step 4: CODE

int ldr=A0;

int led=13;

int rel=12;

void setup() {

// put your setup code here, to run once:

pinMode(ldr,INPUT);

pinMode(led,OUTPUT);

pinMode(rel,OUTPUT);

}

void loop() {

// put your main code here, to run repeatedly:

digitalWrite(led,HIGH);

int a=analogRead(ldr);

if(a<value){

digitalWrite(rel,HIGH);

}

else{

digitalWrite(rel,LOW);

}

}

make these circuit in a box and connect a switch to the circuit (so you can switch the whole circuit ) and connect this circuit to your outside light and enjoy automatic outside light . make sure that the ldr is visible to day light then only it can sense.

<p>Nice gadget build, and has an actual use which is always a bonus!</p>

About This Instructable

2,639views

23favorites

License:

More by ajithbhaskaran:AUTOMATED OUTSIDE LIGHT 
Add instructable to: