yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
8-Channel Tracking Module📖
0. 8-channel line tracking module usage
  • 8-channel line tracking module usage
1. Single board tutorials
1.arduino
  • I2C method
  • IO method
  • Serial port method
2.STM32
  • I2C method
  • IO method
  • Serial Port method
3.MSPM0G3507
  • I2C method
  • IO method
  • Serial Port method
5.Raspberry Pi
  • I2C method
  • IO method
  • Serial Port method
4.MSPM0G3519
  • I2Cnew
  • IOnew
  • Serial Portnew
2. Car Tutorials
  • 1.STM32-Wheeled car chassis_V1
  • 2.STM32-Wheeled car chassis_V2
  • 3.STM32 development board car
  • 4.STM32 self-balancing car
  • 5.MSPM0-Wheeled car chassis_V1
  • 6.MSPM0G3507-Wheeled car chassis_V2
  • 7.MSPM0G3519-Wheeled car chassis_V2new
  • 8.Arduino car(Roboduino)
  • 9.Raspberry Pi car(RaspbotV2)
3. Expansion Tutorialsnew
  • 1.Autonomous driving car
  • 2.Vehicle-mounted balance ball motion control system
Download
  • Code
  • Protocol
Download ZIP

Welcome to 8-Channel Tracking Module repository

4.STM32 self-balancing car

STM32 balancing car

1. Experimental preparation

  1. Knowledge reserve

  • Good programming ability (mainly C language)

  • Familiar with the architecture of stm32

  1. Material preparation

  • STM32 balancing car *1

  • Eight-way tracking module *1

  • 12V battery *1

  • Several Dupont wires

2. Car wiring

Wiring of balancing car and infrared sensor (this example uses serial communication)

Balancing CarInfrared sensor
TX2RX
RX2TX
5V5V
GNDGND

As shown in the figure:image-2024110100001

 

 

Main procedures

​x

int main(void)
{   
    
    Mid_Angle = -1; //Obtain based on the car
    
    
    bsp_init();
    
    MPU6050_EXTI_Init();                    //This interrupt service function is placed last
    
    while(!Key1_State(1));
    send_control_data(0,0,1);//Send and receive digital data
    Stop_Flag = 0; //Start controlling

//  OLED_Draw_Line("start tracking!", 1, true, true); 
    
    delay_time(10);//delay 100ms
    
    while(1)
    {
        
        if(g_new_package_flag == 1)
        {
            g_new_package_flag = 0;
        }
        
    }
}

This project uses an external interrupt to perform PID processing for line patrol according to the value of the infrared probe (every 5ms), so that line patrol can be completed on a map with black lines and white background.

In app_irtrackin.c, there is a parameter for adjusting PID line patrol. If you want to increase or decrease the speed and optimize the effect, you can adjust the macro definition value inside.

xxxxxxxxxx

#define IRTrack_Trun_KP (250) //P
#define IRTrack_Trun_KI (0.0001) //I
#define IRTrack_Trun_KD (0.05) //D

#define Track_Speed 15            //Line patrol speed
  • IRTrack_Trun_KP: P value of pid line patrol

  • IRTrack_Trun_KI: I value of pid line patrol

  • IRTrack_Trun_KD: D value of pid line patrol

  • IRR_SPEED: Speed of line patrol

Experimental phenomenon:

On the premise of ensuring that the wiring and installation are correct, after the 8-way line patrol module is calibrated, press the key1 button to start line patrol. ​ If the 8-way module probe cannot detect the black and white lines normally, you need to wait for the module to work normally before pressing the key1 button ​ If the floor is black, you need to put a piece of white paper under our map to cover the black. The main reason is that the material of the map is relatively transparent, which has a greater impact on the 8-way line patrol sensor.

STM32 development board car
MSPM0-Wheeled car chassis_V1

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/中文