Infrared Human Body Motion Sensor(HC-SR501) JP: 두 판 사이의 차이
(새 문서: {{#seo:|title=ArduWiki: Arduino Infrared Human Detection Motion Sensor (HC-SR501) Guide|title_mode=append|keywords=Arduino, Information Science, Maker Learning, Performance Evaluation, Infrared Human Detection Motion Sensor (HC-SR501), Arduino Projects, Capstone Projects, Arduino Example Code|description=Introduces how to control the Infrared Human Detection Motion Sensor (HC-SR501) with Arduino (basic information, circuit, example code). Can be used in Information Science and M...) |
(차이 없음)
|
2025년 3월 21일 (금) 14:49 판

Infrared PIR Sensor, a Passive Infrared Sensor.
It detects objects within its range that emit infrared radiation.
It can detect the faint infrared radiation emitted by humans, and allows for adjustments in detection distance and delay time.
Specifications
- Operating Voltage: 4.5V ~ 20V
- Quiescent Current: 50uA
- Detection Angle: 110 degrees
- Delay Time: 3 seconds ~ 300 seconds
- Detection Distance: 3m ~ 7m
Required Hardware
- Infrared Human Body Motion Sensor
- Arduino
Connection
The following is the circuit used in the example code.
If using the Infrared Human Body Motion Sensor by itself, an LED is not necessary.
Instead of an LED, other modules can be applied and utilized.
| Human Detection Sensor | Resistor | LED | Arduino | |||
| VCC | 5V | |||||
| OUT | D7 | |||||
| GND | - | GND | ||||
| Connection | + | |||||
| Connection | D8 | |||||

Example Code
This is an example that uses the Infrared Human Body Motion Sensor to light up an LED.
#define PIR 7 //Define motion sensor pin
#define LED 8 //Define LED pin for verification
int state = 0; //Variable for storing state
void setup()
{
pinMode(PIR, INPUT);
pinMode(LED, OUTPUT);
digitalWrite(LED, LOW);
}
void loop(){ //Code to light up the LED when motion is detected
// state = digitalRead(PIR);
if(digitalRead(PIR))
{
digitalWrite(LED, HIGH);
delay(1000);
}
digitalWrite(LED,LOW);
}
Execution Result
