How to Interface HC-SR505 Mini PIR Motion Sensor with Arduino

PIR sensor is a very common sensor that can detect the motion of a human or any animal that releases heat. By using a PIR Motion sensor, it's easy to make security systems for any facility. This sensor can work indoor or outdoor with or without light. Modern security systems use PIR Motion Sensor to trigger automatic alarms, security lights, and many more devices. Let's make a motion sensor-based security system using a PIR sensor and Arduino.

How Do PIR Motion Sensors Work?

A passive infrared (PIR) sensor also known as a Motion sensor can detect heat energy around it by using two pyroelectric sensors on it. The sensors generate signals and compare them. If the signal from one sensor differs from others, the sensor engages. This engagement can be switching light, relay, sending a message, or sending a signal to a microcontroller.

Interfacing HC-SR505 Mini PIR Motion Sensor with Arduino
HC-SR505 Mini PIR Motion Sensor

HC-SR505 Mini PIR Motion Sensor specification

Unlike HC-SR501, the HC-SR505 mini PIR sensor comes with limited features with a small body but high sensitivity, high reliability, low operating voltage mode. The HC-SR505 PIR Motion Sensor comes with the following technical parameters:

  • Operating voltage: DC 4.5v - 20v
  • Signal Output level: High 3.3v - Low 0v
  • Trigger Mode: Repeatable trigger (Default)
  • Angle range: < 100-degree cone angle
  • Distance range: 3 meters
  • working temperature" -20 - + 80 degrees
  • Body dimensions: 10X23mm

HC-SR505 PIR Sensor Pinout

HC-SR501 PIR Sensor has 3 pins to interface with different circuits or microcontrollers. The pins are VCC  Outputand GND.

HC-SE505 PIR Sensor Pinout
HC-SE505 PIR Sensor Pinout

VCC  of PIR is the power input. We will connect the power pin with Arduino 5volt.

Output is the signal out of the HC-SR505 PIR Motion Sensor which we will connect with Arduino digital pin D2. 

GND is the negative pin of the PIR sensor which we will connect with the Arduino GND pin.

We are going to connect a red LED, which will turn on while the HC-SR505 PIR sensor trigger. This will indicate if there is any movement. The LED positive pin will go to Arduino digital pin D5 and GND pin will go to Arduino GND  pin. 

Interfacing HC-SR505 Mini PIR Sensor with Arduino

The connection to read HC-SR505 Mini PIR Motion Sensor data using Arduino is straightforward. The circuit diagram shows how to connect the HC-sr505 PIR sensor with Arduino UNO. 

HC-SR505 PIR Sensor wiring with Arduino UNO

Video demonstration of the wiring between Arduino and HC-SR505

The video shows the circuit design of the project. Watch the video to understand the connections between the Arduino UNO and HC-SR505 Mini PIR Motion Sensor. 

Arduino Code for Interfacing HC-SR505 Mini PIR Motion Sensor

The coding is simple and easy to understand. We are going to check if there is any signal coming from the PIR sensor. If there is any movement, the PIR sensor will trigger and then the RED led will turn on.


Many automation and security system, PIR motion sensor is being used widely. PIR sensor is very easy to interface with any circuit and microcontroller such as Arduino, ESP, raspberry pi, and other similar microcontrollers-based IoT devices. HC-SR505 Mini PIR Motion Sensor is cheap, easy to use, reliable, and works in almost any environment.

0/Post a Comment/Comments