Single-turn absolute encoder circuit based on AT32 single-chip microcomputer
By designing a single-turn absolute encoder circuit based on the AT32 microcontroller, the problems of complex wiring, low accuracy, and poor anti-interference ability of traditional encoders are solved, and a high-precision, low-cost, and highly anti-interference encoder circuit is realized.
Patent Information
- Application Number
- CN202520300993.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-25
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2035-02-25
AI Technical Summary
Traditional single-turn absolute encoders suffer from problems such as complex wiring, low accuracy, and poor anti-interference ability in practical applications.
Design a single-turn absolute encoder circuit based on the AT32 microcontroller. By connecting specific pins and circuit components, a circuit structure with high precision, high integration, and strong anti-interference capability can be achieved.
It improves the accuracy and anti-interference ability of the encoder, reduces costs, and enables the output of digital signals.
Smart Images

Figure CN223796041U_ABST
Abstract
Description
Technical Field
[0001] This utility model relates to the field of encoder technology, specifically a single-turn absolute encoder circuit based on an AT32 microcontroller. Background Technology
[0002] A single-turn absolute encoder is a sensor that can directly output absolute position information and is widely used in automation, robotics, CNC machine tools, and other fields for accurately measuring rotation angles and positions. However, traditional single-turn absolute encoders currently suffer from problems in practical applications, such as complex wiring, low accuracy, and poor anti-interference capabilities. Summary of the Invention
[0003] To overcome the shortcomings of the prior art, this utility model provides a single-turn absolute encoder circuit based on the AT32 microcontroller.
[0004] To achieve the above objectives, a single-turn absolute encoder circuit based on an AT32 microcontroller is designed. The circuit includes a microcontroller, with pin 1 connected to a +3.3V power supply; pin 5 connected to one end of capacitor 4 and one end of the crystal oscillator; pin 6 connected to one end of capacitor 6 and the other end of the crystal oscillator; the other ends of capacitors 4 and 6 are combined and grounded; pin 12 connected to one end of capacitor 17 and ground; pin 13 connected to the other end of capacitor 17 and ground; and pin 28 connected to one end of resistor 7, with the other end of resistor 7 grounded. Pin 33 of the microcontroller is connected to one end of resistor 16 and pin 1 of the Hall chip. The other end of resistor 16 is connected to a +3.3V power supply. Pin 34 of the microcontroller is connected to one end of resistor 17 and pin 8 of the Hall chip. The other end of resistor 17 is connected to a +3.3V power supply. Pin 35 of the microcontroller is connected to pin 6 of the Hall chip. Pin 36 of the microcontroller is connected to one end of resistor 18 and pin 7 of the Hall chip. The other end of resistor 18 is grounded. Pin 57 of the microcontroller is connected to pin 7 of the memory chip and one end of resistor 15. The other end of resistor 15 is connected to a +3.3V power supply.
[0005] The microcontroller's pin 3 is connected to one end of resistor 3, and the other end of resistor 3 is connected to the cathode of LED 1. The anode of LED 1 is connected to a +3.3V power supply. The microcontroller's pin 4 is connected to one end of resistor 4, and the other end of resistor 4 is connected to the cathode of LED 2. The anode of LED 2 is connected to a +3.3V power supply.
[0006] Pin 18 of the microcontroller is connected to one end of capacitor nine and ground, pin 19 of the microcontroller is connected to the other end of capacitor nine and +3.3V power supply, pin 31 of the microcontroller is connected to one end of capacitor five and ground, pin 32 of the microcontroller is connected to the other end of capacitor five and +3.3V power supply, pin 47 of the microcontroller is connected to one end of capacitor seven and ground, pin 48 of the microcontroller is connected to the other end of capacitor seven and +3.3V power supply, pin 63 of the microcontroller is connected to one end of capacitor eight, and pin 64 of the microcontroller is connected to the other end of capacitor eight and +3.3V power supply.
[0007] Pins 2 and 5 of the Hall chip are left floating. Pin 3 of the Hall chip is connected to a +3.3V power supply and one end of capacitor one, respectively. The other end of capacitor one is connected to pin 4 of the Hall chip and ground. The positive terminal of tantalum capacitor three is connected to a +3.3V power supply. The negative terminal of tantalum capacitor three is grounded.
[0008] Pin 42 of the microcontroller is connected to terminal 2 of the programming port, pin 43 of the microcontroller is connected to terminal 1 of the programming port, terminal 3 of the programming port is grounded, terminal 4 of the programming port is connected to one end of resistor 20 and one end of resistor 21, the other end of resistor 20 is connected to the base of transistor 1, the emitter of transistor 1 is grounded, the collector of transistor 1 is connected to one end of resistor 13 and one end of resistor 14, the other end of resistor 13 is connected to pin 60 of the microcontroller, the other end of resistor 14 is connected to a +3.3V power supply, and the other end of resistor 21 is connected to a +3.3V power supply.
[0009] Pin 44 of the microcontroller is connected to pin 4 of the communication chip. Pin 45 of the microcontroller is connected to pin 1 of the communication chip. Pin 3 of the communication chip is connected to one end of capacitor eleven and the +5V power supply. Pin 8 of the communication chip is connected to the other end of capacitor eleven, pin 2 of the communication chip, one end of capacitor thirteen, terminal 4 of socket one, and ground. Pin 5 of the communication chip is connected to one end of resistor eight, one end of resistor ten, and the other end of capacitor thirteen. Pin 6 of the communication chip is connected to the other end of resistor one, one end of resistor nine, and terminal 2 of socket one. Pin 7 of the communication chip is connected to the other end of resistor eight, the other end of resistor nine, and terminal 3 of socket one. Terminal 1 of socket one is connected to one end of fuse one, and the other end of fuse one is connected to the +5V power supply.
[0010] Pin 7 of the microcontroller is connected to terminal 8 of the test port, one end of resistor 1, and one end of capacitor 2. The other end of resistor 1 is connected to a +3.3V power supply, and the other end of capacitor 2 is grounded. Pin 46 of the microcontroller is connected to terminal 5 of the test port. Pin 49 of the microcontroller is connected to terminal 7 of the test port. Pin 50 of the microcontroller is connected to terminal 4 of the test port. Pin 55 of the microcontroller is connected to terminal 3 of the test port. Pin 56 of the microcontroller is connected to terminal 6 of the test port. Terminal 1 of the test port is connected to a +3.3V power supply. Terminals 9 and 10 of the test port are both grounded.
[0011] Pin 58 of the microcontroller is connected to one end of resistor 5 and pin 6 of the memory chip. Pin 59 of the microcontroller is connected to one end of resistor 6 and pin 5 of the memory chip. Pins 1, 2, 3, and 4 of the memory chip are all grounded. Pin 8 of the memory chip is connected to one end of capacitor 10, the other end of resistor 5, the other end of resistor 6, and a +3.3V power supply. The other end of capacitor 10 is grounded.
[0012] It also includes a voltage regulator chip. Pin 3 of the voltage regulator chip is connected to the cathode of transient suppression diode 1, the anode of tantalum capacitor 12, one end of capacitor 15, and a +5V power supply. Pin 2 of the voltage regulator chip is connected to the anode of tantalum capacitor 14 and one end of inductor 1. The other end of inductor 1 is connected to one end of capacitor 16 and outputs a +3.3V power supply. Pin 1 of the voltage regulator chip is grounded. The anode of transient suppression diode 1, the cathode of tantalum capacitor 12, the other end of capacitor 15, the cathode of tantalum capacitor 14, and the other end of capacitor 16 are grounded.
[0013] Compared with the prior art, this utility model has high precision and integration, digital signal output, low cost and strong anti-interference characteristics. Attached Figure Description
[0014] Figure 1 This is the circuit diagram of this utility model.
[0015] Figure 2 This is a partial enlarged view of the Hall chip of this utility model.
[0016] Figure 3 This is a partial enlarged view of the communication chip of this utility model.
[0017] Figure 4 This is a partial enlarged view of the memory chip of this utility model. Detailed Implementation
[0018] The present invention will be further described below with reference to the accompanying drawings.
[0019] like Figures 1 to 4As shown, pin 1 of microcontroller U is connected to a +3.3V power supply. Pin 5 of microcontroller U is connected to one end of capacitor C4 and one end of crystal oscillator XTAL1. Pin 6 of microcontroller U is connected to one end of capacitor C6 and the other end of crystal oscillator CTAL1. The other ends of capacitors C4 and C6 are combined and grounded. Pin 12 of microcontroller U is connected to one end of capacitor C17 and ground. Pin 13 of microcontroller U is connected to the other end of capacitor C17 and ground. Pin 28 of microcontroller U is connected to one end of resistor R7, and the other end of resistor R7 is grounded. Pin 33 of microcontroller U is connected to resistor R16. One end of the Hall chip U1 is connected to pin 1, and the other end of resistor 16R16 is connected to a +3.3V power supply. Pin 34 of microcontroller U is connected to one end of resistor 17R17 and pin 8 of Hall chip U1. The other end of resistor 17R17 is connected to a +3.3V power supply. Pin 35 of microcontroller U is connected to pin 6 of Hall chip U1. Pin 36 of microcontroller U is connected to one end of resistor 18R18 and pin 7 of Hall chip U1. The other end of resistor 18R18 is grounded. Pin 57 of microcontroller U is connected to pin 7 of memory chip U2 and one end of resistor 15R15. The other end of resistor 15R15 is connected to a +3.3V power supply.
[0020] Pin 3 of the microcontroller U is connected to one end of resistor R3. The other end of resistor R3 is connected to the cathode of LED H1. The anode of LED H1 is connected to a +3.3V power supply. Pin 4 of the microcontroller U is connected to one end of resistor R4. The other end of resistor R4 is connected to the cathode of LED H2. The anode of LED H2 is connected to a +3.3V power supply.
[0021] Pin 18 of microcontroller U is connected to one end of capacitor C9 and ground. Pin 19 of microcontroller U is connected to the other end of capacitor C9 and +3.3V power supply. Pin 31 of microcontroller U is connected to one end of capacitor C5 and ground. Pin 32 of microcontroller U is connected to the other end of capacitor C5 and +3.3V power supply. Pin 47 of microcontroller U is connected to one end of capacitor C7 and ground. Pin 48 of microcontroller U is connected to the other end of capacitor C7 and +3.3V power supply. Pin 63 of microcontroller U is connected to one end of capacitor C8. Pin 64 of microcontroller U is connected to the other end of capacitor C8 and +3.3V power supply.
[0022] Pins 2 and 5 of Hall chip U1 are left floating. Pin 3 of Hall chip U1 is connected to the +3.3V power supply and one end of capacitor C1. The other end of capacitor C1 is connected to pin 4 of Hall chip U1 and ground. The positive terminal of tantalum capacitor C3 is connected to the +3.3V power supply. The negative terminal of tantalum capacitor C3 is grounded.
[0023] Pin 42 of the microcontroller U is connected to terminal 2 of the programming port COM_1. Pin 43 of the microcontroller U is connected to terminal 1 of the programming port COM_1. Terminal 3 of the programming port COM_1 is grounded. Terminal 4 of the programming port COM_1 is connected to one end of resistor 20R20 and one end of resistor 21R21. The other end of resistor 20R20 is connected to the base of transistor Q1. The emitter of transistor Q1 is grounded. The collector of transistor Q1 is connected to one end of resistor 13R13 and one end of resistor 14R14. The other end of resistor 13R13 is connected to pin 60 of the microcontroller U. The other end of resistor 14R14 is connected to a +3.3V power supply. The other end of resistor 21R21 is connected to a +3.3V power supply.
[0024] Pin 44 of microcontroller U is connected to pin 4 of communication chip IC3. Pin 45 of microcontroller U is connected to pin 1 of communication chip IC3. Pin 3 of communication chip IC3 is connected to one end of capacitor 11C11 and the +5V power supply. Pin 8 of communication chip IC3 is connected to the other end of capacitor 11C11, pin 2 of communication chip IC3, one end of capacitor 13C13, terminal 4 of socket JP1, and ground. Pin 5 of communication chip IC3 is connected to one end of resistor 8R8, one end of resistor 10R10, and the other end of capacitor 13C13. Pin 6 of communication chip IC3 is connected to the other end of resistor 1R10, one end of resistor 9R9, and terminal 2 of socket JP1. Pin 7 of communication chip IC3 is connected to the other end of resistor 8R8, the other end of resistor 9R9, and terminal 3 of socket JP1. Terminal 1 of socket JP1 is connected to one end of fuse 1F1, and the other end of fuse 1F1 is connected to the +5V power supply. In practical use, it communicates with the host computer through the communication chip IC3.
[0025] Pin 7 of microcontroller U is connected to terminal 8 of test port JTAG1, one end of resistor R1, and one end of capacitor C2. The other end of resistor R1 is connected to the +3.3V power supply, and the other end of capacitor C2 is grounded. Pin 46 of microcontroller U is connected to terminal 5 of test port JTAG1. Pin 49 of microcontroller U is connected to terminal 7 of test port JTAG1. Pin 50 of microcontroller U is connected to terminal 4 of test port JTAG1. Pin 55 of microcontroller U is connected to terminal 3 of test port JTAG1. Pin 56 of microcontroller U is connected to terminal 6 of test port JTAG1. Terminal 1 of test port JTAG1 is connected to the +3.3V power supply. Terminals 9 and 10 of test port JTAG1 are both grounded.
[0026] Pin 58 of microcontroller U is connected to one end of resistor R5 and pin 6 of memory chip U2. Pin 59 of microcontroller U is connected to one end of resistor R6 and pin 5 of memory chip U2. Pins 1, 2, 3, and 4 of memory chip U2 are grounded. Pin 8 of memory chip U2 is connected to one end of capacitor C10, the other end of resistor R5, the other end of resistor R6, and a +3.3V power supply. The other end of capacitor C10 is grounded. Memory chip U2 is connected to microcontroller U and serves to store information.
[0027] The system also includes a voltage regulator chip IC2. Pin 3 of IC2 is connected to the cathode of transient suppression diode Z1, the anode of tantalum capacitor C12 (twelfth generation), one end of capacitor C15 (fifteenth generation), and a +5V power supply. Pin 2 of IC2 is connected to the anode of tantalum capacitor C14 (fourteenth generation), one end of inductor L1, and the other end of inductor L1 is connected to one end of capacitor C16 (sixteenth generation), outputting a +3.3V power supply. Pin 1 of IC2 is grounded. The anode of transient suppression diode Z1, the cathode of tantalum capacitor C12 (twelfth generation), the other end of capacitor C15 (fifteenth generation), the cathode of tantalum capacitor C14 (fourteenth generation), and the other end of capacitor C16 (sixteenth generation) are all grounded. The external +5V power supply to the voltage regulator chip effectively regulates the input voltage and maintains the stability of the output voltage. The output +3.3V power supply provides power to the microcontroller, Hall effect chip U1, memory chip U2, communication chip IC3, test port JTAG1, and programming port COM_1.
[0028] In this embodiment, the microcontroller U is model AT32F415RCT7-7; the Hall chip U1 is model SC60228; the communication chip IC3 is model TJA1040; the storage chip U2 is model M24256-BWMN6TP; and the voltage regulator chip IC2 is model AMS1117-3.3V.
[0029] In this embodiment, the angular displacement is converted into an electrical signal by the Hall chip U1, the data is processed by the microcontroller U, the position information is stored by the storage chip U2, and the communication chip IC3 communicates with the host computer, enabling real-time feedback of position information.
Claims
1. A single-turn absolute encoder circuit based on an AT32 microcontroller, comprising a microcontroller, characterized in that: Pin 1 of the microcontroller (U) is connected to a +3.3V power supply. Pin 5 of the microcontroller (U) is connected to one end of capacitor 4 (C4) and one end of crystal oscillator (XTAL1). Pin 6 of the microcontroller (U) is connected to one end of capacitor 6 (C6) and the other end of crystal oscillator (CTAL1). The other ends of capacitor 4 (C4) and capacitor 6 (C6) are combined and grounded. Pin 12 of the microcontroller (U) is connected to one end of capacitor 17 (C17) and grounded. Pin 13 of the microcontroller (U) is connected to the other end of capacitor 17 (C17) and grounded. Pin 28 of the microcontroller (U) is connected to one end of resistor 7 (R7), and the other end of resistor 7 (R7) is grounded. Pin 33 of the microcontroller (U) is connected to resistor 16 (R16)... One end of the resistor (U) is connected to pin 1 of the Hall chip (U1), and the other end of the resistor (R16) is connected to the +3.3V power supply. Pin 34 of the microcontroller (U) is connected to one end of the resistor (R17) and pin 8 of the Hall chip (U1). The other end of the resistor (R17) is connected to the +3.3V power supply. Pin 35 of the microcontroller (U) is connected to pin 6 of the Hall chip (U1). Pin 36 of the microcontroller (U) is connected to one end of the resistor (R18) and pin 7 of the Hall chip (U1). The other end of the resistor (R18) is grounded. Pin 57 of the microcontroller (U) is connected to pin 7 of the memory chip (U2) and one end of the resistor (R15). The other end of the resistor (R15) is connected to the +3.3V power supply.
2. The single-turn absolute encoder circuit based on an AT32 microcontroller according to claim 1, characterized in that: Pin 3 of the microcontroller (U) is connected to one end of resistor 3 (R3), and the other end of resistor 3 (R3) is connected to the cathode of light-emitting diode (H1). The anode of light-emitting diode 1 (H1) is connected to a +3.3V power supply. Pin 4 of the microcontroller (U) is connected to one end of resistor 4 (R4), and the other end of resistor 4 (R4) is connected to the cathode of light-emitting diode 2 (H2). The anode of light-emitting diode 2 (H2) is connected to a +3.3V power supply.
3. The single-turn absolute encoder circuit based on an AT32 microcontroller according to claim 1, characterized in that: Pin 18 of the microcontroller (U) is connected to one end of capacitor 9 (C9) and ground. Pin 19 of the microcontroller (U) is connected to the other end of capacitor 9 (C9) and +3.3V power supply. Pin 31 of the microcontroller (U) is connected to one end of capacitor 5 (C5) and ground. Pin 32 of the microcontroller (U) is connected to the other end of capacitor 5 (C5) and +3.3V power supply. Pin 47 of the microcontroller (U) is connected to one end of capacitor 7 (C7) and ground. Pin 48 of the microcontroller (U) is connected to the other end of capacitor 7 (C7) and +3.3V power supply. Pin 63 of the microcontroller (U) is connected to one end of capacitor 8 (C8). Pin 64 of the microcontroller (U) is connected to the other end of capacitor 8 (C8) and +3.3V power supply.
4. The single-turn absolute encoder circuit based on an AT32 microcontroller according to claim 1, characterized in that: Pins 2 and 5 of the Hall chip (U1) are left floating. Pin 3 of the Hall chip (U1) is connected to a +3.3V power supply and one end of capacitor 1 (C1). The other end of capacitor 1 (C1) is connected to pin 4 of the Hall chip (U1) and ground. The positive terminal of tantalum capacitor 3 (C3) is connected to a +3.3V power supply, and the negative terminal of tantalum capacitor 3 (C3) is grounded.
5. The single-turn absolute encoder circuit based on an AT32 microcontroller according to claim 1, characterized in that: Pin 42 of the microcontroller (U) is connected to terminal 2 of the programming port (COM_1). Pin 43 of the microcontroller (U) is connected to terminal 1 of the programming port (COM_1). Terminal 3 of the programming port (COM_1) is grounded. Terminal 4 of the programming port (COM_1) is connected to one end of resistor 20 (R20) and one end of resistor 21 (R21). The other end of resistor 20 (R20) is connected to the base of transistor 1 (Q1). The emitter of transistor 1 (Q1) is grounded. The collector of transistor 1 (Q1) is connected to one end of resistor 13 (R13) and one end of resistor 14 (R14). The other end of resistor 13 (R13) is connected to pin 60 of the microcontroller (U). The other end of resistor 14 (R14) is connected to a +3.3V power supply. The other end of resistor 21 (R21) is connected to a +3.3V power supply.
6. The single-turn absolute encoder circuit based on the AT32 microcontroller according to claim 1, characterized in that: Pin 44 of the microcontroller (U) is connected to pin 4 of the communication chip (IC3). Pin 45 of the microcontroller (U) is connected to pin 1 of the communication chip (IC3). Pin 3 of the communication chip (IC3) is connected to one end of capacitor eleven (C11) and the +5V power supply. Pin 8 of the communication chip (IC3) is connected to the other end of capacitor eleven (C11), pin 2 of the communication chip (IC3), one end of capacitor thirteen (C13), terminal 4 of socket one (JP1), and ground. Pin 5 of the communication chip (IC3) is connected to the power supply... One end of resistor 8 (R8), one end of resistor 10 (R10), and the other end of capacitor 13 (C13) are connected to the other end of resistor 8 (R10), one end of resistor 9 (R9), and terminal 2 of socket 1 (JP1). The 7th pin of the communication chip (IC3) is connected to the other end of resistor 8 (R8), the other end of resistor 9 (R9), and terminal 3 of socket 1 (JP1). Terminal 1 of socket 1 (JP1) is connected to one end of fuse 1 (F1), and the other end of fuse 1 (F1) is connected to the +5V power supply.
7. The single-turn absolute encoder circuit based on AT32 microcontroller according to claim 1, characterized in that: Pin 7 of the microcontroller (U) is connected to terminal 8 of the test port (JTAG1), one end of resistor 1 (R1), and one end of capacitor 2 (C2). The other end of resistor 1 (R1) is connected to a +3.3V power supply, and the other end of capacitor 2 (C2) is grounded. Pin 46 of the microcontroller (U) is connected to terminal 5 of the test port (JTAG1). Pin 49 of the microcontroller (U) is connected to terminal 7 of the test port (JTAG1). Pin 50 of the microcontroller (U) is connected to terminal 4 of the test port (JTAG1). Pin 55 of the microcontroller (U) is connected to terminal 3 of the test port (JTAG1). Pin 56 of the microcontroller (U) is connected to terminal 6 of the test port (JTAG1). Terminal 1 of the test port (JTAG1) is connected to a +3.3V power supply. Terminals 9 and 10 of the test port (JTAG1) are both grounded.
8. The single-turn absolute encoder circuit based on the AT32 microcontroller according to claim 1, characterized in that: Pin 58 of the microcontroller (U) is connected to one end of resistor 5 (R5) and pin 6 of the memory chip (U2). Pin 59 of the microcontroller (U) is connected to one end of resistor 6 (R6) and pin 5 of the memory chip (U2). Pins 1, 2, 3, and 4 of the memory chip (U2) are all grounded. Pin 8 of the memory chip (U2) is connected to one end of capacitor 10 (C10), the other end of resistor 5 (R5), the other end of resistor 6 (R6), and a +3.3V power supply. The other end of capacitor 10 (C10) is grounded.
9. The single-turn absolute encoder circuit based on an AT32 microcontroller according to claim 1, characterized in that: It also includes a voltage regulator chip (IC2). Pin 3 of the voltage regulator chip (IC2) is connected to the cathode of transient suppression diode 1 (Z1), the positive terminal of tantalum capacitor 12 (C12), one end of capacitor 15 (C15), and a +5V power supply. Pin 2 of the voltage regulator chip (IC2) is connected to the positive terminal of tantalum capacitor 14 (C14) and one end of inductor 1 (L1). The other end of inductor 1 (L1) is connected to one end of capacitor 16 (C16) and outputs a +3.3V power supply. Pin 1 of the voltage regulator chip (IC2) is grounded. The positive terminal of transient suppression diode 1 (Z1), the negative terminal of tantalum capacitor 12 (C12), the other end of capacitor 15 (C15), the negative terminal of tantalum capacitor 14 (C14), and the other end of capacitor 16 (C16) are grounded.