What if your lights could know when you enter a room without you lifting a finger?
Why PIR motion sensor in Arduino? - Purpose & Use Cases
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.
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.
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.
void loop() {
// No automatic detection
// User must press button to turn light on/off
}void loop() {
if (digitalRead(pirPin) == HIGH) {
digitalWrite(lightPin, HIGH);
} else {
digitalWrite(lightPin, LOW);
}
}You can build smart devices that respond instantly to people's presence without any manual action.
Automatic hallway lights that turn on when you walk by and turn off after you leave, saving electricity and adding convenience.
Manual light control is tiring and wasteful.
PIR sensors detect motion automatically and reliably.
Arduino can use PIR signals to control devices smartly.
