

The Hiwonder 4-Channel IR Line Follower Sensor (Part ID: 9999) is a versatile sensor module designed for detecting lines on the ground using infrared (IR) light. It is commonly used in robotics applications to enable autonomous path-following capabilities. With its four independent IR channels, the sensor provides enhanced accuracy and flexibility, making it ideal for projects such as line-following robots, maze solvers, and automated guided vehicles (AGVs).








The following table outlines the key technical details of the Hiwonder 4-Channel IR Line Follower Sensor:
| Parameter | Value |
|---|---|
| Operating Voltage | 3.3V to 5V |
| Operating Current | ≤ 20mA |
| Detection Range | 1mm to 12mm |
| Output Type | Digital (High/Low) |
| Number of Channels | 4 |
| IR Wavelength | 850nm |
| Dimensions | 70mm x 20mm x 10mm |
| Weight | 10g |
| Operating Temperature | -10°C to 50°C |
The Hiwonder 4-Channel IR Line Follower Sensor has a 6-pin interface. The pin configuration is as follows:
| Pin | Name | Description |
|---|---|---|
| 1 | VCC | Power supply input (3.3V to 5V) |
| 2 | GND | Ground connection |
| 3 | OUT1 | Digital output for Channel 1 (High/Low based on line detection) |
| 4 | OUT2 | Digital output for Channel 2 (High/Low based on line detection) |
| 5 | OUT3 | Digital output for Channel 3 (High/Low based on line detection) |
| 6 | OUT4 | Digital output for Channel 4 (High/Low based on line detection) |
VCC pin to a 3.3V or 5V power source and the GND pin to the ground of your circuit.OUT1, OUT2, OUT3, and OUT4 pins to the digital input pins of your microcontroller (e.g., Arduino UNO).Below is an example Arduino sketch to read the outputs of the Hiwonder 4-Channel IR Line Follower Sensor and display the results in the Serial Monitor:
// Define the pins connected to the sensor outputs
#define OUT1_PIN 2 // Channel 1 output connected to digital pin 2
#define OUT2_PIN 3 // Channel 2 output connected to digital pin 3
#define OUT3_PIN 4 // Channel 3 output connected to digital pin 4
#define OUT4_PIN 5 // Channel 4 output connected to digital pin 5
void setup() {
// Initialize serial communication for debugging
Serial.begin(9600);
// Set sensor pins as inputs
pinMode(OUT1_PIN, INPUT);
pinMode(OUT2_PIN, INPUT);
pinMode(OUT3_PIN, INPUT);
pinMode(OUT4_PIN, INPUT);
}
void loop() {
// Read the sensor outputs
int channel1 = digitalRead(OUT1_PIN);
int channel2 = digitalRead(OUT2_PIN);
int channel3 = digitalRead(OUT3_PIN);
int channel4 = digitalRead(OUT4_PIN);
// Print the sensor states to the Serial Monitor
Serial.print("Channel 1: ");
Serial.print(channel1);
Serial.print(" | Channel 2: ");
Serial.print(channel2);
Serial.print(" | Channel 3: ");
Serial.print(channel3);
Serial.print(" | Channel 4: ");
Serial.println(channel4);
// Add a small delay for readability
delay(100);
}
Sensor Not Detecting Lines:
Inconsistent Readings:
All Outputs Stuck at High or Low:
Interference from Ambient Light:
By following this documentation, you can effectively integrate the Hiwonder 4-Channel IR Line Follower Sensor into your projects and troubleshoot any issues that arise.