Infrared Obstacle Avoidance Tracking Sensor Module

Infrared Obstacle Avoidance Tracking Sensor Module

Infrared Obstacle Avoidance Tracking Sensor Module

RWF 2,500.00

An infrared obstacle avoidance sensor is designed to detect an obstacle or the difference in reflective services. Some application is to help a wheeled robot avoid obstacles with a sensor to react to adjustable a distance setting.


Specifications

  • Working voltage: DC 3.3V-5V
  • Working current: 20mA
  • Operating Temperature:-100C-+500C
  • Detection distance: 2-40Cm
  • IO interface: 4 wires interface (-/+/S/EN)
  • Output signal: TTL level (low level there is an obstacle, no obstacle high)
  • Adjustment: adjust multi-turn resistance
  • Effective angle:350
  • Size: 28mm*23mm
  • Weight Size: 9g

Application

  • It can be used in automatic photoelectric reflex application
  • The smart car obstacle avoidance
  • The intelligent car or robotic line walked along the black line path
  • The intelligent car cliff avoidance



How its work

IR Sensor Pinout

The IR sensor has a 3-pin connector that interfaces it to the outside world. The connections are as follows:

IR Sensor Module Pinout

VCC is the power supply pin for the IR sensor which we connect to the 5V pin on the Arduino.

OUT pin is a 5V TTL logic output. LOW indicates no motion is detected; HIGH means motion is detected.

GND Should be connected to the ground of the Arduino.

How Does an IR Motion Sensor Module Work?

The working of the IR sensor module is very simple, it consists of two main components: the first is the IR transmitter section and the second is the IR receiver section. In the transmitter section, IR led is used and in the receiver section, a photodiode is used to receive infrared signal and after some signal processing and conditioning, you will get the output.

IR Sensor Working

An IR proximity sensor works by applying a voltage to the onboard Infrared Light Emitting Diode which in turn emits infrared light. This light propagates through the air and hits an object, after that the light gets reflected in the photodiode sensor. If the object is close, the reflected light will be stronger, if the object is far away, the reflected light will be weaker. If you look closely toward the module. When the sensor becomes active it sends a corresponding Low signal through the output pin that can be sensed by an Arduino or any kind of microcontroller to execute a particular task. The one cool thing about this module is that it has two onboard LEDs built-in, one of which lights on when power is available and another one turns on when the circuit gets triggered.

IR Motion Sensor Module – Parts

For most of the Arduino projects, this sensor is used to detect proximity or to build obstacle avoidance robots. This Sensor is popular among beginners as these are low power, low cost, rugged, and feature a wide sensing range that can be trimmed down to adjust the sensitivity.

IR Sensor Module Parts

This sensor has three pins two of which are power pins leveled VCC and GND and the other one is the sense/data pin which is shown in the diagram above. It has an onboard power LED and a signal LED the power LED turns on when power is applied to the board the signal LED turns on when the circuit is triggered. This board also has a comparator Op-amp that is responsible for converting the incoming analog signal from the photodiode to a digital signal. We also have a sensitivity adjustment potentiometer; with that, we can adjust the sensitivity of the device. Last and finally, we have the photodiode and the IR emitting LED pair which all together make the total IR Proximity Sensor Module.

Commonly Asked Questions about IR Sensor  

Circuit Diagram for IR Motion Sensor Module

The schematic diagram of the IR Motion sensor is shown below. The schematic itself is very simple and needs a handful of generic components to build. If you don't have a prebuilt module on hand but still want to test your project, the schematic below will come in handy.

IR Sensor Module Circuit Diagram

In the schematic, we have an IR LED as Transmitter and the Photodiode as a Receiver. If an object is in front of the sensor, the reflected light from the object is received by the photodiode, and depending upon the intensity we can determine how far or how close the object is. In the schematic, you can also find an LM358 Op-Amp which is doing all the comparison work and generating the output. Other than that, there is a potentiometer that can be used to adjust the sensitivity of the IR Sensor module or the triggering distance for this module.

IR Sensor with Arduino UNO – Connection Diagram

Now that we have a complete understanding of how an IR sensor works, we can connect all the required wires to Arduino as shown below. 

Arduino IR Sensor Module Circuit Connections

Connecting the IR sensor to any microcontroller is really simple. As we know this sensor outputs a digital signal and processing this signal is very easy. There exist two methods to do so first, you can always check the port in an infinite loop to see when the port changes its state from high to low, or the other way is to do it with an interrupt if you are making a complicated project the interrupt method is recommended. Power the IR with 5V or 3.3V and connect ground to ground. Then connect the output to a digital pin D9. We have just used a Male to Female Jumper wire to connect the IR sensor module with Arduino board as shown below.

Connecting IR Sensor Module with Arduino Uno

With that, you’re now ready to upload some code and get the IR Motion Sensor working. You can also check out the above module in action at the bottom of this article.

Arduino Code for Interfacing IR Motion Sensor Module with Arduino

The Arduino IR sensor module code is very simple and easy to understand. We are just basically keeping track of whether the input to pin D9 is HIGH or LOW.

We initialize our code by declaring two global variables, the first one holds the pin value where the IR sensor is connected and the second one holds the value where the LED is connected

int IRSensor = 9; // connect IR sensor module to Arduino pin D9
int LED = 13; // connect LED to Arduino pin 13

Next, we have our setup function. In the setup function, we initialize the serial with 115200 baud. Next, we print a statement to check if the serial monitor window is properly working or not, and then we initialize the IRSensor pin as input and the LED pin as output.       

void setup(){
  Serial.begin(115200); // Init Serial at 115200 Baud Rate.
  Serial.println("Serial Working"); // Test to check if serial is working or not
  pinMode(IRSensor, INPUT); // IR Sensor pin INPUT
  pinMode(LED, OUTPUT); // LED Pin Output
}

Next, we have our infinite loop. In the infinite loop, we first read the sensor pin with the digitalRead() function and store the value to sensorStatus variable. Then we check to see if the output of the sensor is high or low, if the output of the sensor is high that means no motion is detected, else motion is detected, we also print this status in the serial monitor window.          

void loop(){
  int sensorStatus = digitalRead(IRSensor); // Set the GPIO as Input
  if (sensorStatus == 1) // Check if the pin high or not
  {
    // if the pin is high turn off the onboard Led
    digitalWrite(LED, LOW); // LED LOW
    Serial.println("Motion Detected!"); // print Motion Detected! on the serial monitor window
  }
  else  {
    //else turn on the onboard LED
    digitalWrite(LED, HIGH); // LED High
    Serial.println("Motion Ended!"); // print Motion Ended! on the serial monitor window
  }
}

That is the end of our simple Arduino based IR sensor code.

Working of the IR Motion Sensor Module

The GIF shows the IR sensor module in action, you can notice the LED turn on both on the module and on the Arduino board as pointed buy the red arrows. If you are working with an IR Motion Sensor Module for the first time then you should get a response similar to this.

IR Sensor Working



Frw 2,500

Related Products

ESP8266 serial port wifi module NodeMCU Lua V3 Internet of Things development board TYPE-C interface CH340

ESP8266 serial port ...

Frw 11,000

Arduino Uno SMD Electronic Development Board, 32 Kb

Arduino Uno SMD Elec...

Frw 10,000

ESP32 NodeMCU Module WLAN WiFi Development Board | Dev Kit C V2 with CP2102 compatible with Arduino

ESP32 NodeMCU Module...

Frw 15,000

HC-SR04 Ultrasonic sensor

HC-SR04 Ultrasonic s...

Frw 4,500

L298N 2A Based Motor Driver Module

L298N 2A Based Motor...

Frw 4,500

L293D driver motor shield for Arduino

L293D driver motor s...

Frw 4,300

Mini Water / Fluid Pump MOD45 ,R12

Mini Water / Fluid P...

Frw 2,450

0.08MPa 370 Motor 12V DC Air pump/Oxygen filling pump COM45, R37

0.08MPa 370 Motor 12...

Frw 8,000

MQ135 Air Quality Detector Sensor Module

MQ135 Air Quality De...

Frw 6,900

Electrolytic Capacitors0.1uF – 4700uF/25v

Electrolytic Capacit...

Frw 300

MAX30100 - Heart Rate Oxygen Pulse Sensor

MAX30100 - Heart Rat...

Frw 3,950

Single Channel 5V Relay Module

Single Channel 5V Re...

Frw 2,400

Channel 5V Relay Module

Channel 5V Relay Mod...

Frw 4,300

4 Channel 5V Relay Module

4 Channel 5V Relay M...

Frw 5,950

PCB Board 9*15cm PRO24, R22

PCB Board 9*15cm PRO...

Frw 1,000

LED 5MM 2MA GN

LED 5MM 2MA GN

Frw 50

Multi Coin Acceptor

Multi Coin Acceptor

Frw 35,000

4 * 4 Matrix Array Matrix Keypad

4 * 4 Matrix Array M...

Frw 5,000

AS608 Fingerprint Reader Sensor Module Optical

AS608 Fingerprint Re...

Frw 27,000

5A ACS712 ACS712ELC Current Sensor Module

5A ACS712 ACS712ELC ...

Frw 5,500

Infrared Obstacle Avoidance Tracking Sensor Module

Infrared Obstacle Av...

Frw 2,500

Soil Moisture Sensor

Soil Moisture Sensor

Frw 500

TTP223 Touch sensor

TTP223 Touch sensor

Frw 3,000

Smallest SIM800L GPRS GSM BRD56 , R11

Smallest SIM800L GPR...

Frw 11,500

Raspberry Pi Camera 175 Degree OV5647 Sensor 5MP Cameras Module Wide Angle Fisheye Lens for Pi 5 / 4B / 3B+ / 3B / Zero 2 W 1.3

Raspberry Pi Camera ...

Frw 35,000

MQ-7 Gas Sensor Module for Carbon Monoxide

MQ-7 Gas Sensor Modu...

Frw 8,900

GY-521 MPU6050

GY-521 MPU6050

Frw 5,500

DSM501A Dust Sensor Module PM2.5 Detection Dector COM45, R28

DSM501A Dust Sensor ...

Frw 18,500

DHT22/AM2302 Digital Temperature And Humidity Sensor Module SENS54 ,R13

DHT22/AM2302 Digital...

Frw 7,800

Arduino Active Buzzer Module COM52 ,R25

Arduino Active Buzze...

Frw 2,700

Arduino Pro Mini 328 – 5V/16MHz Board COM55

Arduino Pro Mini 328...

Frw 9,500

NodeMCU ESP8266 Development Board with 0.96 Inch OLED Display, CH340 Driver Module for Arduino IDE/M

NodeMCU ESP8266 Deve...

Frw 14,000

CNC Shield V3 – Engraving Machine 3D Printer A4988 DRV8825 Driver Expansion Board BRD46 , R34

CNC Shield V3 – En...

Frw 4,500

PIR Motion sensor SEN51 ,R12

PIR Motion sensor SE...

Frw 3,800

SYB-170 Mini Breadboard

SYB-170 Mini Breadbo...

Frw 700

GY-9960-3.3 APDS-9960 RGB Infrared Gesture Sensor COM44

GY-9960-3.3 APDS-996...

Frw 10,000

LilyPad Light Sensor module COM31

LilyPad Light Sensor...

Frw 3,500

Active Single Phase AC Output Voltage Sensor SEN31 ,R11

Active Single Phase ...

Frw 12,000

P6KE16CA 600 Watt Transient Voltage Suppressor Diode COM26

P6KE16CA 600 Watt Tr...

Frw 300

Capacitive Soil Humidity Hygrometer Moisture Sensor SENS54, R14

Capacitive Soil Humi...

Frw 6,000

Normally Open Proximity Magnetic Sensor Reed Switch SEN43

Normally Open Proxim...

Frw 2,500

Non-invasive AC Current Sensor – 30A SEN31

Non-invasive AC Curr...

Frw 11,500

Alcohol Gas Sensor ( MQ-3 ) SEN42 ,R16

Alcohol Gas Sensor (...

Frw 6,000