Concept Flow - PIR motion sensor
Start
Initialize PIR sensor pin
Read PIR sensor value
Is motion detected?
No→Wait and read again
Yes
Turn ON LED or output
Wait some time
Turn OFF LED or output
Loop back to read sensor
The program initializes the PIR sensor pin, reads its value repeatedly, and if motion is detected, it turns on an LED for a short time before turning it off and continuing to check.
