DOOR LIGHT CONTROL SYSTEM

Photo of author

By Jackson Taylor

BLOCK DIAGRAM

Block Diagram

WORKING

Components used for this project are PIR Sensor, Hall effect sensor, Arduino (ATMEGA328) Controller, Relay, Power Supply.

P I R sensor s allow you to sense motion, almost always used to detect whether a human has moved in or out of the sensors range. They are small, inexpensive, low-power, easy to use and don’t wear out. For that reason they are commonly found in appliances and gadgets used in homes or businesses. They are often referred to as P I R, “Passive Infrared”, “Pyroelectric”, or “IR motion” sensors.

A Hall effect sensor is a transducer that varies its output voltage in response to a magnetic field. Hall effect sensors are used for proximity switching, positioning, speed detection, and current sensing applications.

In its simplest form, the sensor operates as analog transducer, directly returning a voltage. With a known magnetic field, its distance from the Hall plate can be determined. Using groups of sensors, the relative position of the magnet can be deduced.

Hardware Hack

Stop Buying New Batteries for Your Tech

Electronics are expensive, but their power sources don't have to be. Discover the simple engineering trick to recondition dead batteries and bring your gadgets back to 100% capacity.

Watch the Free Video

When door is opened or closed Hall effect sensor is activated and controller switches the relay correspondingly. After 2 seconds PIR sensor is activated and it checks for any motion inside the room. If there is motion then bulb is switched on and will be switched off when there is no motion.

CIRCUIT

Circuit Diagram

PROGRAM

void setup()
{
    pinMode(13,OUTPUT);
    pinMode(5,INPUT_PULLUP);//hal
    pinMode(6,INPUT);//pir
}
void loop()
{
    if((digitalRead(5)==0)&&(digitalRead(6)==1))
    {
        digitalWrite(13,HIGH);
        delay(1000);
        digitalWrite(13,LOW);
    }
    else if (digitalRead(5)==1){ digitalWrite(13,HIGH);    delay(1000);}
    else;
}
See also
TEMPERATURE INDICATOR AND FAN CONTROLLER

Revive Your Dead Electronics

Got a drawer full of dead gadgets or a failing car battery? Instead of paying a premium for replacements, use this simple trick to easily recondition them right from home.

See How It Works