PIR Motion Sensor Module HC-SR501 w/ Adjustable Delay Time & Output Signal

  • RM9.54

  • Ex Tax: RM9.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:

  • Detection range up to 20 feet
  • Single bit output
  • Jumper selection single or continuous trigger output mode
  • 3-pin SIP header ready for breadboard or through-hole project


Specification:

  • Operating voltage: DC 5 - 12V
  • Static power consumption: 65 mA
  • Output Signal: 3V TTL
  • Detection Distance: Up to 6 meter (Adjustable)
  • Sensing Range: Less than 120° degree angle, 6 meters
  • Delay Time: 5 - 200s (Adjustable)
  • Adjustable Trigger:  L: non repeatable trigger  -  H: repeatable trigger
  • Operating Temperature: -15 to +70°C
  • Dimensions: 32 x 24mm, screw hole distance 28mm

 

Note: Driving an external load requires a transistor or MOSFET.

 

 

Connect PIR Motion Sensor with an Arduino

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 = 4;              // 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
    }
  }
}

 

Write a review

Note: HTML is not translated!
    Bad           Good

Similar Products