ESP32 Motion & Daylight Lighting | PIR Sensor and Timer
An ESP32 can combine a PIR motion event with a daylight measurement to decide when lighting is needed. A timer controls how long the light remains on.
The key idea
The PIR detects changes within its field of view, while the daylight input indicates whether extra illumination is useful. The controller can extend the on-time after a new motion event.
What to remember
- Treat motion and darkness as separate input conditions.
- Define when a fresh motion event restarts the delay.
Check your understanding
Why might a PIR-controlled light switch off while someone is still present?
Show the explanation
A stationary person may produce too little change for a fresh motion event.