Voltage measurement circuit, method, apparatus, device, and storage medium
By constructing a multi-range voltage measurement circuit and utilizing an inverting amplifier circuit and analog switch switching, the problems of long relay switching time and electromagnetic interference were solved, achieving high-precision and fast voltage measurement.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUNAN NEXT GENERATION INSTRUMENTAL T&C TECH CO LTD
- Filing Date
- 2026-04-09
- Publication Date
- 2026-06-16
AI Technical Summary
In existing voltage measurement technologies, relays have long switching times and generate electromagnetic interference, while analog switches have internal resistance, which reduces measurement accuracy and makes it difficult to achieve high precision and fast switching.
A multi-range voltage measurement circuit is adopted, which uses a first resistor unit, N second resistor units with different resistance values, N first and second switch units, and a negative feedback unit to form an inverting amplifier circuit. The virtual short and virtual open characteristics cancel out the influence of voltage transformation and the conduction internal resistance of the switch unit, and combine with analog switch switching to achieve fast switching.
It achieves higher precision voltage measurement, shortens switching time, avoids electromagnetic interference, and is suitable for precise voltage measurement in different ranges.
Smart Images

Figure CN122218294A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of precision measurement and control technology, and in particular to a voltage measurement circuit, method, apparatus, device and storage medium. Background Technology
[0002] With the development of measurement and control technologies, the requirements and accuracy of measuring instruments are becoming increasingly demanding. In automatic ranging applications, a common method is to use relay switching for multi-range sampling. However, relay switching requires a switching time, typically on the order of milliseconds, which is relatively long. Furthermore, relays are electromagnetic components, and the switching process generates electromagnetic interference, reducing the measurement accuracy of the measuring instrument. Replacing the relay with an analog switch can achieve a shorter switching time, but analog switches have internal resistance, typically ranging from tens to hundreds of ohms, which also reduces the measurement accuracy of the measuring instrument. Summary of the Invention
[0003] This application aims to provide a voltage measurement circuit, method, apparatus, device, and storage medium that can achieve higher accuracy voltage measurement.
[0004] A voltage measurement circuit according to a first aspect embodiment of this application includes: The first resistor unit has its first end connected to the sampling input terminal; There are N second resistor units with different resistance values, and the N second resistor units correspond to N different ranges. The first end of each second resistor unit is connected to the result output terminal. There are N first switching units, the first end of each of the N first switching units is connected to the second end of the first resistor unit, and the second ends of the N first switching units are connected one-to-one with the second ends of the N second resistor units. There are N second switching units, and the first terminals of the N second switching units are connected one-to-one with the second terminals of the N second resistor units; where N is an integer greater than or equal to 2. The negative feedback unit has its input terminal connected to the second terminal of N second switch units, and its output terminal connected to the result output terminal. The negative feedback unit achieves a virtual short and virtual open state when both the first switch unit and the second switch unit corresponding to any second resistor unit are turned on.
[0005] A voltage measurement method according to a second aspect of the present application, applied to a voltage measurement circuit as described in any of the first aspect embodiments above, the method comprising: Obtain the target range; Determine the second resistance unit corresponding to the target range; The first and second switching units connected to the second resistor unit corresponding to the target range are turned on; Obtain the resistance value of the first resistor unit, the resistance value of the second resistor unit, and the voltage at the sampling input terminal; The voltage measurement result is obtained based on the resistance value of the first resistor unit, the resistance value of the second resistor unit, and the voltage at the sampling input terminal.
[0006] A voltage measuring apparatus according to a third aspect embodiment of this application, applied to a voltage measuring method as described in the second aspect embodiment above, includes: The first acquisition module is used to acquire the target range; The determination module is used to determine the second resistance unit corresponding to the target range; The control module is used to control the conduction of the first switch unit and the second switch unit connected to the second resistor unit corresponding to the target range; The second acquisition module is used to acquire the resistance value of the first resistor unit, the resistance value of the second resistor unit, and the voltage at the sampling input terminal; The module is used to obtain voltage measurement results based on the resistance value of the first resistor unit, the resistance value of the second resistor unit, and the voltage at the sampling input terminal.
[0007] An electronic device according to a fourth aspect of this application includes a processor and a memory, the memory storing a program or instructions executable on the processor, the program or instructions being executed by the processor to implement the steps of the voltage measurement method as described in the second aspect of the present application.
[0008] A computer-readable storage medium according to a fifth aspect embodiment of the present application stores computer-executable instructions for performing the voltage measurement method as described in the second aspect embodiment above.
[0009] In this embodiment, a multi-range voltage measurement circuit is constructed by setting a first resistor unit, N second resistor units with different resistance values, N first switch units, N second switch units, and a negative feedback unit. Since the sampling input terminal is connected to the input terminal of the negative feedback unit sequentially through the first resistor unit, the first switch unit, and the second switch unit, and the result output terminal is connected to the output terminal of the negative feedback unit, the sampling input stage circuit in this application is no longer a simple voltage divider circuit as in conventional technical solutions. Instead, it constitutes an inverting amplifier circuit. Based on its virtual short and virtual open characteristics, it can, to a certain extent, offset the influence of voltage transformation at the sampling input terminal and the on-resistance of the switch unit on the measurement accuracy, thereby achieving higher precision voltage measurement and meeting the accuracy requirements for measurement under different ranges. Furthermore, for multi-range voltage measurement, compared to the traditional relay switching method, this application uses analog switch unit switching, which can effectively shorten the switching time and avoid electromagnetic interference.
[0010] Other features and advantages of this application will be set forth in the following description and will be apparent in part from the description or may be learned by practicing the application. Attached Figure Description
[0011] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which: Figure 1 This is a schematic diagram of the voltage measurement circuit according to one embodiment of this application; Figure 2 This is a schematic diagram of the voltage measurement circuit according to another embodiment of this application; Figure 3 This is a schematic diagram of the on-resistance-drain voltage relationship curve of an analog switch as a function of temperature. Figure 4 This is a schematic diagram of the on-resistance-drain voltage relationship curve of an analog switch as it changes with the power supply. Figure 5 This is a schematic flowchart of an embodiment of the voltage measurement method of this application; Figure 6 This is a schematic diagram of an embodiment of the voltage measuring device of this application; Figure 7 This is a schematic diagram of the hardware structure of an embodiment of the electronic device of this application. Detailed Implementation
[0012] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.
[0013] In the description of this application, the use of terms such as "first," "second," etc., is for the purpose of distinguishing technical features only and should not be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated or the order of the technical features indicated.
[0014] In the description of this application, it should be understood that the orientation descriptions, such as up, down, etc., are based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application.
[0015] In the description of this application, it should be noted that, unless otherwise explicitly defined, terms such as "setup," "installation," and "connection" should be interpreted broadly, and those skilled in the art can reasonably determine the specific meaning of the above terms in this application in conjunction with the specific content of the technical solution.
[0016] The technical solution of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described below are some embodiments of this application, not all embodiments.
[0017] See below. Figures 1 to 4 The embodiments of this application will be further described below.
[0018] like Figure 1 As shown, this application embodiment proposes a voltage measurement circuit, including... The first resistor unit has its first end connected to the sampling input terminal. There are N second resistor units with different resistance values, and the N second resistor units correspond to N different ranges. The first end of each second resistor unit is connected to the result output terminal. There are N first switching units, and the first end of each of the N first switching units is connected to the second end of the first resistor unit. The second ends of the N first switching units are connected one-to-one with the second ends of the N second resistor units. There are N second switching units, and the first terminals of the N second switching units are connected one-to-one with the second terminals of the N second resistor units; where N is an integer greater than or equal to 2. The negative feedback unit has its input terminal connected to the second terminal of N second switching units, and its output terminal connected to the result output terminal. The negative feedback unit achieves a virtual short and virtual open state when both the first and second switching units corresponding to any second resistor unit are turned on.
[0019] In this embodiment, a multi-range voltage measurement circuit is constructed by setting a first resistor unit, N second resistor units with different resistance values, N first switch units, N second switch units, and a negative feedback unit. Since the sampling input terminal is connected to the input terminal of the negative feedback unit sequentially through the first resistor unit, the first switch unit, and the second switch unit, and the result output terminal is connected to the output terminal of the negative feedback unit, the sampling input stage circuit in this application is no longer a simple voltage divider circuit as in conventional technical solutions. Instead, it constitutes an inverting amplifier circuit. Based on its virtual short and virtual open characteristics, it can, to a certain extent, offset the influence of voltage transformation at the sampling input terminal and the on-resistance of the switch unit on the measurement accuracy, thereby achieving higher precision voltage measurement and meeting the accuracy requirements for measurement under different ranges. Furthermore, for multi-range voltage measurement, compared to the traditional relay switching method, this application uses analog switch unit switching, which can effectively shorten the switching time and avoid electromagnetic interference.
[0020] In the voltage measurement circuit described above, different ranges are connected in parallel. Automatic range DC voltage measurement can be achieved through a programmable analog switch. Specifically, when it is necessary to measure the voltage of a certain target range, the first and second switch units connected to the second resistor unit corresponding to the target range are turned on, thus activating the required measurement range. At this time, the negative feedback unit forms a negative feedback circuit, achieving a virtual short and virtual open state. The measured voltage value can be calculated from the resistance values of the first resistor unit, the corresponding second resistor unit, and the voltage value at the sampling input terminal. During this process, the on-resistance of the switch unit can be ignored. At the same time, the impact of voltage changes at the sampling input terminal on the input terminal of the negative feedback unit is greatly reduced, thereby achieving higher precision voltage measurement.
[0021] In some implementations, the negative feedback unit includes: The operational amplifier has its inverting input connected to the second terminal of N second switching units, its non-inverting input connected to ground, and its output connected to the result output terminal.
[0022] In this embodiment, the negative feedback unit includes an operational amplifier. When any measurement range is activated, the operational amplifier forms a negative feedback circuit. Due to the virtual short property of the operational amplifier, its non-inverting input is grounded, making its voltage zero. The voltage at its inverting input is approximately equal to the voltage at the non-inverting input, meaning the voltage at the inverting input is also zero. This significantly reduces the impact of common-mode voltage transformation caused by the voltage transformation at the sampling input on the input bias current Ib, thereby lowering the performance requirements for the operational amplifier and eliminating the need for a low-Ib operational amplifier, thus reducing costs. Due to the virtual open property of the operational amplifier, the current flowing into the inverting input is approximately zero. Therefore, the current flowing through the first resistor unit can be considered equal to the current flowing through the corresponding second resistor unit. The current flowing through the second switching unit is approximately zero, so the on-resistance of the second switching unit can be ignored, thereby improving accuracy.
[0023] In some implementations, N is 2.
[0024] In this embodiment, when N is 2, two second resistor units with different resistance values are set, corresponding to two different ranges, as shown in the following example. Figure 2 As shown, this can correspond to both high and low measurement ranges. In this case, two of each of the first and second switching units are provided, each connected to one of the two second resistor units. By setting two different ranges, the basic requirements for measuring voltages in different ranges can be met. The structure is relatively simple, and the control logic is also relatively clear.
[0025] When measuring high-range voltages, the first and second switching units connected to the second resistor unit corresponding to the high range are turned on. At this time, the second resistor unit is connected to the circuit, forming an inverting amplification circuit together with the first resistor unit and the operational amplifier. Utilizing the virtual short and virtual open characteristics, accurate measurement of high-range voltages is achieved. Similarly, when switching to low-range measurement, the first and second switching units connected to the second resistor unit corresponding to the low range are turned on, connecting the second resistor unit for the low range, achieving high-precision measurement of low-range voltages. It is understandable that in practical applications, the specific resistance values of the two second resistor units can be flexibly selected according to common voltage measurement ranges to cover the main measurement scenarios.
[0026] In some implementations, N is 3.
[0027] In this embodiment, when N is 3, three second resistor units with different resistance values are configured, corresponding to three different ranges, as shown in the following example. Figure 1As shown, the circuit can be divided into high, medium, and low ranges. Correspondingly, three first and three second switching units are each equipped with a corresponding second resistor unit. This three-range design allows for more precise coverage of different voltage measurement ranges, meeting more diverse measurement needs. High-precision measurements can be achieved through appropriate range selection, further expanding the applicability of this voltage measurement circuit. For example, in applications with large voltage value ranges, the three ranges can achieve smoother switching, avoiding measurement accuracy loss due to excessively large range intervals.
[0028] In some implementations, the first resistor unit is a single resistor or a resistor network consisting of multiple resistors.
[0029] In this embodiment, the first resistor unit can be selected as a single resistor or a resistor network formed by multiple resistors connected in series, parallel, or series-parallel, depending on the actual measurement requirements. When a single resistor is used as the first resistor unit, its structure is simple and the cost is low, making it suitable for scenarios where circuit complexity requirements are not high. In this case, the accuracy of the resistor directly affects the overall measurement accuracy, so a high-precision resistor must be selected to ensure measurement accuracy. When a resistor network composed of multiple resistors is used, specific resistance values or temperature compensation functions can be achieved by flexibly designing the connection method and resistance ratio of the resistors. Whether it is a single resistor or a resistor network, the total resistance value of the first resistor unit is a known key parameter in the circuit design. Together with the total resistance value of the second resistor unit, it determines the voltage measurement calculation result. Therefore, the selection and configuration of the first resistor unit is of great significance for ensuring the accuracy and reliability of the voltage measurement circuit.
[0030] In some implementations, the second resistor unit is a single resistor or a resistor network consisting of multiple resistors.
[0031] In this embodiment, the second resistor unit can also be flexibly selected as a single resistor or a resistor network composed of multiple resistors, depending on the actual application requirements. When a single resistor is used as the second resistor unit, its structure is simple and the cost is low, making it suitable for scenarios where circuit complexity requirements are not high. In this case, the accuracy of the resistor directly affects the overall measurement accuracy, so a high-precision resistor must be selected to ensure measurement accuracy. When a resistor network composed of multiple resistors is used, specific resistance values or temperature compensation functions can be achieved by flexibly designing the connection method and resistance ratio of the resistors. Whether it is a single resistor or a resistor network, the total resistance value of the second resistor unit is a known key parameter in the circuit design. Together with the total resistance value of the first resistor unit, it determines the voltage measurement calculation result. Therefore, the selection and configuration of the second resistor unit is of great significance for ensuring the accuracy and reliability of the voltage measurement circuit.
[0032] In some embodiments, to better illustrate the technical solution of this application, Figure 1 An example is provided for illustration.
[0033] Figure 1 The circuit shown is a three-range voltage measurement circuit. Based on the operational amplifier inverting amplification principle, different ranges are connected in parallel, and automatic range DC voltage measurement is achieved through a programmable analog switch. Specifically, the circuit includes a first resistor unit R, an operational amplifier U, a second resistor unit R1, a first switch unit S1, and a second switch unit S4 corresponding to the first range, a second resistor unit R2, a first switch unit S2, and a second switch unit S5 corresponding to the second range, and a second resistor unit R3, a first switch unit S3, and a second switch unit S6 corresponding to the third range. Among them, R, R1, R2, and R3 can all be single resistors or resistor networks composed of multiple resistors.
[0034] This circuit can be used for three-range measurement. In range 1, switches S1 and S4 are closed and the rest are open; in range 2, switches S2 and S5 are closed and the rest are open; in range 3, switches S3 and S6 are closed and the rest are open.
[0035] When any measurement range is activated, the operational amplifier U forms a negative feedback circuit. Based on the virtual short and virtual open characteristics of the op-amp, the input bias current Ib and input offset voltage Vos are ignored in the calculation. That is, we assume there is no voltage drop across S4 or S5 / S6, and that the voltages at the positive and negative input terminals of the op-amp are equal. Therefore, the on-resistance of the second switching unit S4 or S5 / S6 is not included in the calculation, reducing the impact of variations in the analog switch's on-resistance on accuracy. The specific calculation process is shown below.
[0036] When switches S1 and S4 are closed and the other switches are open, then: ; When switches S2 and S5 are closed and the other switches are open, then: ; When switches S3 and S6 are closed and the other switches are open, then: ; Where Vin is the voltage at the sampling input terminal, Vout is the voltage at the result output terminal, which is the voltage measurement result, and Ron is the closing resistance of the analog switch.
[0037] It should be noted that, for the input bias current Ib and input offset voltage Vos of the op-amp, as long as the components do not change during the measurement process, the resulting errors can be compensated by calibration methods.
[0038] It should also be noted that, as seen from the formula above, the on-resistance of the analog switch is essentially included in the resistance value R. We don't need to concern ourselves with the exact value of Ron itself, as it can be calibrated. We only need to focus on the change of Ron with temperature or the analog switch terminal voltage. The relationship between the resistance value of Ron and temperature or the analog switch terminal voltage can be found in the datasheet of the analog switch device actually used in the switching unit. Specifically, the datasheet for the commonly used analog switch DG409 is as follows... Figure 3 and Figure 4 As shown.
[0039] For calibration, it is understandable that in a linear system, the actual value y of the external input is generally fitted with the encoded value x acquired by the ADC using the relationship y=kx+b. After calibration, the values of k and b can be calculated and determined, and stored by the corresponding storage device of the device. In subsequent use, the actual input value y can be calculated based on the corresponding encoded value x acquired by the ADC and presented to the user.
[0040] Similarly, in this application, the actual value of the sampling input voltage Vin can be regarded as y, and the encoded value acquired by the ADC that acquires the output voltage Vout can be regarded as x. The relationship between them can be fitted by the formula y=kx+b. After calibration, the values of k and b can be calculated and determined, thereby determining the specific fitting formula.
[0041] Therefore, it is understandable that this application does not need to concern itself with the value of Ron, because as long as its resistance value remains unchanged, regardless of its specific value, after calibration, it will be reflected in the k and b values of the relationship y=kx+b. Thus, the on-resistance of the first switching unit S1 or S2, S3 is incorporated into the resistance value R of the first resistor unit in the calculation, i.e., (R+Ron) in the denominator of the above formula, and after calibration, it is reflected in the k and b values, reducing the impact of changes in the on-resistance of the analog switch on accuracy.
[0042] However, it's important to note that if Ron changes with ambient temperature or operating conditions, such as causing voltage variations across the analog switch, then Ron needs to be monitored. This is because the temperature and operating conditions during calibration may differ from those in actual use. If this causes a change in Ron, meaning that Vout will change under the same Vin condition as in the formula above, directly connecting Vout to the ADC would mean that the encoded value x, while remaining constant with the system input voltage, deviates from the calibration conditions. Consequently, if the input value calculated using the k and b values stored in the device continues, it will deviate from the actual value, thus affecting the accuracy.
[0043] The following section explains the impact of temperature and drain voltage changes on accuracy. Figure 3 and Figure 4As shown, Figure 3 It is the on-resistance R of the analog switch DS(on) -Drain voltage V D A schematic diagram showing how the relationship curve changes with temperature; Figure 4 It is the on-resistance R of the analog switch DS(on) -Drain voltage V D A schematic diagram showing the relationship curve as a function of the power supply. For information on temperature variations, please refer to... Figure 3 It is reasonable to assume that, with room temperature (25℃) as the reference, the on-resistance changes by ±10Ω within the range of 0-40℃; regarding the change in the drain voltage of the analog switch, the drain voltage of the analog switch is the terminal voltage, refer to... Figure 4 From the above reasoning, it can be seen that when any set of switches is turned on under different power supply conditions, the conducting analog switch operates near 0V. The drain voltage of the analog switch is approximately 0V, meaning the drain voltage can be considered unchanged, thus preventing any change in the on-resistance. It should be noted that the power supply for the analog switch generally remains unchanged after the circuit design is finalized. Figure 3 The power supply is set to ±15V.
[0044] In summary, in most voltage acquisition circuits (with input impedance requirements >1MΩ, or even >10MΩ), a ±10Ω change in the on-resistance of the analog switch can only cause an error of 10ppm (relative to 1MΩ, and 1ppm relative to 10MΩ). This is negligible for most precision sampling equipment. Therefore, the impact of temperature changes and drain voltage changes on accuracy is minimized to none, or minimized to the point that it does not affect the performance.
[0045] Furthermore, since the analog switch is located in the voltage divider circuit, and a set of switches is always kept closed by program control, the voltage on the left side of the open analog switch will be pulled down by the conducting circuit. Even with a high input voltage, the analog switch will always operate within the safe voltage range after the resistor voltage divider. Therefore, this application can be widely used in low and high voltage measurement environments.
[0046] As can be understood from the above explanation, firstly, this application changes the sampling input stage circuit from a simple voltage divider circuit to an inverting amplifier circuit. Utilizing the characteristic that its common-mode voltage (i.e., the voltage at the op-amp input pin) is 0, the influence of common-mode voltage variations on the input bias current Ib is eliminated, thereby improving accuracy. Secondly, this reduces the performance requirements for the op-amp; the circuit no longer needs to use an op-amp with low Ib. In practice, op-amps with lower specifications and lower cost can be used to replace op-amps with higher specifications and higher cost, thus reducing costs. Thirdly, through the reasonable design of the analog switches, some of the analog switch on-resistance is incorporated into the calculation of the resistance R of the first resistor unit (first switch units S1, S2, S3), while some analog switch on-resistance is not included in the calculation (second switch units S4, S5, S6), eliminating the influence of analog switch on-resistance variations on accuracy. Finally, based on the inverting amplification principle, the op-amp input terminal is always at 0V, unaffected by the input voltage magnitude. Only a suitable first resistor unit R needs to be selected for use at the very front end of the acquisition circuit, suitable for acquisition across the entire range from low to high voltage, and can be widely used in low and high voltage measurement environments.
[0047] In some implementations, the resistance of the first resistor unit R is generally 1MΩ or higher. Specifically, in some cases, the resistance of the first resistor unit R is 10MΩ, consisting of 10 1MΩ resistors connected in series; R1 uses 30kΩ + 8.25kΩ connected in series, corresponding to a ±600V range; R2 uses 249kΩ + 150kΩ connected in series, corresponding to a ±60V range; and R3 uses 4.99MΩ + 1MΩ connected in series, corresponding to a ±6V range.
[0048] like Figure 5 As shown, this application provides a voltage measurement method applied to a voltage measurement circuit as described in any of the first aspect embodiments above. The voltage measurement method includes the following steps: Step 101: Obtain the target range; Step 102: Determine the second resistance unit corresponding to the target range; Step 103: Control the first and second switching units connected to the second resistor unit corresponding to the target range to be turned on; Step 104: Obtain the resistance value of the first resistor unit, the resistance value of the second resistor unit, and the voltage at the sampling input terminal; Step 105: Obtain the voltage measurement result based on the resistance value of the first resistor unit, the resistance value of the second resistor unit, and the voltage at the sampling input terminal.
[0049] In this embodiment, by acquiring the target range, the voltage range to be measured is clearly defined, allowing for the selection of the corresponding circuit configuration. A second resistor unit matching the range is determined. Then, the corresponding first and second switching units are turned on, connecting the second resistor unit to the circuit. Together with the first resistor unit and the operational amplifier, this forms an inverting amplifier circuit, preparing the circuit for accurate voltage measurement. Subsequently, the resistance values of the first and second resistor units, as well as the voltage at the sampling input terminal, are acquired. Utilizing the characteristics of the inverting amplifier circuit, the voltage measurement result is calculated. Through these steps, the circuit can be flexibly switched according to different target ranges, enabling accurate measurement of voltages in different ranges. This effectively coordinates with the voltage measurement circuit to achieve high-precision, multi-range voltage measurement functionality.
[0050] In some implementations, the voltage measurement result is obtained based on the resistance value of the first resistor unit, the resistance value of the second resistor unit, and the voltage at the sampling input terminal, and is subject to the following expression: ; Where Vin is the voltage at the sampling input terminal, Vout is the voltage at the result output terminal, i.e., the voltage measurement result, Ron is the closing resistance of the analog switch, R is the resistance value of the first resistor unit, and Ra is the resistance value of the second resistor unit corresponding to the target range. Figure 1 Taking the voltage measurement circuit shown as an example, Ra can be substituted by the resistance values of R1, R2, or R3.
[0051] It should be noted that the on-resistance of the analog switch is essentially incorporated into the resistance value R. We don't need to concern ourselves with the exact value of Ron itself, as it can be calibrated. Regarding calibration, it can be understood that in a linear system, the actual external input value y is typically fitted to the encoded value x acquired by the ADC using the formula y=kx+b. After calibration, the values of k and b can be calculated and stored in the corresponding storage device. In subsequent use, the actual input value y can be calculated based on the corresponding encoded value x acquired by the ADC and presented to the user. Similarly, in this application, the actual value of the output voltage Vout can be considered as y, and the encoded value acquired by the ADC at the output can be considered as x. The relationship between them can be fitted using the formula y=kx+b. After calibration, the values of k and b can be calculated and determined, thus establishing the specific fitting formula. Therefore, in this application, we don't need to concern ourselves with the exact value of Ron itself, because as long as its resistance value remains unchanged, regardless of its specific value, after calibration, it will be reflected in the k and b values of the formula y=kx+b.
[0052] The voltage measurement method provided in this application can be executed by a voltage measuring device 200. This application uses the voltage measuring device 200 executing the voltage measurement method as an example to illustrate the voltage measuring device 200 provided in this application.
[0053] Please see Figure 6 This is a structural schematic diagram of a voltage measuring device 200 provided in an embodiment of this application. Figure 6 As shown, the voltage measuring device 200 includes: The first acquisition module 201 is used to acquire the target range; Determining module 202 is used to determine the second resistance unit corresponding to the target range; Control module 203 is used to control the first switch unit and the second switch unit connected to the second resistor unit corresponding to the target range to be turned on; The second acquisition module 204 is used to acquire the resistance value of the first resistor unit, the resistance value of the second resistor unit, and the voltage at the sampling input terminal; Module 205 is used to obtain voltage measurement results based on the resistance value of the first resistor unit, the resistance value of the second resistor unit, and the voltage at the sampling input terminal.
[0054] Since the voltage measuring device 200 adopts all the technical solutions of the voltage measuring method of the above embodiments, it has at least all the beneficial effects brought about by the technical solutions of the above embodiments, and will not be described again here.
[0055] Figure 7 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application.
[0056] This electronic device may include a processor 301 and a memory 302 storing computer program instructions.
[0057] Specifically, the processor 301 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0058] Memory 302 may include mass storage for data or instructions. For example, and not limitingly, memory 302 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 302 may include removable or non-removable (or fixed) media. Where appropriate, memory 302 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 302 is non-volatile solid-state memory.
[0059] In some embodiments, memory 302 may include read-only memory (ROM), random access memory (RAM), disk storage media device, optical storage media device, flash memory device, electrical, optical, or other physical / tangible memory storage device. Thus, generally, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of this disclosure.
[0060] The processor 301 implements any of the voltage measurement methods described in the above embodiments by reading and executing computer program instructions stored in the memory 302.
[0061] In one example, the electronic device may also include a communication interface 303 and a bus 310. For example, Figure 7 As shown, the processor 301, memory 302, and communication interface 303 are connected through bus 310 and complete communication with each other.
[0062] The communication interface 303 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.
[0063] Bus 310 includes hardware, software, or both, that couples components of an online data traffic metering device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 310 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, any suitable bus or interconnect is contemplated herein.
[0064] The electronic device can perform the voltage measurement method in the embodiments of this application, thereby achieving the combination Figure 5 and Figure 6 The voltage measurement method and apparatus described.
[0065] Furthermore, in conjunction with the voltage measurement methods in the above embodiments, this application embodiment can provide a computer storage medium for implementation. This computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the voltage measurement methods in the above embodiments.
[0066] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.
[0067] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0068] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0069] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.
[0070] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.
Claims
1. A voltage measurement circuit, characterized in that, include: The first resistor unit has its first end connected to the sampling input terminal; There are N second resistor units with different resistance values, and the N second resistor units correspond to N different ranges. The first end of each second resistor unit is connected to the result output terminal. There are N first switching units, the first end of each of the N first switching units is connected to the second end of the first resistor unit, and the second ends of the N first switching units are connected one-to-one with the second ends of the N second resistor units. There are N second switching units, and the first terminals of the N second switching units are connected one-to-one with the second terminals of the N second resistor units; where N is an integer greater than or equal to 2. The negative feedback unit has its input terminal connected to the second terminal of N second switch units, and its output terminal connected to the result output terminal. The negative feedback unit achieves a virtual short and virtual open state when both the first switch unit and the second switch unit corresponding to any second resistor unit are turned on.
2. The voltage measurement circuit according to claim 1, characterized in that, The negative feedback unit includes: An operational amplifier, wherein the inverting input terminal of the operational amplifier is connected to the second terminal of N second switching units, the non-inverting input terminal of the operational amplifier is connected to ground, and the output terminal of the operational amplifier is connected to the result output terminal.
3. The voltage measurement circuit according to claim 1 or 2, characterized in that, N is 2.
4. The voltage measurement circuit according to claim 1 or 2, characterized in that, N is 3.
5. The voltage measurement circuit according to claim 1, characterized in that, The first resistor unit is a single resistor or a resistor network composed of multiple resistors.
6. The voltage measurement circuit according to claim 1 or 5, characterized in that, The second resistor unit is a single resistor or a resistor network composed of multiple resistors.
7. A voltage measurement method, characterized in that, The method, applied to a voltage measurement circuit as described in any one of claims 1 to 6, comprises: Obtain the target range; Determine the second resistance unit corresponding to the target range; The first and second switching units connected to the second resistor unit corresponding to the target range are turned on; Obtain the resistance value of the first resistor unit, the resistance value of the second resistor unit, and the voltage at the sampling input terminal; The voltage measurement result is obtained based on the resistance value of the first resistor unit, the resistance value of the second resistor unit, and the voltage at the sampling input terminal.
8. A voltage measuring device, characterized in that, Applied to the voltage measurement method as described in claim 7, comprising: The first acquisition module is used to acquire the target range; The determination module is used to determine the second resistance unit corresponding to the target range; The control module is used to control the conduction of the first switch unit and the second switch unit connected to the second resistor unit corresponding to the target range; The second acquisition module is used to acquire the resistance value of the first resistor unit, the resistance value of the second resistor unit, and the voltage at the sampling input terminal; The module is used to obtain voltage measurement results based on the resistance value of the first resistor unit, the resistance value of the second resistor unit, and the voltage at the sampling input terminal.
9. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions being executed by the processor to implement the steps of the voltage measurement method as described in claim 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions for causing a computer to perform the voltage measurement method as described in claim 7.