Voltage sampling circuit, sampling method and gas meter
By designing a voltage sampling circuit including a main control module, a sampling module and a discharge module, the problem of complex structure and high cost of the intelligent gas meter voltage sampling circuit in the prior art is solved, and the voltage sampling circuit is simplified and cost-reduced.
Patent Information
- Application Number
- CN202510395689.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-06-24
AI Technical Summary
The existing intelligent gas meter voltage sampling circuit structure is too complex and has high cost, making it difficult to effectively reduce the voltage sampling complexity when battery voltage is used.
A voltage sampling circuit including a main control module, a sampling module and a discharge module is designed. The third end of the sampling module is discharged during the discharge stage and turned off when the voltages of the second end and the third end of the sampling module are equal. The main control module samples the voltage of the second end of the sampling module during the sampling stage.
The structure of the voltage sampling circuit is simplified, the number of devices is reduced, the cost is reduced, and the service life of the battery is improved.
Smart Images

Figure CN120195450A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of electronic technologies, and in particular, to a voltage sampling circuit, a sampling method, and a gas meter. Background Art
[0002] The power supply of current intelligent gas meters is basically powered by disposable batteries such as alkaline batteries or lithium batteries, and the battery voltage decreases continuously as the meter is used. When it is detected that the battery voltage drops to the low voltage threshold, the reporting function is no longer performed and the valve is closed in a timely manner.
[0003] A voltage sampling circuit is usually used to sample the battery voltage, but the structure of the existing voltage sampling circuit is too complex and the cost is relatively high. Summary of the Invention
[0004] The embodiments of the present invention provide a voltage sampling circuit, a sampling method, and a gas meter to simplify the structure of the voltage sampling circuit and reduce the cost.
[0005] According to one aspect of the present invention, a voltage sampling circuit is provided, including: a main control module, a sampling module, and a discharging module;
[0006] The first end of the sampling module is connected to an input voltage, the second end of the sampling module is connected to the first end of the main control module, the third end of the sampling module is connected to the first end of the discharging module, the second end of the discharging module is connected to a fixed voltage, the third end of the discharging module is connected to the second end of the main control module. The discharging module is configured to discharge the third end of the sampling module during the discharging stage and turn off when the voltages at the second end and the third end of the sampling module are equal. The main control module is configured to sample the voltage at the second end of the sampling module during the sampling stage when the voltage at the third end of the sampling module is less than a preset voltage;
[0007] Wherein, the sampling stage is after the discharging stage.
[0008] Optionally, the sampling module includes a first sampling resistor, a second sampling resistor, and a first capacitor;
[0009] The first end of the first sampling resistor is connected to the input voltage, the second end of the first sampling resistor and the first end of the first capacitor are connected to a first node, the second end of the first capacitor and the first end of the second sampling resistor are connected to a second node, the second end of the second sampling resistor is grounded, the first end of the discharging module is connected to the first node, and the first end of the main control module is connected to the second node.
[0010] Optionally, the master control module is configured to: during the discharging stage, output a first level at the first end of the master control module and output a second level at the second end of the master control module; during the sampling stage, configure the first end of the master control module as an analog input mode and output a third level at the second end of the master control module;
[0011] Wherein, the second level is the level that enables the discharging module to conduct, the third level is the level that enables the discharging module to turn off, and the level of the fixed voltage is the same as the first level.
[0012] Optionally, the discharging module includes a triode and a current-limiting resistor. The first pole of the triode is connected to the third end of the sampling module, the second pole of the triode is connected to the fixed voltage, and the third pole of the triode is connected to the second end of the master control module via the current-limiting resistor.
[0013] Optionally, the discharging module includes a MOS transistor. The first pole of the MOS transistor is connected to the third end of the sampling module, the second pole of the MOS transistor is connected to the fixed voltage, and the third pole of the MOS transistor is connected to the second end of the master control module.
[0014] Optionally, the fixed voltage is the ground voltage.
[0015] Optionally, the voltage sampling circuit further includes a power supply module. The first input end of the power supply module is connected to the input voltage, the second input end of the power supply module is grounded, and the output end of the power supply module is connected to the third end of the master control module.
[0016] Optionally, the power supply module includes a power input interface, a diode, a voltage stabilizing unit, a second capacitor, a third capacitor, and a fourth capacitor;
[0017] The first end of the power input interface is connected to the input voltage, the second end of the power input interface is grounded, the first end of the diode is connected to the first end of the power input interface, the second end of the diode is connected to the first end of the voltage stabilizing unit, and the second end of the voltage stabilizing unit is connected to the third end of the master control module;
[0018] The first end of the second capacitor is connected to the first end of the voltage stabilizing unit, the second end of the second capacitor is grounded, the first end of the third capacitor is connected to the second end of the voltage stabilizing unit, the second end of the third capacitor is grounded, the first end of the fourth capacitor is connected to the second end of the voltage stabilizing unit, and the second end of the fourth capacitor is grounded.
[0019] According to another aspect of the present invention, there is provided a voltage sampling method, which is executed by the voltage sampling circuit provided in any embodiment of the present invention. The voltage sampling method includes:
[0020] During the discharging stage, control the discharging module to discharge the first end of the sampling module, and control the discharging module to turn off when the voltages at the second end and the third end of the sampling module are equal;
[0021] During the sampling stage, control the main control module to sample the voltage at the second end of the sampling module when the voltage at the third end of the sampling module is less than a preset voltage.
[0022] According to another aspect of the present invention, there is provided a gas meter, which includes the voltage sampling circuit provided in any embodiment of the present invention.
[0023] The technical solution provided by the embodiment of the present invention samples the input voltage by setting a main control module, a sampling module and a discharging module. The discharging module is used to discharge the third end of the sampling module during the discharging stage and turn off when the voltages at the second end and the third end of the sampling module are equal. The main control module is used to sample the voltage at the second end of the sampling module during the sampling stage when the voltage at the third end of the sampling module is less than a preset voltage. Compared with the solution in the related art, the voltage sampling circuit provided by the embodiment of the present invention has a simple structure, which is beneficial to reducing the number of components and thus reducing the cost.
[0024] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0026] Figure 1 It is a schematic structural diagram of a voltage sampling circuit provided by an embodiment of the present invention;
[0027] Figure 2 It is a schematic structural diagram of another voltage sampling circuit provided by an embodiment of the present invention;
[0028] Figure 3 It is a schematic structural diagram of another voltage sampling circuit provided by an embodiment of the present invention;
[0029] Figure 4 It is a schematic structural diagram of another voltage sampling circuit provided by an embodiment of the present invention;
[0030] Figure 5Schematic diagram of another voltage sampling circuit provided by an embodiment of the present invention;
[0031] Figure 6 Flowchart of a voltage sampling method provided by an embodiment of the present invention. Detailed implementation manners
[0032] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described here can be implemented in an order different from those illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not necessarily need to be limited to those clearly listed steps or units, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0034] Figure 1 Schematic diagram of a voltage sampling circuit provided by an embodiment of the present invention, refer to Figure 1 , the voltage sampling circuit includes: a main control module 10, a sampling module 20, and a discharging module 30; a first end of the sampling module 20 is connected to an input voltage VIN, a second end of the sampling module 20 is connected to a first end of the main control module 10, a third end of the sampling module 20 is connected to a first end of the discharging module 30, a second end of the discharging module 30 is connected to a fixed voltage VOM, and a third end of the discharging module 30 is connected to a second end of the main control module 10. The discharging module 30 is configured to discharge the third end of the sampling module 20 during a discharging stage and turn off when the voltages at the second end and the third end of the sampling module 20 are equal. The main control module 10 is configured to sample the voltage at the second end of the sampling module 20 during a sampling stage when the voltage at the third end of the sampling module 20 is less than a preset voltage.
[0035] Among them, the sampling stage is after the discharging stage.
[0036] Specifically, the first end of the sampling module 20 is connected to the input voltage VIN as the power input terminal, and the input voltage VIN is the voltage to be sampled. The first end of the main control module 10 is the sampling terminal, and the second end is the sampling control terminal. For example, the main control module 10 can be a single-chip microcomputer. The first end of the main control module 10 is the ADC sampling terminal of the single-chip microcomputer, and the second end of the main control module 10 is the ADC control terminal.
[0037] In the discharging stage, under the control of the main control module 10, the third end of the sampling module 20 is discharged through the discharging module 30, so that the voltages at the second end and the third end of the sampling module 20 are equal, preparing for the sampling stage in advance. When the discharging module 30 is turned off, the sampling stage is entered. When the voltage at the third end of the sampling module 20 is less than the preset voltage, a current is generated inside the sampling module 20, and the first end of the main control module 10 samples the voltage at the second end of the sampling module 20. The correct sampling voltage value is obtained through program conversion inside the main control module 10.
[0038] The technical solution provided by the embodiment of the present invention samples the input voltage VIN by setting the main control module 10, the sampling module 20, and the discharging module 30. The discharging module 30 is used to discharge the third end of the sampling module 20 in the discharging stage and turn off when the voltages at the second end and the third end of the sampling module 20 are equal. The main control module 10 is used to sample the voltage at the second end of the sampling module 20 when the voltage at the third end of the sampling module 20 is less than the preset voltage in the sampling stage. Compared with the solution in the related art, the voltage sampling circuit provided by the embodiment of the present invention has a simple structure, which is beneficial to reducing the number of components, thereby reducing costs.
[0039] Figure 2 FIG. is a schematic structural diagram of another voltage sampling circuit provided by an embodiment of the present invention. On the basis of the above embodiment, refer to Figure 2 Optionally, the sampling module 20 includes a first sampling resistor R1, a second sampling resistor R2, and a first capacitor C1. The first end of the first sampling resistor R1 is connected to the input voltage VIN. The second end of the first sampling resistor R1 and the first end of the first capacitor C1 are connected to a first node N1. The second end of the first capacitor C1 and the first end of the second sampling resistor R2 are connected to a second node N2. The second end of the second sampling resistor R2 is grounded. The first end of the discharging module 30 is connected to the first node N1, and the first end of the main control module 10 is connected to the second node N2.
[0040] Specifically, the first sampling resistor R1, the first capacitor C1, and the second sampling resistor R2 are connected in series in sequence. The connection node of the first sampling resistor R1 and the first capacitor C1 (i.e., the first node N1) serves as the third terminal of the sampling module 20 and is connected to the first terminal of the discharge module 30. The connection node of the first capacitor C1 and the second sampling resistor R2 (i.e., the second node N2) serves as the second terminal of the sampling module 20 and is connected to the first terminal of the main control module 10.
[0041] In this embodiment, the main control module 10 is configured as follows: in the discharge stage, the first terminal of the main control module 10 outputs a first level, and the second terminal of the main control module 10 outputs a second level; in the sampling stage, the first terminal of the main control module 10 is configured in an analog input mode, and the second terminal of the main control module 10 outputs a third level. Among them, the second level is the level that enables the discharge module 30 to conduct, the third level is the level that enables the discharge module 30 to turn off, and the level of the fixed voltage VOM is the same as the first level.
[0042] Specifically, in the discharge stage, the first terminal of the main control module 10 outputs a first level, the second terminal of the main control module 10 outputs a second level, the voltage of the second node N2 remains at a low voltage, and the discharge module 30 conducts under the action of the second level to discharge the first node N1, that is, to discharge the first capacitor C1. When the voltages at both ends of the first capacitor C1 are equal, the discharge stage ends, and the discharge module 30 turns off in response to the third level output by the second terminal of the main control module 10. In the sampling stage, the first terminal of the main control module 10 is configured in an analog input mode, and the input voltage VIN charges the first capacitor C1. The first capacitor C1 is in a transient state, and the voltage across it cannot change suddenly and can conduct direct current. Therefore, the first terminal of the main control module 10 can collect the voltage of the second node N2. The main control module 10 internally calculates the voltage of the collected second node N2 to obtain the accurate value of the input voltage VIN, thereby realizing the acquisition of the input voltage. Here, the voltage of the second node N2 is the voltage after the input voltage VIN is divided by the first sampling resistor R1 and the second sampling resistor R2.
[0043] In this embodiment, since the transient process of the first capacitor C1 is short, the sampling time is also relatively short. By configuring the main control module 10 accordingly, rapid voltage sampling can be completed when the first capacitor C1 is in a transient state.
[0044] After the sampling is completed, the first terminal and the second terminal of the main control module 10 resume the default configuration, that is, the first terminal and the second terminal of the main control module 10 are open-drain outputs. Since the first capacitor C1 has the characteristic of blocking direct current and passing alternating current, the voltage sampling circuit has no power consumption when not sampling, which is beneficial to reducing the power consumption of the entire sampling circuit and thus beneficial to improving the service life of the battery. Among them, the first capacitor C1 can be a ceramic capacitor.
[0045] Figure 3 A schematic structural diagram of another voltage sampling circuit provided by an embodiment of the present invention. On the basis of the above embodiments, with reference to Figure 3 , optionally, the discharge module 30 includes a triode Q1 and a current-limiting resistor R3. The first pole of the triode Q1 is connected to the third end of the sampling module 20. The second pole of the triode Q1 is connected to a fixed voltage VOM. The third pole of the triode Q1 is connected to the second end of the main control module 10 via the current-limiting resistor R3.
[0046] Figure 4 A schematic structural diagram of another voltage sampling circuit provided by an embodiment of the present invention. On the basis of the above embodiments, with reference to Figure 4 , optionally, the discharge module 30 includes an MOS transistor Q2. The first pole of the MOS transistor Q2 is connected to the third end of the sampling module 20. The second pole of the MOS transistor Q2 is connected to a fixed voltage VOM. The third pole of the MOS transistor Q2 is connected to the second end of the main control module 10. Optionally, a current-limiting resistor may also be connected to the third pole of the MOS transistor Q2.
[0047] In this embodiment, the fixed voltage VOM may be the ground voltage VGND. After the first capacitor C1 is discharged through the triode Q1 or the MOS transistor Q2, the voltage across the first capacitor C1 is 0V, which can make the voltage difference between the input voltage VIN and the voltage (0V) of the first capacitor C1 the largest, facilitating the flow of direct current through the first capacitor C1 and making it convenient for the main control module 10 to collect the voltage of the second node N2.
[0048] Compared with the technical solution in the related art where the sampling control end of the main control module 10 is connected to the first node N1, in the technical solution provided by the embodiment of the present invention, by connecting the second end of the main control module 10 to the control end of the discharge module 30 to control the on-off of the discharge module 30, the main control module 10 does not need to have an open-drain function (to prevent IO port leakage), and only push-pull output needs to be achieved, reducing the requirements for the IO ports on the main control module 10 and improving the compatibility of the circuit.
[0049] Figure 5 A schematic structural diagram of another voltage sampling circuit provided by an embodiment of the present invention. On the basis of the above embodiments, with reference to Figure 5 , optionally, the voltage sampling circuit further includes a power supply module 40. The first input end of the power supply module 40 is connected to the input voltage VIN. The second input end of the power supply module 40 is grounded. The output end of the power supply module 40 is connected to the third end of the main control module 10. The third end of the main control module 10 is a power supply end, and the power supply module 40 converts the input voltage VIN into a voltage suitable for the main control module 10. For example, if the main control module 10 is a single-chip microcomputer, the power supply module 40 is used to convert the input voltage VIN into a 3.3V voltage to supply power to the main control module 10.
[0050] Specifically, the power supply module 40 includes a power input interface 401, a diode D1, a voltage regulation unit 402, a second capacitor C2, a third capacitor C3, and a fourth capacitor C4; the first end of the power input interface 401 is connected to the input voltage VIN, the second end of the power input interface 401 is grounded, the first end of the diode D1 is connected to the first end of the power input interface 401, the second end of the diode D1 is connected to the first end of the voltage regulation unit 402, and the second end of the voltage regulation unit 402 is connected to the third end of the main control module 10; the first end of the second capacitor C2 is connected to the first end of the voltage regulation unit 402, the second end of the second capacitor C2 is grounded, the first end of the third capacitor C3 is connected to the second end of the voltage regulation unit 402, the second end of the third capacitor C3 is grounded, the first end of the fourth capacitor C4 is connected to the second end of the voltage regulation unit 402, and the second end of the fourth capacitor C4 is grounded.
[0051] Among them, the diode D1 can be used to implement the functions of reverse connection prevention and inrush current suppression. The second capacitor C2 is a bypass capacitor, the third capacitor C3 and the fourth capacitor C4 are decoupling capacitors, and the voltage regulation unit 402 is a linear voltage regulator, which is used to provide a stable power supply voltage for the main control module 10.
[0052] Optionally, a filter capacitor can also be connected to the third end of the main control module 10 to smooth the power supply voltage.
[0053] Optionally, the embodiment of the present invention also provides a voltage sampling method, which is executed by the voltage sampling circuit provided in any of the above embodiments. Figure 6 For the flowchart of a voltage sampling method provided by the embodiment of the present invention, refer to Figure 6 , this sampling method includes:
[0054] S110. In the discharging stage, control the discharging module to discharge the first end of the sampling module, and control the discharging module to turn off when the voltages at the second end and the third end of the sampling module are equal.
[0055] S120. In the sampling stage, control the main control module to sample the voltage at the second end of the sampling module when the voltage at the third end of the sampling module is less than the preset voltage.
[0056] The voltage sampling circuit provided by the embodiment of the present invention has a simple structure and a simple control method, which is beneficial to reducing the cost of the main control module 10, thereby reducing the cost of the entire circuit.
[0057] Optionally, the embodiment of the present invention also provides a gas meter, specifically an intelligent gas meter. The gas meter includes the voltage sampling circuit provided in any of the above embodiments, so the gas meter also has the beneficial effects described in any of the above embodiments.
[0058] It should be understood that the various forms of processes shown above can be used, with steps reordered, added or deleted. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and no limitation is imposed herein.
[0059] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub - combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
Claims
1. A voltage sampling circuit, characterized in that: include: Main control module, sampling module and discharge module; The first end of the sampling module is connected to the input voltage, the second end of the sampling module is connected to the first end of the main control module, the third end of the sampling module is connected to the first end of the discharge module, the second end of the discharge module is connected to the fixed voltage, the third end of the discharge module is connected to the second end of the main control module, the discharge module is used to discharge the third end of the sampling module in the discharge stage, and shut down when the voltages of the second and third ends of the sampling module are equal, and the main control module is used to sample the voltage of the second end of the sampling module when the voltage of the third end of the sampling module is less than the preset voltage in the sampling stage; The sampling phase is located after the discharging phase.
2. The voltage sampling circuit according to claim 1, characterized in that: The sampling module includes a first sampling resistor, a second sampling resistor and a first capacitor; The first end of the first sampling resistor is connected to the input voltage, the second end of the first sampling resistor and the first end of the first capacitor are connected to a first node, the second end of the first capacitor and the first end of the second sampling resistor are connected to a second node, the second end of the second sampling resistor is grounded, the first end of the discharge module is connected to the first node, and the first end of the main control module is connected to the second node.
3. The voltage sampling circuit according to claim 2, characterized in that: The main control module is configured as follows: in the discharge stage, the first end of the main control module outputs a first level, and the second end of the main control module outputs a second level; in the sampling stage, the first end of the main control module is configured as an analog input mode, and the second end of the main control module outputs a third level; The second level is a level that turns on the discharge module, the third level is a level that turns off the discharge module, and the level of the fixed voltage is the same as the first level.
4. The voltage sampling circuit according to claim 1, characterized in that: The discharge module includes a transistor and a current limiting resistor, the first pole of the transistor is connected to the third end of the sampling module, the second pole of the transistor is connected to the fixed voltage, and the third pole of the transistor is connected to the second end of the main control module via the current limiting resistor.
5. The voltage sampling circuit according to claim 1, characterized in that: The discharge module includes a MOS tube, a first electrode of the MOS tube is connected to the third end of the sampling module, a second electrode of the MOS tube is connected to the fixed voltage, and a third electrode of the MOS tube is connected to the second end of the main control module.
6. The voltage sampling circuit according to claim 4 or 5, characterized in that: The fixed voltage is a ground voltage.
7. The voltage sampling circuit according to claim 1, characterized in that: The voltage sampling circuit also includes a power supply module, a first input terminal of the power supply module is connected to the input voltage, a second input terminal of the power supply module is grounded, and an output terminal of the power supply module is connected to a third terminal of the main control module.
8. The voltage sampling circuit according to claim 7, characterized in that: The power module includes a power input interface, a diode, a voltage stabilizing unit, a second capacitor, a third capacitor and a fourth capacitor; The first end of the power input interface is connected to the input voltage, the second end of the power input interface is grounded, the first end of the diode is connected to the first end of the power input interface, the second end of the diode is connected to the first end of the voltage stabilizing unit, and the second end of the voltage stabilizing unit is connected to the third end of the main control module; The first end of the second capacitor is connected to the first end of the voltage stabilizing unit, the second end of the second capacitor is grounded, the first end of the third capacitor is connected to the second end of the voltage stabilizing unit, the second end of the third capacitor is grounded, the first end of the fourth capacitor is connected to the second end of the voltage stabilizing unit, and the second end of the fourth capacitor is grounded.
9. A voltage sampling method, characterized in that: The voltage sampling method is performed by the voltage sampling circuit according to any one of claims 1 to 8, and comprises: In the discharge phase, the discharge module is controlled to discharge the first end of the sampling module, and the discharge module is controlled to be turned off when the voltages at the second end and the third end of the sampling module are equal; In the sampling phase, the main control module is controlled to sample the voltage at the second end of the sampling module when the voltage at the third end of the sampling module is less than a preset voltage.
10. A gas meter, characterized in that: The invention comprises the voltage sampling circuit as described in any one of claims 1 to 8.