Analog signal sampling device and vehicle
By using a microcontroller-controlled amplifier circuit to measure the range of an analog signal sampling device, the problems of difficult sensor replacement and accuracy loss are solved, enabling high-precision measurement across multiple voltage ranges and reducing costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHONGQING JINKANG POWER NEW ENERGY CO LTD
- Filing Date
- 2024-10-23
- Publication Date
- 2026-04-24
AI Technical Summary
In the existing technology, analog signal sampling devices rely on sensor selection in the product development process. Sensor replacement is difficult, accuracy is greatly lost when detecting small-range signals, and the need for professional automatic gain control chips leads to high costs.
By controlling the range of the amplifier circuit output voltage using a microcontroller, and combining the range of the voltage divider circuit and the amplifier circuit with adjustable resistors and switching transistors, the signal sampling can be automatically adapted to different voltage ranges, reducing dependence on sensors and accuracy loss, and avoiding the use of professional gain control chips.
It enables high-precision measurement of analog signal sampling devices across multiple voltage ranges, reduces hardware design dependence and cost, and supports flexible sensor replacement.
Smart Images

Figure CN121923653A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of analog signal sampling technology, and more specifically to an analog signal sampling device and a vehicle. Background Technology
[0002] With the rapid development of the automotive industry, the number of electronic devices and onboard sensors in cars is increasing. Consequently, the types of signals output by these sensors are also diversifying, including but not limited to analog signals, and the voltage ranges of these analog signals vary, such as 0-5V and 0-12V. In automobiles, the onboard controller samples these analog signals from the sensors, specifically through the microcontroller's ADC module. Because the voltage ranges of analog signals are not uniform, but the reference voltage of the microcontroller's ADC module is generally fixed (e.g., 5V), the reference voltage of the ADC module needs to be adaptively adjusted for analog signals with different voltage ranges.
[0003] In related technologies, there are usually three approaches for sensor analog signals with different voltage ranges: 1. Design resistors with different resistance values to have different voltage division coefficients for different voltage ranges of the sensor analog signal; 2. Design the voltage sampling range of the ADC module to be relatively large, covering a wide voltage range; 3. Design an automatic gain circuit that automatically adjusts the amplification factor in real time.
[0004] However, the above approach has the following problems: 1. It is dependent on the product development process. The hardware design can only be frozen after the sensor is selected. After the product development is completed, the sensor cannot be easily replaced. Replacement requires consideration of its signal output voltage range; 2. It will cause a large loss of accuracy when detecting small-range analog signals; 3. It requires more professional automatic gain control chips, which are too expensive.
[0005] It should be noted that the information disclosed in the background section of this application is intended only to enhance the understanding of the general background of this application, and should not be construed as an admission or in any way implying that the information constitutes prior art known to those skilled in the art. Summary of the Invention
[0006] In view of this, this application provides an analog signal sampling device and vehicle to solve the problems of the prior art: 1. It is dependent on the product development process. The hardware design can only be frozen after the sensor is selected. After the product development is completed, the sensor cannot be easily replaced. When replacing it, the voltage range of its signal output needs to be considered; 2. It will cause a large loss of accuracy when detecting a small range of analog signals; 3. It requires more professional automatic gain control chips, which are too expensive.
[0007] In a first aspect, embodiments of this application provide an analog signal sampling device, comprising:
[0008] A voltage divider circuit, wherein the input terminal of the voltage divider circuit is an analog signal sampling terminal, and the voltage divider circuit is used to divide the analog signal;
[0009] An amplifier circuit, wherein the input terminal of the amplifier circuit is electrically connected to the output terminal of the voltage divider circuit;
[0010] The microcontroller has its input terminal electrically connected to the output terminal of the amplifier circuit, and its output terminal electrically connected to the range control terminal of the amplifier circuit. The microcontroller is used to output a range control signal based on the output voltage of the amplifier circuit to control the range of the amplifier circuit.
[0011] In this embodiment, the microcontroller outputs different range control signals based on the output voltage of the amplifier circuit, thereby controlling the range of the amplifier circuit. It can be understood that when the analog signal voltage is large, the output voltage of the amplifier circuit is also large. In this case, the microcontroller can increase the range of the amplifier circuit through the range control signal, and vice versa. Because the range of the analog signal sampling device in this application can be automatically controlled, it is applicable to various voltage ranges. Furthermore, the device is independent of the sensor, facilitating hardware design and allowing for future replacement. It maintains high accuracy even when the analog signal voltage range is small. Additionally, the analog signal sampling device in this application is low-cost, requiring no specialized automatic gain control chip.
[0012] In one possible implementation, the microcontroller is specifically used for:
[0013] When the output voltage of the amplifier circuit received by the microcontroller is greater than a first preset voltage, a first range control signal is output, which is used to increase the range of the amplifier circuit; when the output voltage of the amplifier circuit received by the microcontroller is less than a second preset voltage, a second range control signal is output, which is used to decrease the range of the amplifier circuit, wherein the first preset voltage is greater than the second preset voltage.
[0014] In this embodiment, the microcontroller controls the range of the amplifier circuit in real time through the range control signal based on the output voltage of the amplifier circuit. Regardless of the size of the analog signal voltage range, the analog signal sampling device can ensure high measurement accuracy.
[0015] In one possible implementation, the voltage divider circuit includes:
[0016] The first resistor has an input terminal that is an analog signal sampling terminal.
[0017] The second resistor has its first end electrically connected to the second end of the first resistor, and its second end grounded.
[0018] A capacitor, wherein the first terminal of the capacitor is electrically connected to the second terminal of the first resistor and the first terminal of the second resistor respectively, and the second terminal of the capacitor is grounded;
[0019] The node between the second end of the first resistor, the second end of the second resistor, and the first end of the capacitor is the output terminal of the voltage divider circuit.
[0020] In one possible implementation, the second resistor is an adjustable resistor.
[0021] By setting the second resistor as an adjustable resistor, the output voltage of the voltage divider circuit can be controlled by controlling the resistance value of the second resistor, thereby controlling the sampling range of the analog signal.
[0022] In one possible implementation, the amplifier circuit includes:
[0023] An amplifier, wherein the positive input terminal of the amplifier is electrically connected to the output terminal of the voltage divider circuit, the positive control terminal of the amplifier is used to connect to a high level, and the negative control terminal of the amplifier is grounded;
[0024] The third resistor has its first end electrically connected to the negative input terminal of the amplifier, and its second end grounded.
[0025] The fourth resistor has its first end electrically connected to both the negative input terminal of the amplifier and the first end of the third resistor.
[0026] The switching transistor has a control terminal that is the range control terminal of the amplifier circuit, an input terminal that is electrically connected to the second terminal of the fourth resistor, and an output terminal that is grounded.
[0027] The fifth resistor has its first end electrically connected to the negative input terminal of the amplifier, the first end of the third resistor, and the first end of the fourth resistor, respectively, and its second end electrically connected to the output terminal of the amplifier.
[0028] Wherein, the positive input terminal of the amplifier is the input terminal of the amplifier circuit, and the node between the output terminal of the amplifier and the second terminal of the fifth resistor is the output terminal of the amplifier circuit.
[0029] In one possible implementation, the switching transistor is an NPN transistor, with the base of the NPN transistor being the control terminal of the switching transistor, the collector of the NPN transistor being the input terminal of the switching transistor, and the emitter of the NPN transistor being the output terminal of the switching transistor.
[0030] It is understandable that when the base of an NPN transistor receives a high level, the NPN transistor conducts; when the base of an NPN transistor receives a low level, the NPN transistor is cut off. By controlling the conduction and disconnection of the NPN transistor, the range of the amplifier circuit can be controlled.
[0031] In one possible implementation, the switching transistor is an NMOS transistor, the gate of the NMOS transistor is the control terminal of the switching transistor, the drain of the NMOS transistor is the input terminal of the switching transistor, and the source of the NMOS transistor is the output terminal of the switching transistor.
[0032] As can be understood, when the gate of an NMOS transistor receives a high level, the NMOS transistor is turned on; when the gate of an NMOS transistor receives a low level, the NMOS transistor is turned off. By controlling the on and off states of the NMOS transistor, the range of the amplifier circuit can be controlled.
[0033] In one possible implementation, the third resistor is an adjustable resistor.
[0034] In this embodiment, the third resistor is set as an adjustable resistor, and the amplification factor of the amplifier circuit can be controlled by controlling the resistance value of the third resistor.
[0035] In one possible implementation, the device further includes:
[0036] The sixth resistor has its first end electrically connected to the output terminal of the amplifier circuit and its second end electrically connected to the input terminal of the microcontroller.
[0037] Secondly, embodiments of this application provide a vehicle, including:
[0038] The analog signal sampling device described in any one of the first aspects. Attached Figure Description
[0039] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0040] Figure 1This is a schematic diagram of the structure of an analog signal sampling device provided in an embodiment of this application;
[0041] Figure 2 This is a schematic diagram of a voltage divider circuit provided in an embodiment of this application;
[0042] Figure 3 This is a schematic diagram of an amplifier circuit provided in an embodiment of this application;
[0043] Figure 4 This is a schematic diagram of the structure of a switching transistor provided in an embodiment of this application;
[0044] Figure 5 This is a schematic diagram of another switching transistor provided in an embodiment of this application;
[0045] Figure 6 This is a schematic diagram of another analog signal sampling device provided in an embodiment of this application;
[0046] Figure 7 This is a schematic diagram of another analog signal sampling device provided in an embodiment of this application;
[0047] Figure 8 This is a schematic diagram illustrating the process of range control software controlling the range, as provided in an embodiment of this application. Detailed Implementation
[0048] To better understand the technical solution of this application, the embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0049] It should be understood that the described embodiments are merely some, not all, of the embodiments in this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.
[0050] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. The singular forms “a,” “the,” and “the” used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0051] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0052] With the rapid development of the automotive industry, the number of electronic devices and onboard sensors in cars is increasing. Consequently, the types of signals output by these sensors are also diversifying, including but not limited to analog signals, and the voltage ranges of these analog signals vary, such as 0-5V and 0-12V. In automobiles, the onboard controller samples these analog signals from the sensors, specifically through the microcontroller's ADC module. Because the voltage ranges of analog signals are not uniform, but the reference voltage of the microcontroller's ADC module is generally fixed (e.g., 5V), the reference voltage of the ADC module needs to be adaptively adjusted for analog signals with different voltage ranges.
[0053] In related technologies, there are usually three approaches for sensor analog signals with different voltage ranges: 1. Design resistors with different resistance values to have different voltage division coefficients for different voltage ranges of the sensor analog signal; 2. Design the voltage sampling range of the ADC module to be relatively large, covering a wide voltage range; 3. Design an automatic gain circuit that automatically adjusts the amplification factor in real time.
[0054] However, the above approach has the following problems: 1. It is dependent on the product development process. The hardware design can only be frozen after the sensor is selected. After the product development is completed, the sensor cannot be easily replaced. Replacement requires consideration of its signal output voltage range; 2. It will cause a large loss of accuracy when detecting small-range analog signals; 3. It requires more professional automatic gain control chips, which are too expensive.
[0055] To address the aforementioned problems, this application provides an analog signal sampling device and a vehicle. A microcontroller outputs different range control signals based on the output voltage of the amplifier circuit to control the amplifier circuit's range. It is understood that when the analog signal voltage is large, the amplifier circuit's output voltage is also large; in this case, the microcontroller can increase the amplifier circuit's range through the range control signal, and vice versa. Because the range of the analog signal sampling device in this application can be automatically controlled, it is applicable to various voltage ranges. Furthermore, the device is independent of sensors, facilitating hardware design and allowing for future replacement. It maintains high accuracy even when the analog signal voltage range is small. Additionally, the analog signal sampling device in this application is low-cost, requiring no specialized automatic gain control chip. Specifically, detailed descriptions are provided below in conjunction with the accompanying drawings and specific embodiments.
[0056] See Figure 1 This is a schematic diagram of an analog signal sampling device provided in an embodiment of this application. Figure 1 As shown, the analog signal sampling device includes a voltage divider circuit 101, an amplifier circuit 102, and a microcontroller 103.
[0057] The input terminal of the voltage divider circuit 101 is the analog signal sampling terminal, and the voltage divider circuit 101 is used to divide the analog signal.
[0058] The input terminal of the amplifier circuit 102 is electrically connected to the output terminal of the voltage divider circuit 101;
[0059] The input terminal of the microcontroller 103 is electrically connected to the output terminal of the amplifier circuit 102, and the output terminal of the microcontroller 103 is electrically connected to the range control terminal of the amplifier circuit 102. The microcontroller 103 is used to output a range control signal according to the output voltage of the amplifier circuit 102 to control the range of the amplifier circuit 102.
[0060] In one possible implementation, the microcontroller 103 is specifically used to output a first range control signal when the output voltage of the amplifier circuit 102 received by the microcontroller 103 is greater than a first preset voltage. The first range control signal is used to increase the range of the amplifier circuit 102. When the output voltage of the amplifier circuit 102 received by the microcontroller 103 is less than a second preset voltage, the microcontroller 103 outputs a second range control signal. The second range control signal is used to decrease the range of the amplifier circuit 102. The first preset voltage is greater than the second preset voltage.
[0061] In this embodiment, the microcontroller controls the range of the amplifier circuit in real time via a range control signal based on the output voltage of the amplifier circuit. Regardless of the size of the analog signal voltage range, the analog signal sampling device can guarantee high measurement accuracy. It can be understood that when the analog signal voltage is large, the output voltage of the amplifier circuit is large, and the microcontroller can increase the range of the amplifier circuit via the range control signal; conversely, the same applies.
[0062] Of course, this application also provides a schematic diagram of the structure of a voltage divider circuit 101.
[0063] See Figure 2 This is a schematic diagram of a voltage divider circuit provided in an embodiment of this application. Figure 2 As shown, the voltage divider circuit 101 includes a first resistor R1, a second resistor R2, and a capacitor C.
[0064] Wherein, the input terminal of the first resistor R1 is the sampling terminal of the analog signal Vin, which is the analog signal output by the sensor; the first terminal of the second resistor R2 is electrically connected to the second terminal of the first resistor R1, and the second terminal of the second resistor R2 is grounded; the first terminal of the capacitor C is electrically connected to the second terminal of the first resistor R1 and the first terminal of the second resistor R2, and the second terminal of the capacitor C is grounded; wherein, the node between the second terminal of the first resistor R1, the second terminal of the second resistor R2 and the first terminal of the capacitor C is the output terminal of the voltage divider circuit 101.
[0065] It is understandable that after receiving the analog signal Vin, the voltage divider circuit 101 outputs a voltage V1 = Vin × R2 / (R1 + R2), and the voltage division coefficient P0 of the voltage divider circuit 101 is R2 / (R1 + R2).
[0066] In one possible implementation, the second resistor R2 is an adjustable resistor. It can be understood that by controlling the resistance value of the second resistor R2, the voltage division factor of the voltage divider circuit 101 can be controlled.
[0067] In addition, this application embodiment also provides a schematic diagram of the structure of an amplifier circuit 102.
[0068] See Figure 3 This is a schematic diagram of an amplifier circuit provided in an embodiment of this application. Figure 3 As shown, the amplifier circuit 103 includes amplifier U, third resistor R3, fourth resistor R4, switching transistor 301, and fifth resistor R5.
[0069] In this circuit, the positive input terminal of amplifier U is electrically connected to the output terminal of voltage divider circuit 101, the positive control terminal of amplifier U is used to connect to a high level, and the negative control terminal of amplifier U is grounded; the first end of the third resistor R3 is electrically connected to the negative input terminal of amplifier U, and the second end of the third resistor R3 is grounded; the first end of the fourth resistor R4 is electrically connected to both the negative input terminal of amplifier U and the first end of the third resistor R3; the control terminal of switch transistor 301 is the range control terminal of amplifier circuit 102, the input terminal of switch transistor 301 is electrically connected to the second end of the fourth resistor R4, and the output terminal of switch transistor 301 is grounded; the first end of the fifth resistor R5 is electrically connected to the negative input terminal of amplifier U, the first end of the third resistor R3, and the first end of the fourth resistor R4, and the second end of the fifth resistor R5 is electrically connected to the output terminal of amplifier U; the positive input terminal of amplifier U is the input terminal of amplifier circuit 102, and the node between the output terminal of amplifier U and the second end of the fifth resistor R5 is the output terminal of amplifier circuit 102.
[0070] In one possible implementation, the switching transistor 301 is an NPN transistor. For ease of understanding, this application also provides a schematic diagram of the switching transistor.
[0071] See Figure 4 This is a schematic diagram of a switching transistor provided in an embodiment of this application. Figure 4 As shown, the switching transistor 301 is an NPN transistor Q. The base B of the NPN transistor Q is the control terminal of the switching transistor 301, the collector C of the NPN transistor Q is the input terminal of the switching transistor 301, and the emitter E of the NPN transistor Q is the output terminal of the switching transistor 301.
[0072] It is understandable that when the base of an NPN transistor receives a high level, the NPN transistor conducts; when the base of an NPN transistor receives a low level, the NPN transistor is cut off. By controlling the conduction and disconnection of the NPN transistor, the range of the amplifier circuit can be controlled.
[0073] In another possible implementation, the switch 301 is an NMOS transistor. For ease of understanding, this application also provides a schematic diagram of another switch structure.
[0074] See Figure 5 This is a schematic diagram of another switching transistor provided in an embodiment of this application. Figure 5 As shown, the switch 301 is an NMOS transistor. The gate G of the NMOS transistor is the control terminal of the switch 301, the drain D of the NMOS transistor is the input terminal of the switch 301, and the source S of the NMOS transistor is the output terminal of the switch 301.
[0075] As can be understood, when the gate of an NMOS transistor receives a high level, the NMOS transistor is turned on; when the gate of an NMOS transistor receives a low level, the NMOS transistor is turned off. By controlling the on and off states of the NMOS transistor, the range of the amplifier circuit can be controlled.
[0076] It is understandable that when the switching transistor 301 is off, the amplification factor of the amplifier circuit 102 is: P0 = (R3 + R5) / R3; when the switching transistor 301 is on, the amplification factor of the amplifier circuit 102 is: P0 = ((R3 * R4) / (R3 + R4) + R5) / R3.
[0077] In one possible implementation, the third resistor R3 is an adjustable resistor. It can be understood that by controlling the value of the third resistor R3, the amplification factor of the amplifier circuit 102 can be controlled.
[0078] In one possible implementation, the analog signal sampling device also includes a sixth resistor.
[0079] See Figure 6 This is a schematic diagram of another analog signal sampling device provided in an embodiment of this application. Figure 6 As shown, the first end of the sixth resistor R6 is electrically connected to the output terminal of the amplifier circuit 102, and the second end of the sixth resistor R6 is electrically connected to the input terminal of the microcontroller 103.
[0080] It is understandable that the sixth resistor R6 is located between the amplifier circuit 102 and the microcontroller 103. This can prevent the large output current of the amplifier circuit 102 from affecting the input current of the microcontroller 103, thereby ensuring the stability of the entire circuit.
[0081] The following example uses the 301 NPN transistor as an example to explain in detail the working principle of the analog signal sampling device.
[0082] See Figure 7 This is a schematic diagram of another analog signal sampling device provided in an embodiment of this application. Figure 7 As shown, the analog signal sampling device includes a voltage divider circuit 101, an amplifier circuit 102, a sixth resistor R6, and a microcontroller 103. Their connections are as follows: Figure 6 The illustrated embodiment is described in detail and will not be repeated here. The I / O port of the microcontroller 103 is the output terminal of the microcontroller, used to output the range control signal (Range_Ctrl).
[0083] In one possible implementation, the first resistor R1 has a resistance of 7.5KΩ, the second resistor R2 has a resistance of 2.5KΩ, the capacitor C has a capacitance of 0.47μF, the third resistor R3 has a resistance of 5.1KΩ, the fourth resistor R4 has a resistance of 1.5KΩ, the fifth resistor R5 has a resistance of 2.8KΩ, and the sixth resistor R6 has a resistance of 100Ω.
[0084] The voltage divider circuit 101 divides the analog signal Vin:
[0085] V1=Vin×R2 / (R1+R2)=Vin×2.5 / 10=0.25×Vin
[0086] That is, the voltage division coefficient P0 of the voltage divider circuit 101 is 0.25.
[0087] Amplifier circuit 102 is an amplifier circuit with switchable amplification factor. Specifically, when Q is cut off, the amplification factor of amplifier circuit 102 is:
[0088] P0=(R3++R5) / R3=(5.1+2.8) / 5.1=1.549
[0089] Combined with the input voltage divider factor of 0.25, the amplification factor of the entire signal modulation circuit (i.e., the voltage divider circuit and the amplifier circuit) is:
[0090] P1 = P0 × 0.25 = 0.387
[0091] When Q is on, the amplification factor of amplifier circuit 102 is:
[0092] P0=((R3×R4) / (R3+R4)+R5) / R3=(1.159+2.8) / 1.159=3.415
[0093] Combined with the input voltage divider factor of 0.25, the amplification factor of the entire signal modulation circuit is:
[0094] P1 = P0 × 0.25 = 0.854
[0095] Corresponding to the above-described device, this application also provides a control flowchart for range control software.
[0096] join Figure 8 This is a schematic diagram illustrating the process of range control software controlling the range according to an embodiment of this application. It mainly includes the following steps.
[0097] Step S801: Begin.
[0098] Step S802: Is Range_Ctrl high? If yes, proceed to step S803; otherwise, proceed to step S804.
[0099] Step S803: The microcontroller's ADC module samples the voltage value of V3.
[0100] Step S804: The microcontroller's ADC module samples the voltage value of V3.
[0101] Step S805: Determine whether V3 is less than the second preset voltage. If yes, proceed to step S806; otherwise, proceed to step S807.
[0102] In one possible implementation, the second preset voltage is 4V. Of course, those skilled in the art can set the second preset voltage to any voltage value according to actual needs.
[0103] Step S806: Calculate the value of Vin.
[0104] Specifically, Vin = V3 / 0.387.
[0105] Step S807: Set Range_Ctrl to low level.
[0106] Step S808: Determine whether V3 is greater than the first preset voltage. If yes, proceed to step S809; otherwise, proceed to step S810.
[0107] In one possible implementation, the first preset voltage is 2V. Of course, those skilled in the art can set the first preset voltage to any voltage value according to actual needs.
[0108] Step S809: Calculate the value of Vin.
[0109] Specifically, Vin = V3 / 0.854.
[0110] Step S810: Set Range_Ctrl to high level.
[0111] Step S811: End.
[0112] Combination Figure 7 The illustrated embodiments and Figure 8 As shown in the flowchart, after the controller is powered on, the initial state Range_Ctrl is high (i.e., 1), Q is turned on, and the amplification factor of the entire signal conditioning circuit is 0.854. When the analog signal Vin rises to 5V, the value of V3 is:
[0113] V3 = 5V × 0.854 = 4.27V
[0114] When the analog signal Vin exceeds 5V, Q is cut off, and the amplification factor of the signal conditioning circuit becomes 0.387. Therefore, when Vin is 5V, the value of V3 is:
[0115] V3 = 5V × 0.387 = 1.935V
[0116] When the analog signal Vin rises to 12V, the value of V3 is:
[0117] Vo = 12V × 0.387 = 4.644V
[0118] When the analog signal Vin drops below 5V, V3 drops below 1.935V. At this point, Q turns on again, and the amplification factor of the signal conditioning circuit switches to 0.854.
[0119] In summary, the microcontroller software controls Range_Ctrl by detecting the voltage value of the output voltage V3 of the amplifier circuit. This automatically adjusts the range of the signal conditioning circuit without affecting the detection accuracy, thus adapting to both 0-5V and 0-12V signal ranges.
[0120] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent the existence of A alone, the simultaneous existence of A and B, or the existence of B alone. A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, and c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0121] Those skilled in the art will recognize that the units and algorithm steps described in the embodiments disclosed herein can be implemented using electronic hardware, computer software, or a combination of electronic hardware and software. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0122] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0123] In the several embodiments provided in this application, any function, if implemented as a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0124] The same or similar parts between the various embodiments in this specification can be referred to mutually. In particular, the device embodiments and terminal embodiments are basically similar to the method embodiments, so the description is relatively simple, and the relevant parts can be referred to the description in the method embodiments.
Claims
1. An analog signal sampling device, characterized in that, include: A voltage divider circuit, wherein the input terminal of the voltage divider circuit is an analog signal sampling terminal, and the voltage divider circuit is used to divide the analog signal; An amplifier circuit, wherein the input terminal of the amplifier circuit is electrically connected to the output terminal of the voltage divider circuit; The microcontroller has its input terminal electrically connected to the output terminal of the amplifier circuit, and its output terminal electrically connected to the range control terminal of the amplifier circuit. The microcontroller is used to output a range control signal based on the output voltage of the amplifier circuit to control the range of the amplifier circuit.
2. The method according to claim 1, characterized in that, The microcontroller is specifically used for: When the output voltage of the amplifier circuit received by the microcontroller is greater than the first preset voltage, the microcontroller outputs a first range control signal, which is used to increase the range of the amplifier circuit. When the output voltage of the amplifier circuit received by the microcontroller is less than the second preset voltage, the microcontroller outputs a second range control signal. The second range control signal is used to reduce the range of the amplifier circuit. The first preset voltage is greater than the second preset voltage.
3. The apparatus according to claim 1, characterized in that, The voltage divider circuit includes: The first resistor has an input terminal that is an analog signal sampling terminal. The second resistor has its first end electrically connected to the second end of the first resistor, and its second end grounded. A capacitor, wherein the first terminal of the capacitor is electrically connected to the second terminal of the first resistor and the first terminal of the second resistor respectively, and the second terminal of the capacitor is grounded; The node between the second end of the first resistor, the second end of the second resistor, and the first end of the capacitor is the output terminal of the voltage divider circuit.
4. The apparatus according to claim 3, characterized in that, The second resistor is an adjustable resistor.
5. The apparatus according to claim 1, characterized in that, The amplifier circuit includes: An amplifier, wherein the positive input terminal of the amplifier is electrically connected to the output terminal of the voltage divider circuit, the positive control terminal of the amplifier is used to connect to a high level, and the negative control terminal of the amplifier is grounded; The third resistor has its first end electrically connected to the negative input terminal of the amplifier, and its second end grounded. The fourth resistor has its first end electrically connected to both the negative input terminal of the amplifier and the first end of the third resistor. The switching transistor has a control terminal that is the range control terminal of the amplifier circuit, an input terminal that is electrically connected to the second terminal of the fourth resistor, and an output terminal that is grounded. The fifth resistor has its first end electrically connected to the negative input terminal of the amplifier, the first end of the third resistor, and the first end of the fourth resistor, respectively, and its second end electrically connected to the output terminal of the amplifier. Wherein, the positive input terminal of the amplifier is the input terminal of the amplifier circuit, and the node between the output terminal of the amplifier and the second terminal of the fifth resistor is the output terminal of the amplifier circuit.
6. The apparatus according to claim 5, characterized in that, The switching transistor is an NPN transistor, with the base of the NPN transistor being the control terminal, the collector of the NPN transistor being the input terminal, and the emitter of the NPN transistor being the output terminal.
7. The apparatus according to claim 5, characterized in that, The switching transistor is an NMOS transistor, the gate of the NMOS transistor is the control terminal of the switching transistor, the drain of the NMOS transistor is the input terminal of the switching transistor, and the source of the NMOS transistor is the output terminal of the switching transistor.
8. The apparatus according to claim 5, characterized in that, The third resistor is an adjustable resistor.
9. The apparatus according to claim 1, characterized in that, The device further includes: The sixth resistor has its first end electrically connected to the output terminal of the amplifier circuit and its second end electrically connected to the input terminal of the microcontroller.
10. A vehicle, characterized in that, include: The analog signal sampling device according to any one of claims 1 to 9.