Bird
0
0
Arduinoprogramming~3 mins

Why PIR motion sensor in Arduino? - Purpose & Use Cases

Choose your learning style9 modes available
The Big Idea

What if your lights could know when you enter a room without you lifting a finger?

The Scenario

Imagine you want to turn on a light only when someone enters a room. Without a motion sensor, you have to press a switch every time, or guess when to turn it on and off.

The Problem

Manually watching for movement is tiring and easy to forget. You might leave the light on all day, wasting energy, or miss turning it on when needed. This is slow and error-prone.

The Solution

A PIR motion sensor automatically detects when a person moves nearby. It sends a signal to your Arduino, which can then turn on the light instantly and turn it off when no one is around. This saves effort and energy.

Before vs After
Before
void loop() {
  // No automatic detection
  // User must press button to turn light on/off
}
After
void loop() {
  if (digitalRead(pirPin) == HIGH) {
    digitalWrite(lightPin, HIGH);
  } else {
    digitalWrite(lightPin, LOW);
  }
}
What It Enables

You can build smart devices that respond instantly to people's presence without any manual action.

Real Life Example

Automatic hallway lights that turn on when you walk by and turn off after you leave, saving electricity and adding convenience.

Key Takeaways

Manual light control is tiring and wasteful.

PIR sensors detect motion automatically and reliably.

Arduino can use PIR signals to control devices smartly.