STM32-based rocker data sampling and processing system
The STM32-based joystick data sampling and processing system integrates an interface unit, an MCU processing unit, a power supply unit, and a filtering unit to provide a stable sampling reference voltage. This solves the sampling error problem caused by the instability of the ADC chip's reference voltage and improves the data acquisition accuracy and transmission accuracy.
Patent Information
- Application Number
- CN202423058637.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2034-12-11
AI Technical Summary
In existing technologies, joystick data acquisition suffers from sampling data errors due to the instability of the ADC chip's sampling reference voltage, which affects the acquisition accuracy.
A joystick data sampling and processing system based on STM32 is adopted, which integrates an interface unit, an MCU processing unit, a power supply unit, a level conversion unit, and a filtering unit. It provides a stable sampling reference voltage, powers the MCU processing unit through the level conversion unit, and uses the filtering unit to shield external interference.
It improves the accuracy of joystick data acquisition and data transmission, reduces circuit complexity, and eliminates the influence of power supply voltage ripple.
Smart Images

Figure CN223540550U_ABST
Abstract
Description
Technical Field
[0001] This utility model relates to the field of joystick device technology, specifically a joystick data sampling and processing system based on STM32. Background Technology
[0002] Joysticks, as input devices, are widely used in gaming, remote control, industrial automation, and other fields. They allow users to change the position and angle of a joystick to input corresponding commands or data.
[0003] Currently, most joystick controllers on the market use dedicated ADC chips to acquire analog signals for each axis and speed control knob signals. For three-axis joysticks, four ADC channels are required, along with additional I / O to provide other functions such as emergency stop and speed change. After acquisition, the converted digital signals need to be processed by an MCU. However, since ADC chips require a stable reference voltage for sampling, and most current designs use the input power supply voltage to provide the ADC sampling reference voltage, the input voltage ripple can cause instability in the reference voltage, leading to errors in the sampled data and affecting the accuracy of joystick data sampling. Therefore, we need to propose a joystick data sampling and processing system based on STM32 to solve the above problems and provide a stable sampling reference voltage to improve the accuracy of joystick data acquisition. Utility Model Content
[0004] The purpose of this invention is to provide a joystick data sampling and processing system based on STM32, which can provide a stable sampling reference voltage to improve the accuracy of joystick data acquisition and solve the problems mentioned in the background art.
[0005] To achieve the above objectives, this utility model provides the following technical solution: a joystick data sampling and processing system based on STM32, comprising an interface unit for acquiring joystick data, an MCU processing unit for processing received data and having ADC peripheral function, a power supply unit for providing a stable sampling reference voltage, a level conversion unit for RS232 level conversion, and a filtering unit for filtering the MCU processing unit. The interface unit is electrically connected to the MCU processing unit, the power supply unit is electrically connected to both the level conversion unit and the MCU processing unit, and the level conversion unit is electrically connected to the MCU processing unit.
[0006] Preferably, the MCU processing unit includes an STM32 chip U3 and a connection terminal J5 connected to the STM32 chip U3. The STM32 chip U3 is connected to a clock circuit. Pin 44 of the STM32 chip U3 is connected to a resistor R10 to ground. Pin 48 of the STM32 chip U3 is connected to a resistor R80. One end of the resistor R80 is connected to a ground switch K1. Pin 20 of the STM32 chip U3 is connected to a resistor R11 to ground.
[0007] Preferably, the clock circuit includes a crystal oscillator X1, which is connected between pins 5 and 6 of the STM32 chip U3. The input pin of the crystal oscillator X1 is connected to a capacitor C14 to ground, and the output pin of the crystal oscillator X1 is connected to a capacitor C13 to ground and a resistor R9. One end of the resistor R9 is connected to pin 5 of the STM32 chip U3.
[0008] Preferably, the interface unit includes a connection terminal J1 and a connection terminal J3. A capacitor C8 is connected between pins 1 and 2 of the connection terminal J1. A resistor R3 and a resistor R2 are connected in series on pin 4 of the connection terminal J1. The connection end of the resistor R2 and the resistor R3 is connected to pin 11 of the STM32 chip U3. A resistor R5 and a resistor R4 are connected in series on pin 5 of the connection terminal J1. The connection end of the resistor R4 and the resistor R5 is connected to pin 12 of the STM32 chip U3. A resistor R7 and a resistor R6 are connected in series on pin 6 of the connection terminal J1. The connection end of the resistor R6 and the resistor R7 is connected to pin 13 of the STM32 chip U3. The other ends of the resistors R2, R4, and R6 are all grounded. Pins PA4, PB6, PB7, PB12, PB13, PB14, and PB15 of the STM32 chip U3 are respectively connected to the connection terminal J3.
[0009] Preferably, the power supply unit includes an LDO step-down chip U2 for converting 5V voltage to 3.3V. A capacitor C20 is connected between pins 1 and 2 of the LDO step-down chip U2, and a capacitor C19 is connected between pins 1 and 3 of the LDO step-down chip U2. A 3.3V power supply pin is provided at pin 2 of the LDO step-down chip U2, and a resistor R20 is connected to the 3.3V power supply pin. One end of the resistor R20 is connected to a light-emitting diode LED1, and one end of the light-emitting diode LED1 is grounded. Capacitors C1, C3, C4, C5, C6, C15, and C16 are also connected in parallel to the 3.3V power supply pin. A 5V power supply is connected to pin 3 of the LDO step-down chip U2.
[0010] Preferably, the level conversion unit includes an RS-232 to TTL chip U1 and a connection terminal J4. A capacitor C9 is connected between pins 1 and 3 of the RS-232 to TTL chip U1, a capacitor C12 is connected between pins 4 and 5 of the RS-232 to TTL chip U1, a capacitor C10 is connected to pin 2 of the RS-232 to TTL chip U1, and a capacitor C22 is connected to pin 6 of the RS-232 to TTL chip U1. One end of capacitor C10 and... One end of capacitor C22 is grounded. Pins 11 and 12 of the RS-232 to TTL chip U1 are connected to pins 30 and 31 of the STM32 chip U3, respectively. Pins 13 and 14 of the RS-232 to TTL chip U1 are connected to pins 3 and 2 of the connection terminal J4, respectively. Pin 15 of the RS-232 to TTL chip U1 is grounded. Pin 16 of the RS-232 to TTL chip U1 is connected to a 3.3V power supply and capacitor C7, one end of which is grounded.
[0011] Preferably, the filtering unit includes a connection terminal J2 and capacitors C2, C11, C17, and C21, which are respectively connected to pins 11 to 14 of the STM32 chip U3. The other ends of capacitors C2, C11, C17, and C21 are grounded. Pin 1 of the connection terminal J2 is connected to a 5V voltage, and pins 2 and 3 of the connection terminal J2 are respectively connected to pins 32 and 33 of the STM32 chip U3.
[0012] Compared with the prior art, the beneficial effects of this utility model are:
[0013] 1. This utility model integrates a dedicated ADC chip and MCU with an MCU processing unit that has ADC peripheral functions by coordinating an interface unit, an MCU processing unit, a power supply unit, and a level conversion unit. This reduces the complexity of the circuit. Furthermore, the level conversion unit converts the voltage to the MCU power supply voltage and provides a reference voltage for the ADC, thereby eliminating the influence of the power supply voltage ripple and stabilizing the sampling reference voltage, thus improving the accuracy of joystick data acquisition.
[0014] 2. This utility model, through the cooperation of the filtering unit and the MCU processing unit, can effectively shield external interference to the MCU processing unit and improve the accuracy of data transmission of the MCU processing unit. Attached Figure Description
[0015] Figure 1 This is a system block diagram of the present invention;
[0016] Figure 2 This is a circuit diagram of the MCU processing unit of this utility model;
[0017] Figure 3 This is a circuit diagram of the interface unit of this utility model;
[0018] Figure 4 This is a circuit diagram of the power supply unit of this utility model;
[0019] Figure 5 This is a circuit diagram of the level conversion unit of this utility model;
[0020] Figure 6 This is the circuit diagram of the filter unit of this utility model. Detailed Implementation
[0021] The technical solutions of the present utility model will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of the present utility model, and not all embodiments. Based on the embodiments of the present utility model, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of the present utility model.
[0022] Please see Figure 1-6 This utility model provides a technical solution: a joystick data sampling and processing system based on STM32, including an interface unit for acquiring joystick data, an MCU processing unit for processing received data and equipped with an ADC peripheral function, a power supply unit for providing a stable sampling reference voltage, a level conversion unit for RS232 level conversion, and a filtering unit for filtering the MCU processing unit. The interface unit is electrically connected to the MCU processing unit, the power supply unit is electrically connected to both the level conversion unit and the MCU processing unit, and the level conversion unit is electrically connected to the MCU processing unit.
[0023] By integrating a dedicated ADC chip and MCU with an MCU processing unit that has ADC peripheral functions, the complexity of the circuit is reduced. Furthermore, the level conversion unit converts the voltage to the MCU power supply voltage and provides a reference voltage for the ADC, thereby eliminating the influence of power supply voltage ripple and stabilizing the sampling reference voltage, thus improving the accuracy of joystick data acquisition.
[0024] The MCU processing unit includes an STM32 chip U3 and a connection terminal J5 connected to the STM32 chip U3. A clock circuit is connected to the STM32 chip U3. A resistor R10 is connected to ground at pin 44 of the STM32 chip U3, and a resistor R80 is connected to pin 48 of the STM32 chip U3. One end of the resistor R80 is connected to a ground switch K1. A resistor R11 is connected to ground at pin 20 of the STM32 chip U3. Figure 2As shown, the STM32 chip U3 is connected to other circuits through the connection terminal J5 to realize data input, output and communication functions. The connection state between resistor R80 and STM32 chip U3 is changed by the opening and closing of switch K1, so as to realize the control of the circuit opening and closing of switch K1.
[0025] The clock circuit includes a crystal oscillator X1, which is connected between pins 5 and 6 of the STM32 chip U3. The input pin of the crystal oscillator X1 is connected to a capacitor C14 to ground, and the output pin of the crystal oscillator X1 is connected to a capacitor C13 to ground and a resistor R9. One end of the resistor R9 is connected to pin 5 of the STM32 chip U3. The coordinated operation of the crystal oscillator X1, capacitors C13 and C14, and resistor R9 provides a stable clock signal for the STM32 chip U3, ensuring that the STM32 chip U3 can operate according to the predetermined timing sequence.
[0026] The interface unit includes connection terminal J1 and connection terminal J3. A capacitor C8 is connected between pins 1 and 2 of connection terminal J1. Resistors R3 and R2 are connected in series on pin 4 of connection terminal J1. The connection between resistors R2 and R3 is connected to pin 11 of STM32 chip U3. Resistors R5 and R4 are connected in series on pin 5 of connection terminal J1. The connection between resistors R4 and R5 is connected to pin 12 of STM32 chip U3. Resistor R7 is connected in series on pin 6 of connection terminal J1. Resistor R6 and resistor R7 are connected to pin 13 of STM32 chip U3. The other ends of resistors R2, R4, and R6 are grounded. Pins PA4, PB6, PB7, PB12, PB13, PB14, and PB15 of STM32 chip U3 are connected to connection terminal J3. Connection terminal J1 is used to connect the joystick for collecting joystick data. Connection terminal J3 is used to provide a connection channel for connecting external devices.
[0027] The power supply unit includes an LDO step-down chip U2 for converting 5V voltage to 3.3V. A capacitor C20 is connected between pins 1 and 2 of the LDO step-down chip U2, and a capacitor C19 is connected between pins 1 and 3 of the LDO step-down chip U2. A 3.3V power supply pin is located at pin 2 of the LDO step-down chip U2, and a resistor R20 is connected to this 3.3V power supply pin. One end of the resistor R20 is connected to a light-emitting diode LED1, and one end of the LED1 is grounded. Capacitors C1, C3, C4, C5, C6, and C15 are also connected in parallel to the 3.3V power supply pin. Capacitor C16 is used to filter and regulate the voltage output of the LDO step-down chip U2, which is connected to a 5V power supply. The LDO step-down chip U2 converts the 5V voltage to a 3.3V output voltage. Capacitors C19 and C20 are used to filter and regulate the voltage output of the LDO step-down chip U2, making the voltage output stable. The parallel connection of capacitors C1, C3, C4, C5, C6, C15, and C16 further enhances the stability of the output voltage, thereby reducing output voltage fluctuations and improving the stability of the voltage output. LED1 is used to indicate the working status of the power supply unit, so that users can intuitively confirm the working status of the power supply unit.
[0028] The level conversion unit includes an RS-232 to TTL chip U1 and a connection terminal J4. A capacitor C9 is connected between pins 1 and 3 of the RS-232 to TTL chip U1; a capacitor C12 is connected between pins 4 and 5 of the RS-232 to TTL chip U1; a capacitor C10 is connected to pin 2 of the RS-232 to TTL chip U1; and a capacitor C22 is connected to pin 6 of the RS-232 to TTL chip U1. One end of capacitor C10 and one end of capacitor C22 are both grounded. The RS-232 to TTL chip U1... Pins 11 and 12 are connected to pins 30 and 31 of the STM32 chip U3, respectively. Pins 13 and 14 of the RS-232 to TTL chip U1 are connected to pins 3 and 2 of the connection terminal J4, respectively. Pin 15 of the RS-232 to TTL chip U1 is grounded. Pin 16 of the RS-232 to TTL chip U1 is connected to a 3.3V power supply and a capacitor C7. One end of the capacitor C7 is grounded. The RS-232 to TTL chip U1 converts RS1232 level signals to TTL level signals to enable communication between different devices.
[0029] The filtering unit includes a connection terminal J2 and capacitors C2, C11, C17, and C21, which are respectively connected to pins 11 to 14 of the STM32 chip U3. The other ends of capacitors C2, C11, C17, and C21 are grounded. Pin 1 of the connection terminal J2 is connected to a 5V voltage, and pins 2 and 3 of the connection terminal J2 are respectively connected to pins 32 and 33 of the STM32 chip U3. The capacitors C2, C11, C17, and C21 form a low-pass filter, which can filter out high-frequency noise components in the input signal. The filtered signal is transmitted to pins 32 and 33 of the STM32 chip U3 through pins 2 and 3 of the connection terminal J2. This achieves filtering processing of external input signals, provides a stable and clean signal input for the STM32 chip U3, and improves the accuracy of data transmission of the STM32 chip U3.
[0030] Although embodiments of the present invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the present invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A joystick data sampling and processing system based on STM32, characterized in that: The device includes an interface unit for acquiring joystick data, an MCU processing unit for processing received data and equipped with an ADC peripheral, a power supply unit for providing a stable sampling reference voltage, a level conversion unit for RS232 level conversion, and a filtering unit for filtering the MCU processing unit. The interface unit is electrically connected to the MCU processing unit, the power supply unit is electrically connected to both the level conversion unit and the MCU processing unit, and the level conversion unit is electrically connected to the MCU processing unit.
2. The joystick data sampling and processing system based on STM32 according to claim 1, characterized in that: The MCU processing unit includes an STM32 chip U3 and a connection terminal J5 connected to the STM32 chip U3. A clock circuit is connected to the STM32 chip U3. A ground resistor R10 is connected to pin 44 of the STM32 chip U3. A resistor R80 is connected to pin 48 of the STM32 chip U3. One end of the resistor R80 is connected to a ground switch K1. A ground resistor R11 is connected to pin 20 of the STM32 chip U3.
3. The joystick data sampling and processing system based on STM32 according to claim 2, characterized in that: The clock circuit includes a crystal oscillator X1, which is connected between pins 5 and 6 of the STM32 chip U3. The input pin of the crystal oscillator X1 is connected to a capacitor C14 to ground, and the output pin of the crystal oscillator X1 is connected to a capacitor C13 to ground and a resistor R9. One end of the resistor R9 is connected to pin 5 of the STM32 chip U3.
4. The joystick data sampling and processing system based on STM32 according to claim 3, characterized in that: The interface unit includes connection terminal J1 and connection terminal J3. A capacitor C8 is connected between pins 1 and 2 of connection terminal J1. Resistors R3 and R2 are connected in series on pin 4 of connection terminal J1. The connection end of resistors R2 and R3 is connected to pin 11 of STM32 chip U3. Resistors R5 and R4 are connected in series on pin 5 of connection terminal J1. The connection end of resistors R4 and R5 is connected to pin 12 of STM32 chip U3. Resistors R7 and R6 are connected in series on pin 6 of connection terminal J1. The connection end of resistors R6 and R7 is connected to pin 13 of STM32 chip U3. The other ends of resistors R2, R4, and R6 are all grounded. Pins PA4, PB6, PB7, PB12, PB13, PB14, and PB15 of STM32 chip U3 are respectively connected to connection terminal J3.
5. The joystick data sampling and processing system based on STM32 according to claim 4, characterized in that: The power supply unit includes an LDO step-down chip U2 for converting 5V voltage to 3.3V. A capacitor C20 is connected between pins 1 and 2 of the LDO step-down chip U2, and a capacitor C19 is connected between pins 1 and 3 of the LDO step-down chip U2. A 3.3V power supply pin is provided at pin 2 of the LDO step-down chip U2, and a resistor R20 is connected to the 3.3V power supply pin. One end of the resistor R20 is connected to a light-emitting diode LED1, and one end of the light-emitting diode LED1 is grounded. Capacitors C1, C3, C4, C5, C6, C15, and C16 are also connected in parallel to the 3.3V power supply pin. A 5V power supply is connected to pin 3 of the LDO step-down chip U2.
6. The joystick data sampling and processing system based on STM32 according to claim 5, characterized in that: The level conversion unit includes an RS-232 to TTL chip U1 and a connection terminal J4. A capacitor C9 is connected between pins 1 and 3 of the RS-232 to TTL chip U1; a capacitor C12 is connected between pins 4 and 5 of the RS-232 to TTL chip U1; a capacitor C10 is connected to pin 2 of the RS-232 to TTL chip U1; and a capacitor C22 is connected to pin 6 of the RS-232 to TTL chip U1. One end of capacitor C10 and capacitor J4 are connected to the TTL chip U1. One end of C22 is grounded. Pins 11 and 12 of the RS-232 to TTL chip U1 are connected to pins 30 and 31 of the STM32 chip U3, respectively. Pins 13 and 14 of the RS-232 to TTL chip U1 are connected to pins 3 and 2 of the connection terminal J4, respectively. Pin 15 of the RS-232 to TTL chip U1 is grounded. Pin 16 of the RS-232 to TTL chip U1 is connected to a 3.3V power supply and a capacitor C7, one end of which is grounded.
7. The joystick data sampling and processing system based on STM32 according to claim 6, characterized in that: The filtering unit includes a connection terminal J2 and capacitors C2, C11, C17, and C21, which are respectively connected to pins 11 to 14 of the STM32 chip U3. The other ends of capacitors C2, C11, C17, and C21 are grounded. Pin 1 of the connection terminal J2 is connected to a 5V voltage, and pins 2 and 3 of the connection terminal J2 are respectively connected to pins 32 and 33 of the STM32 chip U3.