For a standard 5V setup, the wiring is as simple as it gets: power the sensor from your microcontroller's 5V pin, connect ground, and tie the output to any digital input pin.
if (val == HIGH) digitalWrite(LED_PIN, HIGH); if (pirState == LOW) Serial.println("Motion detected!"); pirState = HIGH;
Use this when your HW416B misbehaves.
For ESP32 deep sleep applications, connect HW416B OUT to a wake-up pin and use esp_sleep_enable_ext0_wakeup() .
Features enhanced sensitivity adjustment compared to earlier or cheaper knockoffs.
It features a simple three-pin interface (VCC, OUT, GND) that outputs a 3.3V TTL signal, eliminating the need for complex level shifting.
is valued for its consistent quality control and stability under varying environmental conditions How PIR Sensor Works and How To Use It with Arduino
Occupancy detection, lighting control, and any scenario where you want the output to stay active while people are present.
| Feature | HW416B | HC‑SR501 | |---------|--------|----------| | | Yes (potentiometer) | Yes (potentiometer) | | Adjustable sensitivity | Yes (potentiometer) | Yes (potentiometer) | | 3.3 V operation | Via configuration pins (verified) | Requires regulator bypass | | Trigger mode jumper | Yes (repeat/non‑repeat) | Yes | | EMC certification | Listed in product specs | Not typically claimed | | Price | Similar (~US$3–5) | Slightly cheaper (~US$2–4) |
Here's a simple, reliable sketch to get your HW-416B working with Arduino:
If you need performance instead of guessing HW416B’s specs, use:
The PIR modules have a passive infrared sensor that detects the occupancy and movement from the infrared radiated from human body. Tayda Electronics PIR Motion Sensor | Adafruit
After the output turns LOW, the sensor goes blind for ~2.5 seconds. This is a hardware limitation of the BISS0001 chip. You cannot fix this with code.
Struggling to find a clear HW416B PIR sensor datasheet? This guide breaks down every pin, timing diagram, and sensitivity secret. Learn how to tune, troubleshoot, and use this sensor better than 90% of hobbyists.
Unlike some "mini" PIR sensors that have fixed settings, the HW-416B usually features two potentiometers (or specific solder pads) that allow for:
Here is the for the HW416B, based on lab testing and community validation.