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

Serial Port method

Raspberry Pi - Serial Port Method

Raspberry Pi - Serial Port MethodExperimental preparationExperimental purposeExperimental wiringOpen the Raspberry Pi hard serial port (Raspberry Pi 5 does not require this step)Experimental steps and phenomenaExperimental source code

Experimental preparation

  1. Raspberry Pi motherboard

  2. 8-channel line patrol module

  3. Several Dupont cables

The Raspberry Pi board needs to download the serial communication source code provided in the document, and the Raspberry Pi system needs to open the serial communication interface through raspi-config

Experimental purpose

The content of this experiment is mainly to use the Raspberry Pi main control to receive the data of the 8-channel line patrol module through the serial port.

Experimental wiring

Raspberry Pi8-channel line patrol module
TXRX
RXTX
5v5v
GNDGND

As shown in the figure: image-2024110100001

Open the Raspberry Pi hard serial port (Raspberry Pi 5 does not require this step)

  • Configure the Raspberry Pi serial port first, because the Raspberry Pi's hard serial port is used for Bluetooth, and the mini serial port is unstable. This experiment uses the hard serial port. Raspberry Pi pin diagram

  • image-2022120500001

  1. First perform the following operations to map the serial port Enter sudo raspi-config in the terminal

  2. image-2022120500008

  3. image-2022120500009

  4. image-2022120500010

  5. image-2022120500011

  6. Set the hardware serial port to GPIO serial port, edit /boot/config.txt with root privileges.

The command is:

sudo nano /boot/config.txt

After opening the file, add two lines at the end

xxxxxxxxxx
dtoverlay=miniuart-bt 
force_turbo=1

image-2022120500013 Save: Ctrl+O, exit: Ctrl+X.

  1. Save and exit, then restart the Raspberry Pi and you can see that the serial ports have been swapped. image-2022120500012 Reference Links: https://blog.iyatt.com/?p=1817

Experimental steps and phenomena

  1. After connecting the wires, run the script

xxxxxxxxxx
python3 UASRT.py

image-2024110100002

 

Experimental source code

xxxxxxxxxx
#Main function
if __name__ == "__main__":
    print("start it")
    
    try:
        while True:
            usart_deal()
    except KeyboardInterrupt:
        pass
    finally:
        ser.write(bytes("$0,0,0#",'utf-8'))

This source code only writes numerical data. If you need to parse analog data, you can refer to STM32 serial port parsing

 

 

IO method
I2C

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