In absence of human body Light is OFF automatically
In presence of human body Light is ON automatically
Today we will discuss on special type of controller circuit which will control a light in accordance with the presence of animal body. This circuit is used to save power by turning off a light source or a device in absence of any person (any animal). The main function of the circuit is divided into 3 portions.
1) PIR Sensor , 2) Arduino Controller and a 3) Switching Circuit.
1) PIR Controller:
PIR sensors allow us to sense motion, almost always used to detect whether a human has moved in or out of the sensors range. Out of the three terminal of the device one is used to get output and other two terminal are used to provide + 5 volt (Vcc) and ground respectively.
Output terminal produce a high or low value in accordance with the presence of human body. If there is any motion of human body output terminal goes high otherwise output of PIR sensor remain low.
2) Arduino controller:
Here we use an Arduino UNO board to control the circuit. Output of The PIR controller connected with digital data pin no D3 as a input to the controller.
Control instruction provided to the controller with Arduino programming. If pin number D3 goes high, then we have to make pin number D4 HIGH, which will switch on the relay. Add Delay to remain the situation for 60 seconds. Again, check the input D3 if it remains high output will be same. Repeat the process after 60 seconds. If D3 goes low output D4 have to be low. which turns the relay off.
3) Switching circuit:
Switching circuit consist of a magnetic relay of 5 volt. A light source is connected with men power source with the help of relay. Common terminal of the relay is connected with the light source. NO terminal is connected with the 220 volt AC Line terminal. Another terminal of the light source is directly connected with the neutral of the main supply.
When output of the controller D3 goes high relay connect light source with the main powered supply. When D3 goes low, relay disconnect light source from the main power supply.
In this way advance light control circuit control a light source in presence of human or in absence.
int RELAY=4;
int PIR=3;
int MOTION=LOW;
void setup()
{
pinMode(PIR,INPUT);
pinMode(RELAY,OUTPUT);
}
void loop()
{
MOTION=digitalRead(PIR);
if (MOTION==HIGH)
{
digitalWrite(RELAY,HIGH);
delay(2000);
digitalWrite(RELAY,LOW);
}
else
{
digitalWrite(RELAY,LOW);
}
}