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

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);
}

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

1 comment

Mini PIR Sensor | Sheffield Hackspace 10th April 2016 - 2:09 pm

[…] 4.5V up to around 20V. They have the part number DYP-ME003SE-V1 but can also be found online as an HC-SR505. These look to be almost identical bar the addition of a single capacitor on the front. I could not […]

Comments are closed.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More