HC-SR501 Infrared Sensor Module


18 in stock


Infrared Sensor Module Code

//Henry's Bench
// HC-SR501 Motion Detector
// Sample Sketch
int ledPin = 13;  // LED on Pin 13 of Arduino
int pirPin = 7; // Input for HC-S501
int pirValue; // Place to store read PIR Value

void setup() {
  pinMode(ledPin, OUTPUT);
  pinMode(pirPin, INPUT);
  digitalWrite(ledPin, LOW); 

void loop() {
  pirValue = digitalRead(pirPin);
  digitalWrite(ledPin, pirValue);


There are no reviews yet.

Be the first to review “HC-SR501 Infrared Sensor Module”

Your email address will not be published. Required fields are marked *