IONOTS

Automatic Urban lamp control

In this project, you will learn how to control an Urban lamp to turn ON automatically during NIghts and to turn OFF automatically on Day time.

Problem 

We daily turn ON urban lamp during night time and we forgot to switch it OFF most of the time’s and wasting lots of power.

Solution

Here we have a simple economical solution in order to control the light automatically. It monitors the intensity of sunlight and when the intensity is low during night time it turns on automatically.

Requirements:

5v power adapter
Arduino nano (or) Arduino Uno
connecting wires/jumper wires
LDR (Photoresistor) and 10 k resistor
a single channel relay module

Construction:

NOTE:  Common pin and NO/NC pins may vary according to the type of relay manufacturer

Make sure that LDR is placed to detect sunlight but not Lamp light.

Process:

Here we monitor the intensity of the sunlight and control the urban lamp accordingly. With LDR we measure the intensity of sunlight and when it reduces we activate the relay to turn on the lamp when it increases it turn off the lamp using Relay.

Code:

 

int sensorPin= A0; //read anolog value from sensor
int sensorValue = 0; //initialize sensor value to 0
int LAMP = 3; //relay to pin 3
void setup() {
pinMode(LAMP, OUTPUT);
Serial.begin(9600);
}
void loop() {
sensorValue = analogRead(sensorPin);
Serial.print('sensor value - ');
Serial.println(sensorValue);

if (sensorValue > 200){ // if intensity of sunlight is high turn off lamp
Serial.println("LAMP light OFF");
digitalWrite(LAMP, LOW);
delay(1000);
}
if(sensorValue < 100)
{
Serial.println("LAMP light ON"); // if intensity of sunlight is high turn on lamp
digitalWrite(LAMP,HIGH);
delay(1000);
}
Serial.print('Monitoring sun light');
delay(1000);
}


Share this post

Share on facebook
Share on twitter
Share on linkedin
Share on email
Share on whatsapp