8-Channel Line Tracking Module

2.1 Basic Parameters

PixPin_2025-11-05_12-02-52

8-Channel Module Calibration Operation Steps

  1. First, power on the module and wait at least 20s. The main purpose is to let the probe stabilize. (Need to wait every time when powering on)
  2. If it's the first time powering on and hasn't been calibrated, the module's red light will keep flashing. (At this time, you need to enter calibration mode)
  3. Long press the onboard key1 button, wait for the board's red light to stay constantly lit, and enter calibration mode. Friendly Reminder: After entering calibration mode, the lights on the probe will no longer react to black and white lines, meaning they are not effective. Wait for calibration to complete before they will react.
  4. Place the probe according to your usage height (calibrate at the height where it will run), place the entire probe on the black line, stop for 3 seconds and wait for data to stabilize (do not move the probe during this period), as shown in the figure image-2024110100002
  5. After 3s, lightly press the key1 button to record the value of the probe detecting the black line. After recording is complete, the board's red light will flash quickly, then return to constant lighting.
  6. Then, place the probe on the white line, stop for 3 seconds and wait for data to stabilize (do not move the probe during this period), as shown in the figure image-2024110100001
  7. After 3s, lightly press the key1 button to record the value of the probe detecting the white line. After recording is complete, the board's red light will flash quickly.
  8. If calibration is successful, the onboard red light will turn off and enter detection mode; if it fails, the onboard red light will keep flashing slowly, at which time you need to recalibrate.

If you accidentally enter calibration mode, you can press the reset button to reset the module or quickly double-click the key1 button to exit calibration.

The calibrated values are saved after power-off each time, and can be used directly next time you power on, without needing to calibrate every time you power on. Unless you change to a different environment and height, at which time you need to recalibrate.

2.2 Hardware Wiring

Eight-Channel Line Tracking ModuleMSPM0G3507
5V5V
GNDGND
TXRX0
RXTX0

启动小车 (17)

upscalemedia-transformed (upscalemedia-transformed (1).png)

image-20251028214030899

2.3 Environment Setup

Open sysconfig tool and configure the following

PixPin_2025-11-05_17-07-40

Open receive interrupt pin configuration as follows

PixPin_2025-11-05_17-09-00

2.4 Partial Code Analysis

bsp_ir.c

2.5 Main Functions

IRDataAnalysis

Function Prototypevoid IRDataAnalysis(void)
Function DescriptionInfrared data parsing function, used to parse received infrared sensor data. The process includes: checking data reception complete flag, finding data header ('$') and data tail ('#'), verifying data format (must start with "$D"), parsing "x1:1,x2:1,...x8:1" format 8-channel sensor data and storing to IR_Data_number array, finally resetting receive state to wait for next data
Input ParametersNone
Return ValueNone

2.6 Experimental Phenomenon

Connect the car wires, connect the OLED module, after burning the program to MSPM0, sensor data is displayed on the OLED

image-20251028191614823