It all started when I saw a PIR sensor at work. I was walking and all of a sudden a light went on. I discovered it was a PIR sensor and made a very simple code.
And if you get an unsatisfactory detection, Just adjust the screws in the PIR Sensor.
Comment if this works below
EXPANDED TECHNICAL DETAILS
Passive Infrared Detection
The PIR sensor is the most common way to detect human presence in security and lighting systems.
- Thermal Imaging: It doesn't emit any energy; it simply "looks" for moving sources of black-body radiation (heat). The internal pyroelectric sensor is split into two halves; motion is detected when a heat source crosses from one half to the other.
- Adjustability: Most PIR modules (like the HC-SR501) have two potentiometers: one for "Sensitivity" (distance) and one for "Time Delay" (how long the output stays HIGH).
Logic Implementation
- Wait Time: The firmware includes a "Warm-up" period (30-60 seconds) during which the Arduino ignores sensor input to allow the sensor to stabilize to the ambient room temperature.
- Interfacing: Connected to a simple digital input pin, making it one of the easiest yet most effective sensors for beginner home automation projects.