yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
STM32-BoardCar📖
0. Get started quickly
  • 0.ReadMe
  • 1. Installation Instructions
  • 2. Version configuration
  • 3. Smart car installation video
  • 4. Precautions for use
1. Introduction to STM32 development board
  • 1. Learn about STM32
  • 2. Introduction to STM32 development board
  • 3. Development board pin assignment
  • 4. Introduction to HAL library and LL library
2. Setting up and using the development environment
  • 1. Common development tools
  • 2. STM32CubeMX Install - Use
  • 3. STM32CubeIDE Install - Use
  • 4. Common Driver Installation
  • 5. Program download and simulation
  • 6. Engineering experience and migration
3. Development board basic tutorial
  • 1. RGB searchlight (GPIO)
  • 2. Buzzer control (GPIO)
  • 3. Button control (EXTI)
  • 4. Serial communication (UASRT)
  • 5. Voltage detection (ADC)
  • 6. Internal temperature sensor(ADC)
  • 7. Independent watchdog(IWDG)
  • 8. Window watchdog(WWDG)
  • 9. Basic timer (TIM6)
  • 10. Universal Timer (TIM3)
  • 11. Advanced timers (TIM1)
  • 12. I2C Communication (IIC)
  • 13. Off-chip Flash (SPI)
  • 14. On-chip Flash (Flash)
  • 15. DMA:USART
  • 16. DMA:SPI
  • 17. DMA:I2C
  • 18. USB communication
  • 19. USB analog U disk
  • 20. FreeRTOS
4. Car expansion tutorial
  • 1. Servo control
  • 2. Basic use of ultrasonic steering gear gimbal
  • 3. Motor control
  • 4. OLED display light sensitivity value
  • 5. Infrared sensor
  • 6. Four-way tracking module
  • 7. Infrared remote control
  • 8. Ultrasonic ranging
  • 9. PS2 controller test
  • 10.K230 Vision Module
  • 11.AI voice interaction integration module
5. Robot car tutorials
  • 1. Car line patrol
  • 2. Ultrasonic follow
  • 3. Ultrasonic obstacle avoidance
  • 4. Ultrasonic obstacle avoidance (servo gimbal version)
  • 5. Infrared sensor obstacle avoidance
  • 6. Infrared remote control
  • 7. PS2 handle remote control
  • 8.K230 face tracking on PTZ
  • 9.K230 color tracking
  • 10.K230 Color Line Patrol
  • 11.K230 QR code command
  • 12.K230 machine code tracking
  • 13.K230 road sign indication action (voice)
  • 14.K230 color response (voice)
  • 15.K230 gesture control (voice)
  • 16.K230 Rock-Paper-Scissors Game (Voice)
6. Operation video
  • 1-How to install STM32CubeIDE software
  • 2-How to create Demo project
  • 3-How to download code into STM32 robot car
  • 4-How to open and compile a code file for STM32
  • 5-About IR control and Charge battery
Download
  • Code
  • SCH
  • Software File
  • STM32 Chip DataSheet
  • Installation manual
Download ZIP

Welcome to STM32-BoardCar repository

10.K230 Vision Module

k230 visual recognition module

k230 visual recognition module1. Software-Hardware2. Brief Principle1. Hardware Schematic2. Physical connection diagram3. Control Principle3. Project configuration1. Description2. Pin configuration4. Main functions1. User function5. Experimental phenomenon

This tutorial demonstrates: how to use the STM32 expansion board with the k230 visual recognition module and how to control the k230 module using the function keys on the expansion board.

1. Software-Hardware

  • STM32F103CubeIDE

  • STM32 Robot Development Board

Function keys integrated on the development board

  • k230 visual module

  • Type-C data cable or ST-Link

Download or simulate the development board

  • Serial Port Assistant

Receive serial port data and print

2. Brief Principle

1. Hardware Schematic

image-20230925153122335

2. Physical connection diagram

image-20230926100744845

3. Control Principle

(Schematic Name)Control pinSpecific meaning
USART2_RXPD6Transmitter
USART2_TXPD5Receiver

Serial communication:

USART: Universal synchronous asynchronous receiver and transmitter. It is a hardware peripheral integrated in STM32. It can automatically generate data frame timing according to a byte of data in the data register and send it out from the TX pin. It can also automatically receive the data frame timing of the RX pin and splice it into a byte of data and store it in the data register. **

STM32F103ZET6 has 3 USARTs and 2 UARTs. USART2 is used in this experiment.

When using the serial port for communication, the two communicating parties must be "same channel". "Same channel" refers to the same communication protocol. Serial port (USART) agreement: data must be transmitted in the form of "frames" during communication. A frame of serial port data includes: start bit + data bit + check bit + stop bit Among them:

  1. Start bit: fixed to a low-level signal of 1 cycle

  2. Data bit: can be agreed upon by both parties to the communication to be 5 ~ 9 bits

  3. Check bit: The serial port uses parity check, which can be agreed upon by both parties to the communication

  4. Stop bit: optional 0.5 ~ 2 cycles of high level At the same time, in order to synchronize the sending and receiving speed of the two-way communication, it is also necessary to agree on the number of data frames transmitted per second, which is called baud rate. Typical baud rates are 9600, 115200, 57600...

The functions of the k230 visual module are distributed as follows:

In order to compress the module volume, our K230 module does not lead out all the pins supported by the chip. Let's take a look at some commonly used pins of YAHBOOM K230

  1. Two rows of pins next to the heat sink

image-20250401105100224

1: GPIO 42, can be reused as: GPIO42 / UART1_RTS / PWM0 / QSPI1_D2 / RESV /

2: GPIO 43, can be reused as: GPIO43 / UART1_CTS / PWM1 / QSPI1_D3 / RESV /

3: GPIO 33, can be reused as: GPIO33 / IIC0_SDA / IIS_WS / UART3_RXD / RESV /

4: GND

5: GPIO 32, can be reused as: GPIO32 / IIC0_SCL / IIS_CLK / UART3_TXD / RESV /

6: GPIO 26, can be reused as: GPIO26 / MMC1_CLK / RESV / PDM_CLK /

7: GND

8: GPIO 34, can be reused as: GPIO34 / IIC1_SCL / IIS_D_IN0 / PDM_IN3 / UART3_RTS /

9: 5v output

10: GPIO 35, can be reused as: GPIO35 / IIC1_SDA / IIS_D_OUT0 / PDM_IN1 / UART3_CTS /

11: 5v output

12: 3.3v output

! ! ! When connecting the 12pin GPIO, please be sure to confirm the silkscreen mark to ensure the correct connection. After-sales repair service will not be provided for man-made damage caused by short circuit, reverse connection, overvoltage or overcurrent. ! ! ! !

The operation process is as follows:

Yes
No
Yes
No
Yes
No
Start
Press the function button of the expansion board
Did you press key1?
Send color command to K230
Did you press key2?
Send color command to K230
Did you press key3?
Send color command to K230
Turn off the RGB light on the expansion board
K230 receives the command and gives feedback
Turn off the RGB light
K230 sends information to the MCU
K230 sends information to the MCU
The expansion board RGB lights up the specified color

 

3. Project configuration

1. Description

Omitted project configuration part: New project, chip selection, project configuration, pin configuration SYS, RCC configuration, clock configuration and project configuration content

xxxxxxxxxx
Please refer to [2. Development environment construction and use: STM32CubeIDE installation-use] to understand how the omitted part of the project is configured

2. Pin configuration

image-20230926100744845

image-20230926100744845

image-20230926100744845

 

image-20230926100744845

image-20230926100744845

4. Main functions

According to our tutorial, STM32CubeIDE can generate the corresponding gpio.c, gpio.h, tim.c and tim.h files. For the later transplantation and peripheral module driver, we will place the automatically generated code in the BSP folder under the project file.

1. User function

Function: Send_k230

Function prototypevoid Send_k230(uint8_t *data_str, uint16_t datasize)
Function descriptionControl the status of the RGB light on k230
Input parameter 1Data
Input parameter 2Data length
Output parameterNone

Function: Deal_k230

Function prototypevoid Deal_k230(uint8_t recv_msg)
Function descriptionRetain information of k230
Input parameterInformation sent by the serial port
Output parameterNone

Function: Change_RGB

Function prototypevoid Change_RGB(void)
Function descriptionChange the onboard RGB status
Input parametersNone
Output parametersNone

Communication protocol:

k230 part:

Receiving part: When receiving MCU data from the serial port, parse it, and then the RGB light will give corresponding color feedback.

Sending part: k230 will send the color data through the serial port again, the format is "$"+color name+"#".

MCU part:

Sending part: When the expansion board button is pressed, the color data will be sent to k230 through the serial port.

Receiving part: Receive the data sent by k230 through the serial port and process each bit of the data.

Determine the data frame: If it is "$", the flag position is 1, and then the string array is initialized; then process the next bit of data, if it is not "#", the content is stored in the data. Until "#" is recognized, the flag position is 0, and then the array data is processed. When the array content is compared to the specific content, the RGB light on the car expansion board will give the corresponding color feedback.

5. Experimental phenomenon

After downloading the program, we connect the k230 and the expansion board. Then we control the RGB light of k230 through the function keys on the expansion board.

When we press the key1 button, the RGB light of k230 will light up a color. Press the key1 key once, and it will light up a color;

When we press the key2 button, the RGB light of k230 will light up the other three colors (three different colors from pressing the key1 key), and press the key2 key once, and it will light up a color;

When we press the key3 button, the RGB light of k230 will turn off.

The RGB light of the car will be synchronized with the state of k230.

xxxxxxxxxx
For program download, please refer to [2. Development environment construction and use: program download and simulation]

How to download k230 code:

Required tools: K230, SD card, CanMV IDE K230

We find the K230uart_car.py file in the project folder, then drag it to CanMV IDE K230, and then choose to save the opened script as main.py to CanMV

image-20250617182714766

PS2 controller test
AI voice interaction integration module

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

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文