Home ArduinoArduino Code HC-SR505 Mini PIR Motion Sensor and Arduino

HC-SR505 Mini PIR Motion Sensor and Arduino

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.

 

Specs

Operating voltage range: DC 4.5-20V
Quiescent Current: <60uA
Trigger: reusable trigger (default)
Delay Time: The default 8S + -30%
Board Dimensions: 10 * 23mm
Induction angle: <100 degrees cone angle
Sensing distance: 3 meters
Working temperature: -20 to +80 degrees
Sensor Lens Dimensions: Diameter: 10mm

 

Connection

Connect the PIR Motion Sensor to your Arduino power supply pin and digital pins. You can can connect the “s” terminal to any of your arduino I/O Pins

 

Code

 

[codesyntax lang=”cpp”]

void setup() 
{
Serial.begin(9600);
pinMode(6,INPUT);
digitalWrite(6,LOW);
}

void loop() 
{
if(digitalRead(6)==HIGH) 
{
Serial.println("INTRUDER DETECTED.");
}
else 
{
Serial.println("ALL CLEAR.");
}
delay(1000);
}

[/codesyntax]

 

Output

Open the serial monitor and you should see something like

ALL CLEAR.
ALL CLEAR.
ALL CLEAR.
INTRUDER DETECTED.
INTRUDER DETECTED.

 

Links

1 PCS X HC-SR505 Mini Infrared PIR Motion Sensor Precise Infrared Detector Module NEW

You may also like