Motion Sensor Light Using PIR Sensor

Want to build an automatic light system that turns ON when someone enters a room and turns OFF automatically after a few seconds? In this DIY project, you will learn how to make a Motion Sensor Light Using PIR Sensor using simple electronic components. This beginner-friendly project is perfect for home automation, energy saving, and smart lighting applications.

This project uses a PIR (Passive Infrared) Sensor to detect human movement and control an LED or light bulb automatically. The circuit is simple, low-cost, and ideal for students, hobbyists, and electronics beginners.

Motion Sensor Light Using PIR Sensor

What is a PIR Sensor?

A PIR sensor (Passive Infrared Sensor) is an electronic sensor that detects infrared radiation emitted by humans and animals. When a person moves in front of the sensor, it detects the change in infrared levels and produces an output signal.

PIR sensors are commonly used in:

  • Automatic room lights
  • Security alarm systems
  • Motion detector lights
  • Smart home automation
  • Energy-saving lighting systems

Components Required

  • PIR Motion Sensor Module (HC-SR501)
  • Arduino UNO
  • LED
  • 220Ω Resistor
  • Breadboard
  • Jumper Wires
  • USB Cable
  • 5V Power Supply
PIR Sensor Components

Circuit Diagram Connections

Follow these simple connections to build the PIR motion sensor light circuit:

  • Connect PIR Sensor VCC to Arduino 5V
  • Connect PIR Sensor GND to Arduino GND
  • Connect PIR Sensor OUT pin to Arduino Digital Pin 2
  • Connect LED positive terminal to Arduino Pin 13 through a 220Ω resistor
  • Connect LED negative terminal to GND
PIR Motion Sensor Circuit Diagram

Arduino Code for Motion Sensor Light


int pirPin = 2;
int ledPin = 13;
int motionState = 0;

void setup() {
  pinMode(pirPin, INPUT);
  pinMode(ledPin, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  motionState = digitalRead(pirPin);

  if (motionState == HIGH) {
    digitalWrite(ledPin, HIGH);
    Serial.println("Motion Detected!");
  } 
  else {
    digitalWrite(ledPin, LOW);
    Serial.println("No Motion");
  }

  delay(500);
}

How the Motion Sensor Light Works

The PIR sensor continuously monitors infrared radiation in its surroundings. When a person moves near the sensor, the infrared pattern changes. The PIR module detects this change and sends a HIGH signal to the Arduino.

The Arduino then turns ON the LED or connected light automatically. When no motion is detected, the Arduino switches the light OFF after a short delay.

Applications of PIR Motion Sensor Light

  • Automatic staircase lights
  • Smart room lighting
  • Home security systems
  • Office energy-saving systems
  • Automatic bathroom lights
  • Garage motion lights
  • Outdoor security lighting
PIR Motion Sensor Applications

Advantages of Using PIR Sensor

  • Low power consumption
  • Easy to use and install
  • Affordable and widely available
  • Reliable motion detection
  • Ideal for smart automation projects

Troubleshooting Tips

  • Make sure the PIR sensor is connected properly
  • Wait 30–60 seconds after powering the sensor for calibration
  • Adjust the sensitivity knob on the PIR module if needed
  • Check Arduino COM port and board settings
  • Use stable 5V power for accurate sensor operation

Conclusion

The Motion Sensor Light Using PIR Sensor is one of the best beginner-friendly smart electronics projects for learning automation and sensor interfacing. It is simple to build, energy-efficient, and useful for real-world smart home applications.

This DIY project also helps beginners understand how motion sensors work with Arduino. You can further improve this project by adding relays, WiFi modules, or smart home integration.

Frequently Asked Questions (FAQs)

What is a PIR sensor used for?

A PIR sensor is used to detect human motion by sensing infrared radiation changes.

Can I connect a bulb instead of an LED?

Yes, but you should use a relay module to safely control AC bulbs using Arduino.

Does the PIR sensor work in darkness?

Yes, PIR sensors detect heat movement and work both during the day and night.

What is the detection range of a PIR sensor?

Most PIR sensors can detect motion within 5 to 7 meters depending on the module settings.


Related Projects:

Leave a Reply

Your email address will not be published. Required fields are marked *