PIR Motion Sensor Module HC-SR501 w/ Adjustable Delay Time & Output Signal
- Was RM15.00
-
RM6.00
- Product Code: HC-SR501
- Availability: In Stock
The PIR (Passive Infra-Red) Sensor is a device that detects motion by measuring changes in the infrared (heat) levels emitted by surrounding objects. When motion is detected the PIR Sensor outputs a high signal on its output pin. This logic signal can be read by a microcontroller or trigger a MOSFET which could switch high voltage devices. This is a good sensor for monitoring an area for motion.
Both revisions of this sensor use the same Fresnel lens, and basic functionality remains the same between the two (for example you can use the same test programs). However, there were a number of improvements and updates made to Revision B, and if using Revision A in your project the following information should be noted and used.
Key Features
Specifications
* Note: Driving an external load requires a transistor or MOSFET.
Device Area of Detection
The device will detect motion inside a 110 degree cone with a range of 3 to 7 meters.
PIR Range (Sensitivity) Adjustment
As mentioned, the adjustable range is from approximately 3 to 7 meters. The illustration below shows this adjustment. You may click to enlarge the illustration.
Time Delay Adjustment
The time delay adjustment determines how long the output of the PIR sensor module will remain high after detection motion. The range is from about 3 seconds to five minutes. The illustration below shows this adjustment.
3 Seconds Off After Time Delay Completes – IMPORTANT
The output of this device will go LOW (or Off) for approximately 3 seconds AFTER the time delay completes. In other words, ALL motion detection is blocked during this three second period.
For Example:
- Imagine you’re in the single trigger mode (see below) and your time delay is set 5 seconds.
- The PIR will detect motion and set it high for 5 seconds.
- After five seconds, the PIR will sets its output low for about 3 seconds.
- During the three seconds, the PIR will not detect motion.
- After three seconds, the PIR will detect motion again and detected motion will once again set the output high and the output will remain on as dictated by the Time Delay adjustment and trigger mode selection.
Please follow this schematics below to set up this lab testing.
Arduino Sketch
/* PIR Motion Sensor with Arudino Demo Code */ int led = 13; // Define the LED as Pin 13 int sensor = 2; // Define the Sensor Connected to Pin 4 int state = LOW; // Motion Detection int val = 0; // Store the value of sensor void setup() { pinMode(led, OUTPUT); // initialize the LED as the output pinMode(sensor, INPUT); // initialize the sensor as the input Serial.begin(9600); // Define the serial communication } void loop(){ val = digitalRead(sensor); // Reading the sensor value if (val == HIGH) { // if sensor is high digitalWrite(led, HIGH); // switch on the LED delay(100); // 100 milliseconds delay if (state == LOW) { Serial.println("Motion was detected"); state = HIGH; // Update the variable state in to HIGH } } else { digitalWrite(led, LOW); // Turning off the LED delay(200); // 200 milliseconds delay if (state == HIGH){ Serial.println("Motion stopped!"); state = LOW; // update the variable state into LOW } } }