Description
HC-SR505 Miniature PIR Motion Sensor Module
The HC-SR505 uses passive infrared (PIR) sensing to detect changes associated with moving people or animals. The source describes it as a low-power miniature module for motion-triggered applications.
Specifications stated by the source
- Supply voltage: 4.5–20 V.
- Operating current: less than 60 µA.
- Detection distance: 3–4 m.
- Detection angle: 100 degrees.
- Output: 3.3 V high, 0 V low.
- Trigger duration: 6–12 seconds.
- Dimensions: 10 × 23 × 5 mm.
- Operating temperature: −20 to +80 °C.
Listed uses include motion alarms, automatic lighting, security products, industrial automation and automatic appliance control. Detection depends on movement and environmental conditions; this module is not a certified safety or security system.
Basic Arduino Uno example
Components: HC-SR505 module, Arduino Uno, LED, jumper wires and breadboard.
int sensorPin = 2; // Broche connectée à la sortie du capteur
int ledPin = 13; // Broche connectée à la LED intégrée
void setup() {
pinMode(sensorPin, INPUT);
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
int sensorValue = digitalRead(sensorPin);
if (sensorValue == HIGH) {
digitalWrite(ledPin, HIGH);
Serial.println("Mouvement détecté");
} else {
digitalWrite(ledPin, LOW);
Serial.println("Pas de mouvement");
}
delay(1000);
}
Basic example notes and wiring
sensorPinis digital pin 2;ledPinis pin 13.setup()configures the pins and serial communication.loop()reads the sensor and switches the LED according to motion state.- VCC to Arduino 5V; GND to GND; OUT to digital pin 2.
Arduino Uno example with I2C 1602 LCD
Components: HC-SR505, Arduino Uno, I2C 1602 LCD, wires and breadboard.
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2); // Adresse I2C de l'écran LCD
int sensorPin = 2; // Broche connectée à la sortie du capteur
void setup() {
lcd.begin();
lcd.backlight();
pinMode(sensorPin, INPUT);
Serial.begin(9600);
}
void loop() {
int sensorValue = digitalRead(sensorPin);
if (sensorValue == HIGH) {
lcd.setCursor(0, 0);
lcd.print("Mouvement detecte");
Serial.println("Mouvement détecté");
} else {
lcd.setCursor(0, 0);
lcd.print("Pas de mouvement ");
Serial.println("Pas de mouvement");
}
delay(1000);
}
Advanced example notes and wiring
- The example uses
WireandLiquidCrystal_I2Clibraries;setup()initializes the display, pins and serial port. loop()reads the sensor and displays the status on the LCD and serial monitor.- Sensor: VCC to Arduino 5V, GND to GND, OUT to digital pin 2.
- LCD: SDA to A4 and SCL to A5 on Arduino Uno.
Install the LCD library
- Open Arduino IDE.
- Choose Sketch > Include Library > Manage Libraries.
- Search for “LiquidCrystal_I2C” and install the library by Frank de Brabander.
Check the module pinout and ensure its output is compatible with the controller input. The source specifies a 3.3 V HIGH output. PIR sensors may need time to stabilize after power-up and can remain triggered for several seconds; test the actual module in its intended environment.









