Description
Infrared Obstacle Detection Sensor Module
Infrared sensor module intended to detect nearby objects for robotics and automation. The source includes example wiring and Arduino sketches, but does not provide a clearly verified detection range or output-voltage specification.
Check the actual board labels, pinout, output level and potentiometer adjustment for the supplied module. Ensure the output is compatible with the microcontroller input. Do not rely on it as a safety-rated sensing device.
Arduino examples copied from the French source
int sensorPin = 2; // Broche connectée à la sortie du capteur
int ledPin = 13; // Broche connectée à la LED intégrée
void setup() {
pinMode(sensorPin, INPUT);
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
int sensorValue = digitalRead(sensorPin);
if (sensorValue == LOW) {
digitalWrite(ledPin, HIGH);
Serial.println("Obstacle détecté");
} else {
digitalWrite(ledPin, LOW);
Serial.println("Pas d'obstacle");
}
delay(1000);
}
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
int sensorPin = 2; // Broche connectée à la sortie du capteur
int ledPin = 13; // Broche connectée à une LED externe
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
lcd.begin();
lcd.backlight();
pinMode(sensorPin, INPUT);
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
int sensorValue = digitalRead(sensorPin);
lcd.setCursor(0, 0);
if (sensorValue == LOW) {
lcd.print("Obstacle detecte");
digitalWrite(ledPin, HIGH);
Serial.println("Obstacle détecté");
} else {
lcd.print("Pas d'obstacle ");
digitalWrite(ledPin, LOW);
Serial.println("Pas d'obstacle");
}
delay(1000);
}
The source code blocks are reproduced unchanged. Confirm that the wiring and libraries correspond to this sensor module before uploading or connecting the circuit.









