Stufin
Home Quick Cart Profile

4-CH IR Line sensor Module

Buy Now

Component Name

4-CH IR Line Sensor Module

Overview

The 4-CH IR Line Sensor Module is a compact, high-precision infrared line detection sensor designed for various robotic, automation, and IoT applications. This module is capable of detecting black and white lines, edges, and surfaces, making it an ideal solution for line-following robots, obstacle detection, and surface inspection systems.

Functionality

The 4-CH IR Line Sensor Module consists of four infrared LEDs and four corresponding photodiodes, arranged in a linear configuration. When the module is powered, the infrared LEDs emit light that is directed towards the surface being sensed. The reflected light is then detected by the photodiodes, which convert the received light into electrical signals. These signals are then processed by an onboard op-amp and comparator circuitry to produce a digital output.

Black and white lines

The sensor can differentiate between black and white surfaces, making it suitable for line-following applications.

Edges

The sensor can detect edges, such as the transition from a black to a white surface or vice versa.

Surfaces

The sensor can detect changes in surface reflectivity, allowing it to identify different materials or textures.

Key Features

  • High Accuracy: The 4-CH IR Line Sensor Module provides high-accuracy line detection, ensuring reliable performance in various applications.
  • Four Channel Design: The module features four independent sensing channels, allowing it to detect multiple lines, edges, or surfaces simultaneously.
  • Wide Operating Voltage: The module operates within a wide voltage range of 3.3V to 5.5V, making it compatible with most microcontrollers and development boards.
  • Low Power Consumption: The module consumes a low current of approximately 20mA, making it suitable for battery-powered devices.
  • Compact Size: The module's compact size (30mm x 20mm) allows for easy integration into robotic platforms, drones, and other compact systems.
  • Easy Integration: The module's digital output and simple connection scheme make it easy to interface with microcontrollers, such as Arduino, Raspberry Pi, and ESP32.
  • Adjustable Sensitivity: The module features adjustable sensitivity, allowing users to fine-tune the sensor's performance for specific applications.
  • Robust Design: The module is built with a robust design, ensuring reliable performance in various environmental conditions.

Technical Specifications

| Parameter | Value |

| --- | --- |

| Operating Voltage | 3.3V to 5.5V |

| Current Consumption | 20mA (typical) |

| Sensing Range | 0-10mm |

| Accuracy | 1mm |

| Response Time | 10ms (typical) |

| Output Type | Digital (TTL) |

| Dimensions | 30mm x 20mm |

| Weight | 5g (approximate) |

Applications

  • Line-following robots
  • Obstacle detection systems
  • Surface inspection systems
  • Robotics and automation
  • IoT projects and prototypes
  • Industrial automation and control systems

Pin Configuration

  • 4-CH IR Line sensor Module Documentation
  • Pinout Description
  • The 4-CH IR Line sensor Module is a compact module designed to detect infrared reflections from a surface. It features four individual IR sensors, allowing it to detect lines or edges with high accuracy. The module has a total of 6 pins, which are described below:
  • Pin 1: VCC
  • Function: Power supply pin
  • Description: This pin is used to power the module. Connect it to a 5V DC power source.
  • Typical Connection: Connect to the 5V output of a microcontroller or a power supply.
  • Pin 2: GND
  • Function: Ground pin
  • Description: This pin is used to connect the module to the ground of the system.
  • Typical Connection: Connect to the GND pin of a microcontroller or a power supply.
  • Pin 3: OUT1
  • Function: Output pin for Channel 1
  • Description: This pin provides a digital output signal indicating whether the IR sensor on Channel 1 has detected a reflection or not.
  • Typical Connection: Connect to a digital input pin on a microcontroller or a logic circuit.
  • Pin 4: OUT2
  • Function: Output pin for Channel 2
  • Description: This pin provides a digital output signal indicating whether the IR sensor on Channel 2 has detected a reflection or not.
  • Typical Connection: Connect to a digital input pin on a microcontroller or a logic circuit.
  • Pin 5: OUT3
  • Function: Output pin for Channel 3
  • Description: This pin provides a digital output signal indicating whether the IR sensor on Channel 3 has detected a reflection or not.
  • Typical Connection: Connect to a digital input pin on a microcontroller or a logic circuit.
  • Pin 6: OUT4
  • Function: Output pin for Channel 4
  • Description: This pin provides a digital output signal indicating whether the IR sensor on Channel 4 has detected a reflection or not.
  • Typical Connection: Connect to a digital input pin on a microcontroller or a logic circuit.
  • Connection Structure:
  • To connect the 4-CH IR Line sensor Module to a microcontroller or a logic circuit, follow these steps:
  • 1. Connect the VCC pin (Pin 1) to the 5V power supply.
  • 2. Connect the GND pin (Pin 2) to the GND pin of the microcontroller or power supply.
  • 3. Connect the OUT1 pin (Pin 3) to a digital input pin on the microcontroller or logic circuit.
  • 4. Connect the OUT2 pin (Pin 4) to a digital input pin on the microcontroller or logic circuit.
  • 5. Connect the OUT3 pin (Pin 5) to a digital input pin on the microcontroller or logic circuit.
  • 6. Connect the OUT4 pin (Pin 6) to a digital input pin on the microcontroller or logic circuit.
  • Note: Make sure to use suitable jumper wires or breadboard connections to connect the pins to the microcontroller or logic circuit. Additionally, ensure that the power supply is stable and can provide enough current to the module.

Code Examples

4-CH IR Line Sensor Module Documentation
Overview
The 4-CH IR Line Sensor Module is a highly sensitive and compact infrared sensor designed for line detection and tracking applications. This module features four individual infrared sensors, each with its own transmitter and receiver, allowing for accurate detection of objects or lines. The module provides a digital output signal, making it easy to interface with microcontrollers, robots, and other IoT devices.
Features
Four individual infrared sensors for accurate line detection
 Digital output signal (0V or 5V) for easy interfacing with microcontrollers
 High sensitivity and accuracy for reliable line tracking
 Compact design for easy integration into robotics, automation, and IoT projects
 Operating voltage: 5V
 Communication protocol: Digital output
Pinout
The 4-CH IR Line Sensor Module has the following pinout:
| Pin | Description |
| --- | --- |
| VCC | Power supply (5V) |
| GND | Ground |
| D0 | Digital output for channel 0 |
| D1 | Digital output for channel 1 |
| D2 | Digital output for channel 2 |
| D3 | Digital output for channel 3 |
Code Examples
### Example 1: Basic Line Detection with Arduino
In this example, we'll use the 4-CH IR Line Sensor Module with an Arduino board to detect a black line on a white surface.
```c++
const int sensorPins[] = {2, 3, 4, 5}; // Digital pins for sensor outputs
void setup() {
  Serial.begin(9600);
  for (int i = 0; i < 4; i++) {
    pinMode(sensorPins[i], INPUT);
  }
}
void loop() {
  for (int i = 0; i < 4; i++) {
    int sensorState = digitalRead(sensorPins[i]);
    if (sensorState == LOW) {
      Serial.print("Line detected on channel ");
      Serial.println(i);
    }
  }
  delay(50);
}
```
### Example 2: Line Follower Robot with Raspberry Pi (using Python)
In this example, we'll use the 4-CH IR Line Sensor Module with a Raspberry Pi to create a line follower robot.
```python
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
sensorPins = [17, 23, 24, 25] # GPIO pins for sensor outputs
for pin in sensorPins:
    GPIO.setup(pin, GPIO.IN)
while True:
    sensorStates = [GPIO.input(pin) for pin in sensorPins]
    if all(sensorStates): # If all sensors detect the line
        print("Moving forward")
        # Control motor to move forward
    elif any(sensorStates): # If any sensor detects the line
        print("Adjusting direction")
        # Control motor to adjust direction
    else:
        print("Lost the line")
        # Control motor to stop or reverse
    time.sleep(0.05)
```
Note: These code examples are for illustrative purposes only and may require modification to suit your specific application. Ensure proper calibration and testing of the sensor module before deploying it in your project.