IR Infrared Obstacle Avoidance Sensor (IR-08H) [S017]



https://www.youtube.com/watch?v=21SB3fJBSLg


*GitHubhttps://github.com/rdiot/rdiot-s017.git


* Specs

Working voltage: DC 3.3V-5V

Working current: ≥ 20mA

Operating temperature: -10 ℃ - +50 ℃

detection distance :2-40cm

IO Interface: 4-wire interfaces (- / + / S / EN)

Output signal: TTL level (low level there is an obstacle, no obstacle high)

Adjustment: adjust multi-turn resistance

Effective angle: 35 °

Size: 28mm × 23mm

Weight Size: 9g


* Contents

- Connect

GND ----- GND

VCC ----- 5V

S ----- 2

EN ----- X


- Key Code

int T = 2; // INPUT PIN

 

void setup()

{

 Serial.begin(115200); 

 Serial.println("Arduino Examples - IR Sensor");

 Serial.println(" http://docs.whiteat.com/?p=1142");

 pinMode(T, INPUT);

}

 

void loop()

{

 if (LOW == digitalRead(T))

 {

 Serial.println("IR Detected"); //detected

 }

 else

 {

 Serial.print("."); 

 }

 delay(100);

}

Posted by RDIoT
|