IR Infrared Obstacle Avoidance Sensor Module

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

Infrared obstacle detection sensor detects objects by reflecting infrared rays.

The red part is the section that detects obstacles, and the yellow part is a variable resistor used to adjust sensitivity.

It is a module equipped with LEDs for power and detection status indication.

Specifications

  • Operating Voltage [V]: 3.3 ~ 5 (5 recommended)
  • Distance can be adjusted using a variable resistor
  • Digital output: LOW output when an obstacle is detected (HIGH output when no obstacle is detected)

Example hardware

  • Arduino board
  • Jumper cables
  • Infrared obstacle detection module

Connections

Arduino IR Sensor Module
5V VCC
GND GND
D7 OUT

Example code

Outputs 0 to the serial monitor when an obstacle is detected, and 1 otherwise.

#define out_pin 7

void setup() {
  pinMode(out_pin, INPUT);
  Serial.begin(9600);
  Serial.println("Start");
}

void loop() {
  Serial.print("out_pin: ");
  Serial.println(digitalRead(out_pin));
  delay(1000);
}

Execution result

Check the operating video from the link.