Infrarood obstakel vermijdingsmodule voor het detecteren van obstakels en het instellen van de afstand met een potentiometer.
SKU: OT2043-A54 Número do artigo: AB072 EAN: 4577243565130 Localização: AD05.04
Alternativa
Sensor de distância ultrassónico HC-SR04
€ 2,89
Ver esta alternativa
Como ligar o Módulo de desvio de obstáculos infravermelho HW-201 a um Arduino UNO ou ESP32, com um sketch de exemplo que podes carregar já.
This project uses an HW-201 infrared obstacle avoidance sensor to detect nearby objects. When an obstacle comes into range, the sensor's digital output goes LOW, turning on the Arduino's built-in LED and printing detection alerts to the Serial Monitor. Adjust the onboard potentiometer on the sensor module to calibrate the detection distance.
/*
* ==================================================================
* Generated by Codey.online — https://www.codey.online
* ==================================================================
* Project : IR Obstacle Detection with HW-201
* Board : Arduino UNO (arduino:avr:uno)
* Parts : HW-201 Infrared Obstacle Avoidance Module
* Libraries : none (built-in)
*
* Codey Online is an AI-powered browser IDE for Arduino and ESP32.
* Describe your project and Codey writes the code, draws the wiring
* diagram and uploads it to your board, straight from the browser.
* This code is free to use, modify and share, without warranty.
* ==================================================================
*/
// Pin definitions
const int sensorPin = 2;
const int ledPin = 13;
void setup() {
pinMode(sensorPin, INPUT);
pinMode(ledPin, OUTPUT);
Serial.begin(115200);
Serial.println(F("HW-201 IR Obstacle Sensor Demo"));
Serial.println(F("Ready: Move an object in front of the sensor."));
}
void loop() {
// The HW-201 sensor outputs LOW when an obstacle is detected
int sensorState = digitalRead(sensorPin);
if (sensorState == LOW) {
digitalWrite(ledPin, HIGH);
Serial.println(F("Obstacle Detected!"));
} else {
digitalWrite(ledPin, LOW);
Serial.println(F("Clear (no obstacle)"));
}
delay(200);
}
Wiring diagram and example code generated by Codey.online — https://www.codey.online
This project reads the digital output from the HW-201 Infrared Obstacle Avoidance Module. When an object is detected within range, the sensor output drops LOW, lighting up the ESP32's built-in LED and printing an alert to the Serial Monitor. You can adjust the detection distance using the potentiometer on the module.
/*
* ==================================================================
* Generated by Codey.online — https://www.codey.online
* ==================================================================
* Project : IR Obstacle Detection with ESP32
* Board : ESP32 DEVKIT V1 (esp32:esp32:esp32doit-devkit-v1)
* Parts : HW-201 Infrared Obstacle Avoidance Module
* Libraries : none (built-in)
*
* Codey Online is an AI-powered browser IDE for Arduino and ESP32.
* Describe your project and Codey writes the code, draws the wiring
* diagram and uploads it to your board, straight from the browser.
* This code is free to use, modify and share, without warranty.
* ==================================================================
*/
// HW-201 IR Obstacle Sensor with ESP32
const int SENSOR_PIN = 4; // Connected to OUT pin of HW-201
const int LED_PIN = 2; // Onboard LED
void setup() {
Serial.begin(115200);
pinMode(SENSOR_PIN, INPUT);
pinMode(LED_PIN, OUTPUT);
Serial.println("HW-201 Obstacle Sensor Ready");
}
void loop() {
// The HW-201 output is active-LOW (LOW when an obstacle is detected)
int sensorState = digitalRead(SENSOR_PIN);
if (sensorState == LOW) {
digitalWrite(LED_PIN, HIGH);
Serial.println("Obstacle detected!");
} else {
digitalWrite(LED_PIN, LOW);
Serial.println("Path clear");
}
delay(200);
}
Wiring diagram and example code generated by Codey.online — https://www.codey.online
Módulo de desvio de obstáculos infravermelho.
Emite um sinal de 5V quando não há obstáculos e um sinal de 0V quando há um obstáculo, e o LED verde acende. A distância pode ser ajustada com um potenciômetro. Funciona com 3.3V e 5V, tem um LED de alimentação vermelho.
Lê a distância até obstáculos a uma distância de 2-30cm e 35 graus por meio de sinais infravermelhos. Contém um emissor e um recetor infravermelhos.
Dimensões
Comprimento: 4,5cm
Largura: 1,4cm
Altura: 0,9cm

| Largura | 1,4 cm |
|---|---|
| Tensão de trabalho | 3,3V |
| Comprimento | 4,5 cm |
| Altura | 0,9 cm |
| Ângulo | 35 graus |
| Distância de medição | 2-30 cm |
Exatamente o que eu procurava
boa qual
É bom
coisa super.
Não ficas satisfeito? Tens 30 dias após a receção para devolver o produto.
Tudo sobre devoluções
Módulo de desvio de obstáculos infravermelho HW-201