Hw-416-b Pir Sensor Datasheet !link! ✦

/* HW-416-B PIR Motion Sensor Integration Demonstrates how to read a digital signal from the HW-416-B module. */ const int PIR_PIN = 2; // HW-416-B OUT pin connected to digital pin 2 const int LED_PIN = 13; // Built-in Arduino LED int pirState = LOW; // Start assuming no motion detected int val = 0; // Variable for reading the pin status void setup() pinMode(PIR_PIN, INPUT); // Declare sensor as input pinMode(LED_PIN, OUTPUT); // Declare LED as output Serial.begin(9600); Serial.println("Initializing PIR Sensor... Please wait for warmup."); // Give the sensor 30-60 seconds to warm up and calibrate to the environment delay(30000); Serial.println("Sensor active."); void loop() val = digitalRead(PIR_PIN); // Read input value if (val == HIGH) // Check if the input is HIGH digitalWrite(LED_PIN, HIGH); // Turn LED ON if (pirState == LOW) // Motion just detected Serial.println("=> Motion detected! Object moving within zone."); pirState = HIGH; else digitalWrite(LED_PIN, LOW); // Turn LED OFF if (pirState == HIGH) // Motion just ended Serial.println("=> Motion ended. Area clear."); pirState = LOW; Use code with caution. Warm-up Period Warning

electrolytic decoupling capacitor across the VCC and GND pins of the sensor to smooth out voltage spikes.

What or hardware are you pairing with the sensor?

The module’s digital output is 3.3 V when HIGH, which is safe for both 3.3 V and 5 V logic microcontrollers. hw-416-b pir sensor datasheet

High (3.3V) when motion is detected / Low (0V) when idle Detection Distance: Adjustable from 3 meters up to 7 meters Detection Angle: Less than 110-degree cone shape Delay Time: Adjustable from 0.5 seconds to 200 seconds

Because the HW-416-B outputs a clean digital signal (0V or 3.3V), interfacing it with an Arduino requires no analog-to-digital conversion. Wiring Diagram HW-416-B Pin Arduino Pin OUT Digital Pin 2 GND Arduino Example Code

3 meters to 7 meters (adjustable via potentiometer) /* HW-416-B PIR Motion Sensor Integration Demonstrates how

This knob adjusts the detection distance. Turning it clockwise increases the sensitivity (up to ~7 meters), while counter-clockwise decreases it. 4.2 Time Delay Adjustment (Potentiometer)

The HW-416-B doesn't detect people ; it detects change . This is why it ignores a static background but instantly notices motion.

Some variants of the HW‑416‑B also include pads for a photoresistor and a thermistor: Object moving within zone

Ground connection. Connect to the common ground of your power supply and microcontroller. Onboard Adjustments and Controls

| Parameter | Rating | |-----------|--------| | | DC 4.5V – 20V (5V typical / recommended) | | Quiescent Current | < 50 µA | | Output Signal | Digital TTL: HIGH (3.3V) when motion detected / LOW (0V) when idle | | Detection Range | 2 to 7 meters (adjustable) | | Detection Angle | < 100° to 120° cone angle | | Output Delay Time | 0.3 s to 200 s (adjustable via potentiometer) | | Blockade (Lock) Time | 2.5 seconds (default) | | Trigger Modes | Selectable: Repeatable (H) / Non-repeatable (L) | | Operating Temperature | –20°C to +70°C | | Storage Temperature | –40°C to +80°C | | Dimensions | 32.6 × 24.3 mm |