Electronics

PIR Mini Infrared Motion Sensor HC-SR505

AED 15.50

1

Description

The HC-SR505 PIR Motion Sensor Module is a small, low-cost device that detects infrared radiation emitted by moving objects within its range. It has a compact design and operates on low power, making it suitable for battery-powered applications. The module has a sensitivity adjustment and a time delay setting that can be adjusted to meet specific requirements. It is commonly used in security systems, lighting controls, and other applications that require motion detection.

 

Package Includes:

  • 1 x HC-SR505 PIR Motion Sensor Module 

 

Features:

  • Wide operating voltage range: The module can operate on a voltage range from +4.5V to +20V.
  • Low power consumption: The module consumes only 60uA of current in idle mode.
  • Delay time: The module has a default delay time of 8 seconds (+/- 30%).
  • Standalone operation: The module can be used independently without any additional microcontroller or platform, but it can also be integrated with other platforms such as Arduino and Raspberry Pi.
  • Detection angle: The module has a detection angle of 100 degrees.
  • Detection range: The module has a detection range of up to 3 meters.
  • Small size: The module has a compact form factor.
  • Repeatable trigger: The trigger is reusable by default.
  • Automatic control: The module has automatic control capabilities.
  • Easy to communicate: The module is easy to communicate with analog circuits and can be easily integrated into projects.

 

Description:

The HC-SR505 PIR Motion Sensor Module is a small and compact sensor module that uses passive infrared (PIR) technology to detect motion within its range. It has a detection range of up to 3 meters and a detection angle of 100 degrees, making it suitable for a wide range of applications that require motion detection. The module operates on a wide voltage range of +4.5V to +20V and has a low power consumption of only 60uA in idle mode, making it ideal for battery-powered applications. It also has a default delay time of 8 seconds (+/- 30%) that can be adjusted by using an external resistor. The HC-SR505 PIR Motion Sensor Module can be used independently without any additional microcontroller or platform, but it can also be easily integrated with other platforms such as Arduino and Raspberry Pi. It has a simple three-pin interface that can be easily connected to any microcontroller or analog circuit. The sensor lens of the module has a diameter of 10mm and can detect movement from a wide range of angles. The module also has a repeatable trigger that allows for multiple detections of motion, and an automatic control function that simplifies the implementation of motion detection in various applications.

 

Principle of Work:

The HC-SR505 PIR Motion Sensor Module works by detecting changes in infrared (IR) radiation emitted by moving objects within its range. The module contains a pyroelectric sensor that generates an electrical signal when it detects a change in IR radiation. The signal is then amplified and filtered to remove noise, and the output is provided to the output pin of the module. When the device's lens is pointed at a solid wall or an object that is not moving, the sensor will not detect any change in IR radiation, and the output will be LOW. In this scenario, the LED connected to the output pin will be OFF, indicating that no motion has been detected. However, if a human or a dog passes across the module's detecting area opposite to its lens, the IR radiation emitted by the living body will change, and the sensor will detect the change. In response, the module will provide HIGH logic at the output pin, indicating that motion has been detected. The LED connected to the output pin will turn ON, providing a visual indication of the motion detection. also, the module has a default delay time of 8 seconds (+/- 30%), which means that the output will remain HIGH for a specified period after the motion has been detected. This delay time can be adjusted using an external resistor to meet specific requirements.

 

Pinout of the Module:

HC-SR505 Pinout

  1. VCC +: This is the power supply pin, which is connected to the positive voltage supply (+4.5V to +20V). It is recommended to use a regulated power supply to avoid damaging the module.
  2. S OUT: This is the output pin, which provides a digital signal (HIGH or LOW) depending on whether motion has been detected or not. The output signal is compatible with any microcontroller or digital circuit with a voltage range of 3V to 5V.
  3. GND - : This is the ground pin, which is connected to the negative voltage supply (0V).

The HC-SR505 PIR Motion Sensor Module does not have any potentiometers (pots) on it for adjusting sensitivity or delay time. Instead, the delay time can be adjusted by using an external resistor connected to the delay time pin (marked as TP on the module). The resistance value of the external resistor determines the delay time, with a formula provided in the module's datasheet. Additionally, the sensitivity of the module can be adjusted by changing the distance and angle of the module's lens.

 

Applications:

  • Security Systems: The module can be used in security systems to detect motion and trigger an alarm or notification. The motion detection feature can be used to detect intruders and alert the user.
  • Lighting Controls: The module can be used in lighting control systems to turn on lights when motion is detected and turn them off when no motion is detected. This feature is useful in areas where lighting is not needed all the time, such as parking lots, warehouses, and other similar places.
  • Automatic Door Controls: The module can be used in automatic door controls to detect the presence of a person and automatically open or close the door. This feature is useful in areas with high traffic, such as hospitals, supermarkets, and other similar places.
  • Home Automation: The module can be used in home automation systems to control various devices based on motion detection. For example, the module can be used to turn on the TV or music system when someone enters the room and turn them off when no one is present.
  • Robotics: The module can be used in robotics applications to detect the presence of obstacles and avoid collisions. The motion detection feature can be used to detect the presence of humans or other objects and adjust the robot's trajectory accordingly.

 

Circuit:

 

motion-qegdcmfm0u-dzl-Lmu-Kjs-R

  1. Connect the VCC pin of the module to the 5V pin on the Arduino board.
  2. Connect the GND pin of the module to the GND pin on the Arduino board.
  3. Connect the OUT pin of the module to pin 2 on the Arduino board.
  4. Connect the anode (positive) pin of the LED to pin 13 on the Arduino board.
  5. Connect the cathode (negative) pin of the LED to the GND pin on the Arduino board.

 

Library:

The module does not need a Library to function with Arduino

 

Code:

Code for the HC-SR505 Module that uses interrupts to detect motion and a state machine to control the LED:

 
int ledPin = 13;
int pirPin = 2;

volatile boolean motionDetected = false;

void setup() {
  pinMode(ledPin, OUTPUT);
  pinMode(pirPin, INPUT);
  attachInterrupt(digitalPinToInterrupt(pirPin), motionInterrupt, CHANGE);
}

void loop() {
  static enum { IDLE, MOTION_DETECTED, MOTION_ENDING } state = IDLE;
  static unsigned long motionStartMillis = 0;
  static unsigned long motionEndMillis = 0;
  
  switch (state) {
    case IDLE:
      if (motionDetected) {
        motionStartMillis = millis();
        digitalWrite(ledPin, HIGH);
        state = MOTION_DETECTED;
        motionDetected = false;
      }
      break;
      
    case MOTION_DETECTED:
      if (millis() - motionStartMillis >= 10000) {
        motionEndMillis = millis();
        digitalWrite(ledPin, LOW);
        state = MOTION_ENDING;
      }
      break;
      
    case MOTION_ENDING:
      if (millis() - motionEndMillis >= 5000) {
        state = IDLE;
      }
      break;
  }
}

void motionInterrupt() {
  motionDetected = true;
}

In this code, the attachInterrupt() function is used to attach an interrupt to the motion detection pin. The motionInterrupt() function is called whenever motion is detected by the module, and it sets the motionDetected flag to true. The main loop of the code uses a state machine to control the LED based on motion detection. The state machine has three states: IDLE, MOTION_DETECTED, and MOTION_ENDING. In the IDLE state, the code waits for a motion to be detected. When motion is detected, the LED is turned on and the state machine transitions to the MOTION_DETECTED state. In the MOTION_DETECTED state, the code waits for 10 seconds before transitioning to the MOTION_ENDING state. In the MOTION_ENDING state, the LED is turned off and the code waits for 5 seconds before transitioning back to the IDLE state.

 

Technical Details:

The operating voltage range. DC4.5-20V
static current 60uA
Output level High 3.3V / Low 0V
The default delay time  8 seconds plus 30%
PCB Dimensions 10 * 23mm
The angle of working 100 degrees cone angle
Working distance 3-meter
Temperature range -20°F to +80°F
Sensor lens Diameter: 10mm (default)

 

Resources:

Link 1

 

Comparisons:

Both the HC-SR505 and HC-SR501 are PIR (passive infrared) motion sensor modules that can detect motion within their detection range. However, there are some key differences between the two modules:

  1. Detection range: The HC-SR505 has a detection range of 3 meters, while the HC-SR501 has a detection range of up to 7 meters.
  2. Detection angle: The HC-SR505 has a detection angle of 100 degrees, while the HC-SR501 has a detection angle of 120 degrees.
  3. Size: The HC-SR505 is smaller than the HC-SR501, which can make it more suitable for smaller projects where space is limited.
  4. Sensitivity adjustment: The HC-SR501 has a sensitivity adjustment potentiometer, which allows for fine-tuning the sensitivity of the sensor. The HC-SR505, on the other hand, does not have a sensitivity adjustment potentiometer.

In summary, the HC-SR505 is a smaller, lower-power version of the HC-SR501 with a shorter detection range and a narrower detection angle. It is more suitable for smaller projects where space is limited, while the HC-SR501 is better suited for larger areas where a wider detection angle and longer range are needed.