Home Code Arduino and hc-sr505 Mini PIR Motion Sensor

Arduino and hc-sr505 Mini PIR Motion Sensor

by shedboy71

The HC-SR505 Mini PIR Motion Sensor is based on infrared technology and it can automatic control by itself with high sensitivity and high reliability. Because of the minimum size and low-power operation mode, it widely used in various of automatic electronic equipment, especially battery-powered automatic products.

It works similar to the larger hc-sr501 which is commonly used in many projects

HC-SR505 Mini PIR Motion Sensor

HC-SR505 Mini PIR Motion Sensor

Technical parameters:
1. Operating Voltage Range: DC4.5-20V
2. Static current: <60uA
3. Output level: High 3.3V / Low 0V
4. Trigger: repeatable trigger (default)
5. Delay time: 8S + -30%
6. PCB Dimensions: 10 * 23mm
7. Induction angle: <100 degree cone angle
8. Induction distance: 3 meters
9. Working temperature: -20 – +80 degrees
10. Sensor Lens Dimensions: Diameter: 10mm (default)

Very simple to use, the code below shows a simple sketch. As you can see it simply a case of reading the output and if it goes high then the PIR has detected something

Code

[codesyntax lang=”cpp”]

void setup()  
{
  Serial.begin(9600);
  pinMode(4,INPUT);
  digitalWrite(4,LOW);
}
void loop()  
{
    if(digitalRead(4)==HIGH)  
    {
      Serial.println("Movement detected.");
    }
    else  
    {
      Serial.println("Nothing.");
    }
    delay(1000);
}

[/codesyntax]

Here is the output you would expect to see in the serial monitor.

 

Output

Nothing.
Nothing.
Nothing.
Nothing.
Movement detected.
Movement detected.
Movement detected.
Movement detected.
Movement detected.
Movement detected.
Movement detected.

 

Link

A low cost module this one, you can pick these up for about $2 a piece

HC-SR505 Mini Infrared PIR Motion Sensor Precise Infrared Detector Module

Share

You may also like

Comments are closed.