Description
The Infrared Obstacle Sensor ModuleĀ has a built-inĀ IR transmitterĀ andĀ IR receiverĀ that send out IR energy and look for reflected IR energy to detect the presence of any obstacle in front of the sensor module. The module has an onboard potentiometer that lets users adjust the detection range. The sensor has a very good and stable response, even in ambient light or in complete darkness.
Obstacle Avoidance Sensors usually come in two types: with 3 and 4 pins.
Features:
- When the module detects an obstacle in front of the signal, the green indicator light on the board level, while low-level continuous output signal OUT port, the module detects the distance 2 ~ 30cm, detection angle 35 Ā°, the distance can detect potential is adjusted clockwise adjustment potentiometer to detect the distance increases; counterclockwise to adjust the potentiometer to reduce the detection distance.
- Active infrared sensors are needed to detect the reflected light, and thus the shape of the reflectivity of the target detection range is critical. The minimum detection distance is the black-and-white maximum: small objects from a small area; large objects from a large area.
- The output port OUT sensor module can be directly connected to the microcontroller IO port, and you can directly drive a 5V relay ; Connection : VCC-VCC; GND-GND; OUT-IO
- Using the comparator LM393, stable ;
- Can be used for 3-5V DC power supply modules . When the power is turned on, the red power indicator lights
- With the screw holes of 3mm , easy fixed installation ;
- Board size : 3.1 cm * 1.5 cm
- Each module shipments comparing the threshold voltage has been adjusted by the potentiometer is good , not exceptional circumstances, do not arbitrarily adjust the potentiometer.Ā
Package Include:
1 x Infrared obstacle avoidance module
Pinout
WORKING PRINCIPLE
The IR transmitter sends an infrared signal that, in case of a reflecting surface (e.g. white color), bounces off in some directions including that of the IR receiver that captures the signal detecting the object. When the surface is absorbent the IR signal isnāt reflected and the object cannot be detected by the sensor. This result would occur even if the object is absent.
The module has 3 pins ā Vcc, GND, and the output. We also have 2 LEDs, one is for the power that is it turns ON when it is connected to the power. The other is for obstacle detection.
Connections
1. Connect the Vcc of the Sensor Module to the Vcc of Arduino Board
2. Connect GND of the Sensor Module to the GND of the Arduino Board.
3. Connect the output pin of the sensor module to pin 7 of the Arduino Board.
4. When the Obstacle Avoidance Sensor detects an obstacle, the LED will be on. Otherwise, it will be off.
Code
After above operations are completed, connect the Arduino board to your computer using the USB cable. The green power LED (labelledĀ PWR) should go on.Open the Arduino IDE and choose corresponding board type and port type for you project. Then load up the following sketch onto your Arduino.
Ā
int LED = 13; // Use the onboard Uno LED
int isObstaclePin = 2; // This is our input pin
int isObstacle = HIGH; // HIGH MEANS NO OBSTACLE
void setup() {
pinMode(LED, OUTPUT);
pinMode(isObstaclePin, INPUT);
Serial.begin(9600);
}
void loop() {
isObstacle = digitalRead(isObstaclePin);
if (isObstacle == LOW)
{
Serial.println(āOBSTACLE!!, OBSTACLE!!ā);
digitalWrite(LED, HIGH);
}
else
{
Serial.println(āclearā);
digitalWrite(LED, LOW);
}
delay(200);
}
A few seconds after the upload finishes, place a board in front of the Obstacle Avoidance Sensor, and the LED attached to pin 7 on the Arduino Uno board will light up, the onboard obstacle led will turn on. It will turn off when there is no obstacle. You can also try using theĀ LCD ModulesĀ based on which you will also get to know the distance of the obstacle. Also, you can try this project with a different development board likeĀ Raspberry PiĀ and expand your knowledge.