Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use Hiwonder 4-Channel IR Line Follower Sensor: Examples, Pinouts, and Specs

Image of Hiwonder 4-Channel IR Line Follower Sensor
Cirkit Designer LogoDesign with Hiwonder 4-Channel IR Line Follower Sensor in Cirkit Designer

Introduction

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).

Explore Projects Built with Hiwonder 4-Channel IR Line Follower Sensor

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Arduino Nano-Based 5-Channel IR Sensor System for Object Detection
Image of line follwer: A project utilizing Hiwonder 4-Channel IR Line Follower Sensor in a practical application
This circuit consists of a 5-channel IR sensor connected to an Arduino Nano. The Arduino Nano reads the sensor data from the IR sensor's five channels (S1 to S5) and is powered by the 5V and GND pins of the Arduino. The setup is likely intended for applications such as line-following robots or proximity sensing.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino Nano Line Follower Robot with PID Control and L298N Motor Driver
Image of pid: A project utilizing Hiwonder 4-Channel IR Line Follower Sensor in a practical application
This circuit is a line-following robot controlled by an Arduino Nano, which uses a 5-channel IR sensor array to detect the line and an L298N motor driver to control two DC motors. The Arduino reads the IR sensor values and adjusts the motor speeds using a PID control algorithm to follow the line accurately.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO Line Follower Robot with IR Sensors and L298N Motor Driver
Image of LFR: A project utilizing Hiwonder 4-Channel IR Line Follower Sensor in a practical application
This circuit is a line follower robot controlled by an Arduino UNO. It uses two IR sensors to detect the line and an L298N motor driver to control two DC motors, enabling the robot to follow the line by adjusting its direction based on sensor inputs.
Cirkit Designer LogoOpen Project in Cirkit Designer
Raspberry Pi Zero W Based Line Tracking and Obstacle Detection System
Image of CSC615-Assignment#4-LineSensor: A project utilizing Hiwonder 4-Channel IR Line Follower Sensor in a practical application
This circuit integrates a Raspberry Pi Zero W with two sensors: a KY-033 Line Tracking Sensor and an FC-51 IR Sensor. The Raspberry Pi is configured to receive digital input signals from the KY-033 sensor on GPIO 04 and from the FC-51 sensor on GPIO 24. The circuit is designed for object detection and line tracking applications, with the Raspberry Pi processing the sensor inputs for decision-making tasks.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with Hiwonder 4-Channel IR Line Follower Sensor

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of line follwer: A project utilizing Hiwonder 4-Channel IR Line Follower Sensor in a practical application
Arduino Nano-Based 5-Channel IR Sensor System for Object Detection
This circuit consists of a 5-channel IR sensor connected to an Arduino Nano. The Arduino Nano reads the sensor data from the IR sensor's five channels (S1 to S5) and is powered by the 5V and GND pins of the Arduino. The setup is likely intended for applications such as line-following robots or proximity sensing.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of pid: A project utilizing Hiwonder 4-Channel IR Line Follower Sensor in a practical application
Arduino Nano Line Follower Robot with PID Control and L298N Motor Driver
This circuit is a line-following robot controlled by an Arduino Nano, which uses a 5-channel IR sensor array to detect the line and an L298N motor driver to control two DC motors. The Arduino reads the IR sensor values and adjusts the motor speeds using a PID control algorithm to follow the line accurately.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of LFR: A project utilizing Hiwonder 4-Channel IR Line Follower Sensor in a practical application
Arduino UNO Line Follower Robot with IR Sensors and L298N Motor Driver
This circuit is a line follower robot controlled by an Arduino UNO. It uses two IR sensors to detect the line and an L298N motor driver to control two DC motors, enabling the robot to follow the line by adjusting its direction based on sensor inputs.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of CSC615-Assignment#4-LineSensor: A project utilizing Hiwonder 4-Channel IR Line Follower Sensor in a practical application
Raspberry Pi Zero W Based Line Tracking and Obstacle Detection System
This circuit integrates a Raspberry Pi Zero W with two sensors: a KY-033 Line Tracking Sensor and an FC-51 IR Sensor. The Raspberry Pi is configured to receive digital input signals from the KY-033 sensor on GPIO 04 and from the FC-51 sensor on GPIO 24. The circuit is designed for object detection and line tracking applications, with the Raspberry Pi processing the sensor inputs for decision-making tasks.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Line-following robots for educational and industrial purposes
  • Maze-solving robots
  • Automated guided vehicles (AGVs) for warehouse automation
  • Path-following drones or rovers
  • Obstacle detection and edge detection in robotics

Technical Specifications

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

Pin Configuration and Descriptions

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)

Usage Instructions

How to Use the Component in a Circuit

  1. Power the Sensor: Connect the VCC pin to a 3.3V or 5V power source and the GND pin to the ground of your circuit.
  2. Connect the Outputs: Connect the OUT1, OUT2, OUT3, and OUT4 pins to the digital input pins of your microcontroller (e.g., Arduino UNO).
  3. Position the Sensor: Mount the sensor module on your robot or device, ensuring the IR sensors face the ground. The optimal distance between the sensor and the ground is 2mm to 10mm.
  4. Calibrate the Sensor: Test the sensor on a black line against a white background to ensure proper detection. Adjust the height or angle if necessary.

Important Considerations and Best Practices

  • Surface Contrast: Ensure the line to be followed has a high contrast (e.g., black line on a white surface) for accurate detection.
  • Ambient Light: Avoid using the sensor in environments with strong ambient IR light, as it may interfere with detection.
  • Power Supply: Use a stable power source to prevent fluctuations that could affect sensor performance.
  • Sensor Placement: Position the sensor so that all four channels are aligned perpendicular to the line for optimal detection.

Example Code for 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);
}

Troubleshooting and FAQs

Common Issues Users Might Face

  1. Sensor Not Detecting Lines:

    • Cause: Insufficient contrast between the line and the background.
    • Solution: Use a darker line or a lighter background to improve contrast.
  2. Inconsistent Readings:

    • Cause: Sensor height is not optimal or the surface is uneven.
    • Solution: Adjust the sensor height to 2mm-10mm and ensure the surface is flat.
  3. All Outputs Stuck at High or Low:

    • Cause: Faulty wiring or incorrect power supply.
    • Solution: Double-check the wiring and ensure the power supply is within the specified range (3.3V to 5V).
  4. Interference from Ambient Light:

    • Cause: Strong IR light sources in the environment.
    • Solution: Use the sensor in a controlled lighting environment or shield it from external IR sources.

Solutions and Tips for Troubleshooting

  • Verify the connections to the microcontroller and ensure the pins are correctly assigned in the code.
  • Test each channel individually by covering/uncovering the corresponding IR sensor.
  • If the sensor is still not working, check for physical damage or dirt on the IR sensors and clean them gently if needed.

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.