What if your devices could 'see' when you enter a room and act all by themselves?
Why MotionSensor (PIR) in Raspberry Pi? - Purpose & Use Cases
Imagine you want to turn on a light only when someone enters a room. Without a motion sensor, you would have to watch the door all the time or press a switch manually every time someone comes in.
Manually watching or switching lights is tiring and easy to forget. It wastes energy and can be unsafe if you miss turning the light on in the dark.
A MotionSensor (PIR) automatically detects movement by sensing body heat. It tells the Raspberry Pi when someone is nearby, so your program can turn lights or alarms on and off without you lifting a finger.
while True: user_input = ask_user('Is someone here? (yes/no)') if user_input == 'yes': turn_light_on() else: turn_light_off()
if pir_sensor.motion_detected(): turn_light_on() else: turn_light_off()
You can build smart, automatic systems that react instantly to people's presence, making life easier and safer.
Security systems use PIR sensors to detect intruders and turn on alarms or cameras only when needed, saving power and catching movement quickly.
Manually controlling devices based on presence is slow and unreliable.
PIR sensors detect motion automatically by sensing heat changes.
Using a PIR sensor with Raspberry Pi lets you create smart, responsive projects easily.