Infrared Human Body Motion Sensor(HC-SR501)

아두위키 : Arduwiki
ArduWiki (토론 | 기여)님의 2024년 3월 24일 (일) 11:35 판 (Created page with "{{#seo:|title=아두위키 : 아두이노 적외선 인체감지 모션센서(HC-SR501) 가이드|title_mode=append|keywords=아두이노, 정보과학, 메이커학습, 수행평가, 적외선 인체감지 모션센서(HC-SR501), 아두이노 작품, 캡스톤작품, 아두이노 예제코드|description=아두이노로 적외선 인체감지 모션센서(HC-SR501)를 제어하는 방법(기본정보, 회로, 예제 코드)을 소개합니다. 정보과학과 메이커...")
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

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