void loop() val = digitalRead(PIRpin);
The back of the PCB usually has terrible printing. Use this mapping: hw416b pir sensor datasheet better
Pro tip: Set it to for debugging, otherwise you will think the sensor is broken because it ignores you for 30 seconds after the first wave. void loop() val = digitalRead(PIRpin); The back of
The HW-416B has two small yellow jumpers and three pins labeled and H . void loop() val = digitalRead(PIRpin)
PIR sensors are sensitive to power supply noise. Adding a 10uF electrolytic capacitor across the VCC and GND pins can significantly reduce "phantom" triggers caused by voltage ripples.
If your sensor false-triggers from power supply noise (e.g., when an AC motor turns on nearby):
| © 99-2025 ABCgames.net |