void loop() motionState = digitalRead(motionPin); if (motionState == HIGH) digitalWrite(ledPin, HIGH); Serial.println("Motion detected!"); else digitalWrite(ledPin, LOW);
| Feature | HW-416-B | HC-SR501 | | :--- | :--- | :--- | | Size | Smaller (32x24mm) | Larger (32x24mm approx, thicker) | | Quiescent Current | < 50 µA | < 65 µA | | Adjustable Time Delay | Usually fixed or very short (2.5s) | Yes (0.3s – 600s) | | Retriggering Mode | Internal (automatic) | Jumper-selectable (single/retrigger) | | Best for | Battery-powered, short-lived triggers | Security lights, long delays |
Introduction The HW-416-B is one of the most popular and cost-effective Passive Infrared (PIR) motion sensor modules available in the electronics market. Often found in Arduino starter kits, security lighting projects, and automatic door systems, this module is frequently compared to its predecessor, the HC-SR501. However, the HW-416-B offers distinct advantages in terms of size, power consumption, and adjustability.
delay(100);