
Beginner4/7/2026- Author: IoTSpark Maker
ESP32 + PIR HC-SR501: Motion Detection (Quick Test Sample Code)
The HC-SR501 PIR (Passive Infrared) sensor detects motion by measuring changes in infrared radiation from a person's/animal's body (it doesn't actively emit a wave like the HC-SR04).
pirhc-sr501chuyen-dong
4 steps2 components
The HC-SR501 PIR (Passive Infrared) sensor detects motion by measuring changes in infrared radiation from a person's/animal's body (it does not actively emit a wave like the HC-SR04). A Fresnel lens on the module focuses infrared onto 2 sensing zones — when a warm object moves through, the signal difference between the two zones creates a pulse that triggers the output.