HC-SR501 PinOuts and Controls |
Pin or Control | Function |
---|---|
Time Delay Adjust | Sets how long the output remains high after detecting motion.... Anywhere from 5 seconds to 5 minutes. |
Sensitivity Adjust | Sets the detection range.... from 3 meters to 7 meters |
Trigger Selection Jumper | Set for single or repeatable triggers. |
Ground pin | Ground input |
Output Pin | Low when no motion is detected.. High when motion is detected. High is 3.3V |
Power Pin | 5 to 20 VDC Supply input |
Device Area of Detection |
Time Delay Adjustment |
HC-SR501 Connection to Arduino |
Arduino Sketch
int ledPin = 13; // LED on Pin 13 of Arduino
int pirPin = 7; // Input for HC-SR501
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);
}
Sumber
Arduino HC-SR501 Motion Sensor Tutorial
Where to buy
HC-SR501 PIR Motion Sensor Module
HC-SR501 PIR Motion Sensor Module |