yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
MSPM0 Smart Robot Car📖
1.Quick Start Guide
  • 1. Assembly Videos
  • 2. Quick Start Videos
  • 3. Battery charging
  • 4. Notes
2.Introduction to the MSPM0 Car
  • 1.About MSPM0
  • 2.Development board interface description
3.Development environment setup and usage
  • 1.CCS Theia development
  • 2.MDK Arm development
  • 3.Uniflash burning
  • 4.External crystal oscillator configuration
  • 5.Project Migration
4.MSPM0 basic course
  • 1. LED light control (GPIO)
  • 2. Buzzer Control (GPIO)
  • 3. Button Control (EXTI)
  • 4. Serial Port (UART)
  • 5. Voltage Detection (ADC)
  • 6. Temperature Detection (ADC)
  • 7. Independent Watchdog (WWDG)
  • 8. Window Watchdog (WWDG)
  • 9. Timer (TIM)
  • 10. Breathing LED (PWM)
  • 11. I2C Communication (I2C)
  • 12. External Flash (SPI)
  • 13. Internal Flash (Flash)
  • 14. DMA
  • 15. FreeRTOS
5.Sensor basic course
  • 1.Servo control
  • 2.Ultrasonic servo PTZ basic use
  • 3.Motor PID control
  • 4.OLED display photosensitive value
  • 5.Infrared avoid sensor
  • 6.1 Infrared line tracking sensor-8 channel infrared tracking sensor module
  • 6.2 Infrared line tracking sensor-4 channel infrared tracking sensor module
  • 7.Infrared remote control
  • 8.Ultrasonic ranging
  • 9.RGB light drive
  • 10.MPU6050 raw data acquisition
  • 11.MPU6050 data fusion
  • 12.K210 vision recognition module
  • 13.K230 vision recognition module
6.Smart car course
  • 1.1 Car line tracking-8 channel infrared tracking sensor module
  • 1.2 Car line tracking-4 channel infrared tracking sensor module
  • 2.1 Drawing a circle-8 channel infrared tracking sensor module
  • 2.2 Drawing a circle-4 channel infrared tracking sensor module
  • 3.Ultrasonic following
  • 4.Ultrasonic avoid
  • 5.Ultrasonic avoid(Servo PTZ)
  • 6.Infrared sensor avoid
  • 7.Light following
  • 8.Gyroscope calibration straight-line walk
  • 9.Infrared remote control
  • 10.Autonomous driving car
7.Vision application course
  • 1.K210 autonomous driving
  • 2.K210 color tracking
  • 3.K210 handwritten digit action
  • 4.K210 color response
  • 5.K210 road sign indication action
  • 6.K210 following machine code
  • 7.K210 QR code command
  • 8.K230 vision line tracking
  • 9.K230 color tracking
  • 10.K230 machine code tracking
  • 11.K230 QR code command
  • 12.K230 autonomous avoid
  • 13.K230 license plate tracking
  • 14.K230 face tracking
  • 15.K230 gaze direction tracking
  • 16.K230 palm tracking
  • 17.K230 target tracking
  • 18.K230 human body tracking
  • 19.K230 OCR character recognition
8.Extended application course (Sold separately)
  • 1.Voice interaction module communication
  • 2.Voice interaction control
  • 3.K230 road sign indication action(Voice)
  • 4.K230 color response(Voice)
  • 5.K230 gesture control(Voice)
  • 6.K230 rock-paper-scissors(Voice)
  • 7.8-channel grayscale color line tracking
  • 8.Bluetooth remote control
  • 9.K210 Scenario-based autonomous driving
  • 10.K230 Scenario-based autonomous driving
Download
  • Code
  • SCH
  • 3D Model File
  • MSPM0 Data Sheet
  • Voice firmware
  • Hardware interface manual
Download ZIP

Welcome to MSPM0 Smart Robot Car repository

6.2 Infrared line tracking sensor-4 channel infrared tracking sensor module

4-Channel Line Tracking Module

2.1 Module Introduction

Basic Parameters

Testing Module

Connect the module's VCC and GND to the main board, other pins of the module do not need to be connected. Turn on the phone camera and aim it at the four-channel infrared sensor, you can see the four sensors emitting faint purple light.

Hold the module away from the desktop, as shown in the figure you can see 4 LED lights are on. Place your finger under one of the sensors, as shown in the figure you can see the corresponding LED light turn off. If this phenomenon occurs, it means the four-channel line tracking module can work normally.

Note: If one of the LED lights does not change, just adjust the corresponding sensor knob to achieve this phenomenon

Actual Usage

Environment requirements: In indoor places with weak infrared light, the black track on the white surface must be greater than 16mm

Four-channel line tracking module (front) Four-channel line tracking module (back)

Debugging (only connect VCC and GND pins of the module):

  • Adjust potentiometer [SW1] so that when photoelectric sensor [P1] faces the white surface, LED light [L1] is off, and when facing the black line, LED light [L1] is on
  • Adjust potentiometer [SW2] so that when photoelectric sensor [P2] faces the white surface, LED light [L2] is off, and when facing the black line, LED light [L2] is on
  • Adjust potentiometer [SW3] so that when photoelectric sensor [P3] faces the white surface, LED light [L3] is off, and when facing the black line, LED light [L3] is on
  • Adjust potentiometer [SW4] so that when photoelectric sensor [P4] faces the white surface, LED light [L4] is off, and when facing the black line, LED light [L4] is on

Note: During debugging, try to maintain the same height from the surface. When adjusting the potentiometer, the rotation range should not be too large, with a rotation range of less than 30 degrees. Slowly slide the module horizontally across the black line, you can see the LED lights turn on and off in sequence. At this time, it means the module has been debugged. If errors occur during subsequent use, simply readjust the potentiometer.

2.2 Hardware Wiring

Four-Channel Line Tracking ModuleMSPM0G3507
5V5V
GNDGND
X1X1
X2X2
X3X3
X4X4

启动小车 (15)

PixPin_2025-11-05_12-08-33

 

image-20251028220253456

2.3 Environment Setup

We open the sysconfig tool and add the following configuration. Here you can adjust your pin configuration according to the actual wiring. Other configurations are omitted here. For details, you can check the sysconfig file provided in the source code.

PixPin_2025-11-05_17-05-02

PixPin_2025-11-05_16-56-02

PixPin_2025-11-05_16-56-15

PixPin_2025-11-05_16-56-22

PixPin_2025-11-05_16-56-30

2.4 Main Functions

Four_GetLineWalking

Function Prototypevoid Four_GetLineWalking(int *LineL1, int *LineL2, int *LineR1, int *LineR2)
Function DescriptionGet the pin level status of four line tracking sensors (LineL1, LineL2, LineR1, LineR2) and return through pointers
Input ParametersLineL1: pointer to variable storing the status of the first left sensor; LineL2: pointer to variable storing the status of the second left sensor; LineR1: pointer to variable storing the status of the first right sensor; LineR2: pointer to variable storing the status of the second right sensor
Return ValueNone

2.5 Experimental Phenomenon

Connect the car wires, connect the OLED module, after burning the program to MSPM0, place the car on a map with white background and black lines, sensor data is displayed on the OLED

Where L2, L1, R1, R2 represent the four sensor data from left to right

image-20251028201826877

Infrared line tracking sensor-8 channel infrared tracking sensor module
Infrared remote control

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文