A non-magnetic water meter water quantity statistics circuit, method and non-magnetic water meter
By designing the positive and reverse pulses of the magnetic-free sensor in the magnetic-free water meter, inputting the pulse counting module of the microcontroller through two channels, the problem of high energy consumption in the existing magnetic-free water meter is solved, and the water volume statistics with low power consumption is achieved.
Patent Information
- Application Number
- CN202111435221.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-29
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2041-11-29
AI Technical Summary
The two pulses without magnetic sensors in the existing magnetic water meter are directly connected to the general IO port of the microcontroller, causing the system to be awakened for a long time when there is water, greatly increasing energy consumption.
A magnetic water meter water quantity statistics circuit is designed, and the positive and reverse pulses of the magnetic sensor are input to the pulse counting module of the microcontroller through two channels respectively to realize water quantity statistics, avoiding the wake-up state that depends on interruptions.
The statistics of pulses are realized without relying on interrupts. Even if there is water, it will not be awakened for a long time, which greatly reduces energy consumption and counts the two pulses emitted by the magnetic-free sensor in single pulse mode.
Smart Images

Figure CN114166296B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of water meters, and in particular to a water volume statistics circuit and method for a non-magnetic water meter and a non-magnetic water meter. Background Art
[0002] With the development of the times, smart water meters have replaced some traditional mechanical water meters and have been widely used. The measurement methods of smart water meters have also become more and more diversified with the development of electronic technology, such as mechanical head detection, ultrasonic detection, magnetic detection and other methods have been introduced one after another. However, these methods have obvious limitations: they are easily affected by external electromagnetic interference or because of the cumulative adsorption of impurities in the water by permanent magnets, resulting in measurement errors or being used, missed or ignored by humans. In this case, non-magnetic water meters are favored by water meter manufacturers for their high measurement accuracy, non-magnetic, no impurity adsorption, and no human interference, and have broad market prospects.
[0003] The non-magnetic sensor in the current non-magnetic water meter uses an LC oscillation circuit to count the number of turns of the metal rotor on the base meter and determine the direction of water flow. Then, according to the actual situation, the pulse waveform of the positive flow or the pulse waveform of the reverse flow is output respectively. If the two pulses generated by the existing non-magnetic sensor are directly connected to the general IO port of the microcontroller, and then the pulse statistics can be realized by relying on interrupts, the entire system will be in a wake-up state for a long time when there is water, which greatly increases energy consumption. Summary of the invention
[0004] In view of the above problems, the present application provides a non-magnetic water meter water volume statistics circuit, method and non-magnetic water meter to solve the problem that the two-way pulses of the non-magnetic sensor in the existing non-magnetic water meter are directly connected to the general IO port of the single chip, and the energy consumption is greatly increased by relying on the terminal to realize pulse statistics.
[0005] To achieve the above-mentioned purpose, the inventor provides a non-magnetic water meter water quantity statistics circuit, including a non-magnetic sensor, a single-chip microcomputer, a first selection channel and a second selection channel.
[0006] The single chip microcomputer comprises a pulse counting module, a first general IO port and a second general IO port, and the pulse counting module is a single channel pulse counting;
[0007] The positive flow pulse output end of the non-magnetic sensor is connected to the pulse counting module through the first selection channel; the reverse flow pulse output end of the non-magnetic sensor is connected to the pulse counting module through the second selection channel;
[0008] The positive current pulse output end of the non-magnetic sensor is connected to the first general IO port of the single-chip microcomputer, and the reverse current pulse output end of the non-magnetic sensor is connected to the second general IO port of the single-chip microcomputer;
[0009] The single chip microcomputer is used to determine whether the received pulse signal is a positive flow pulse or a reverse flow pulse according to the pulse received by the general IO port, and to perform water volume statistics through a pulse counting module according to the received pulse signal and the type of the pulse signal.
[0010] Further optimized, the first selection channel includes a first MOS transistor, the second selection channel includes a second MOS transistor, and the first MOS transistor and the second MOS transistor are both N-channel MOS transistors;
[0011] The gate of the first MOS tube is connected to the positive current pulse output end of the non-magnetic sensor, the source is grounded, and the drain is connected to the pulse counting module of the single chip microcomputer;
[0012] The gate of the second MOS tube is connected to the reverse current pulse output end of the non-magnetic sensor, the source is grounded, and the drain is connected to the pulse counting module of the single chip microcomputer.
[0013] Further optimization, the single chip microcomputer is also used to set the rising edge trigger interrupt of the first general IO port and the second general IO port. When one of the first general IO port and the second general IO port interrupt is triggered, water volume statistics are started, and at the same time, the general IO port interrupt is closed and the other general IO port interrupt is opened.
[0014] Further optimization, the single chip microcomputer is a HC32L176 single chip microcomputer.
[0015] Another technical solution is also provided, a method for counting water volume of a non-magnetic water meter, which is applied to the above-mentioned non-magnetic water meter water volume counting circuit, and the method comprises the following steps:
[0016] The non-magnetic sensor obtains the direction of water flow in the non-magnetic water meter;
[0017] If the water flow direction is positive, a pulse signal is generated according to the number of revolutions of the metal rotor of the non-magnetic water meter, and the pulse signal is output through the positive flow pulse output terminal to turn on the first channel, and the pulse signal is input into the pulse counting module of the single-chip microcomputer, and the pulse signal is sent to the first general IO port of the single-chip microcomputer at the same time;
[0018] If the water flow direction is reverse, a pulse signal is generated according to the number of revolutions of the metal rotor of the non-magnetic water meter, and the pulse signal is output through the reverse flow pulse output terminal to turn on the second channel, and the pulse signal is input into the pulse counting module of the single-chip microcomputer, and the pulse signal is sent to the second general IO port of the single-chip microcomputer at the same time;
[0019] The single chip computer determines the direction of water flow according to the pulse signal received by the first general IO port or the second pulse IO port, and then counts the water volume of the non-magnetic water meter through the pulse information received by the pulse counting module.
[0020] Further optimization, the step of "the single chip computer determines the direction of the water flow according to the pulse signal received by the first general IO port or the second pulse IO port, and then counts the water volume of the non-magnetic water meter through the pulse information received by the pulse counting module" also includes the following steps:
[0021] When one of the first general IO port and the second general IO port interrupt is triggered, the single chip microcomputer starts to count the water volume, and at the same time turns off the general IO port interrupt and turns on the other general IO port interrupt.
[0022] Another technical solution is also provided, a non-magnetic water meter, including a water quantity statistics circuit, wherein the water quantity statistics circuit includes a non-magnetic sensor, a single-chip microcomputer, a first selection channel and a second selection channel.
[0023] The single chip microcomputer comprises a pulse counting module, a first general IO port and a second general IO port, and the pulse counting module is a single channel pulse counting;
[0024] The positive flow pulse output end of the non-magnetic sensor is connected to the pulse counting module through the first selection channel; the reverse flow pulse output end of the non-magnetic sensor is connected to the pulse counting module through the second selection channel;
[0025] The positive current pulse output end of the non-magnetic sensor is connected to the first general IO port of the single-chip microcomputer, and the reverse current pulse output end of the non-magnetic sensor is connected to the second general IO port of the single-chip microcomputer;
[0026] The single chip microcomputer is used to determine whether the received pulse signal is a positive flow pulse or a reverse flow pulse according to the pulse received by the general IO port, and to perform water volume statistics through a pulse counting module according to the received pulse signal and the type of the pulse signal.
[0027] Further optimized, the first selection channel includes a first MOS transistor, the second selection channel includes a second MOS transistor, and the first MOS transistor and the second MOS transistor are both N-channel MOS transistors;
[0028] The gate of the first MOS tube is connected to the positive current pulse output end of the non-magnetic sensor, the source is grounded, and the drain is connected to the pulse counting module of the single chip microcomputer;
[0029] The gate of the second MOS tube is connected to the reverse current pulse output end of the non-magnetic sensor, the source is grounded, and the drain is connected to the pulse counting module of the single chip microcomputer.
[0030] Further optimization, the single chip microcomputer is also used to set the rising edge trigger interrupt of the first general IO port and the second general IO port. When one of the first general IO port and the second general IO port interrupt is triggered, water volume statistics are started, and at the same time, the general IO port interrupt is closed and the other general IO port interrupt is opened.
[0031] Further optimization, the single chip microcomputer is a HC32L176 single chip microcomputer.
[0032] Different from the prior art, the above technical solution is that when the water in the non-magnetic water meter passes through, it drives the metal rotor to rotate, and the non-magnetic sensor detects the number of turns of the metal rotor and counts and generates a corresponding pulse signal. At the same time, the non-magnetic sensor determines the direction of the water flow. When the direction of the water flow is forward, a pulse signal is output through the forward pulse output terminal, and when the direction of the water flow is reverse, a pulse signal is output through the reverse pulse output terminal. When the forward pulse output terminal outputs a pulse signal, the first selection channel is turned on, and the second selection channel is disconnected at this time. The pulse signal output from the forward pulse output terminal is input into the pulse counting module of the single-chip microcomputer for pulse counting. At the same time, the forward output terminal inputs the pulse signal to the first general IO port of the single-chip microcomputer, and the single-chip microcomputer counts the pulses according to the first channel. When the pulse signal is received by the IO port, it can be judged that the pulse signal received by the pulse counting module is a positive flow pulse; when the reverse flow pulse output terminal outputs a pulse signal, the second selection channel is turned on, and the first selection channel is disconnected at this time, and the pulse signal output by the reverse flow pulse output terminal is input into the pulse counting module of the single-chip microcomputer for pulse counting. At the same time, the reverse flow output terminal inputs the pulse signal to the second general IO port of the single-chip microcomputer. When the single-chip microcomputer receives the pulse signal according to the second general IO port, it can be judged that the pulse signal received by the pulse counting module is a reverse flow pulse. The single-chip microcomputer judges whether the received pulse signal is a positive flow pulse or a reverse flow pulse through the first general IO port or the second general IO. Combined with the pulse counting module, the water volume of the non-magnetic water meter can be counted. It realizes the pulse statistics without relying on interrupts, and it will not be in the awake state for a long time even when there is water, which greatly reduces energy consumption. At the same time, it realizes the counting of the two pulses emitted by the non-magnetic sensor in the single pulse mode.
[0033] The above-mentioned records related to the invention content are only an overview of the technical solution of the present application. In order to enable ordinary technicians in the field to more clearly understand the technical solution of the present application, and then implement it according to the text of the specification and the contents recorded in the drawings, and to make the above-mentioned purpose and other purposes, features and advantages of the present application easier to understand, the following is an explanation in combination with the specific implementation mode and drawings of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The drawings are only used to illustrate the principles, implementation methods, applications, characteristics and effects of the specific embodiments of the present application and other related contents, and shall not be considered as limitations of the present application.
[0035] In the drawings of the specification:
[0036] Figure 1 A structural schematic diagram of a water volume statistics circuit of a non-magnetic water meter according to a specific implementation method;
[0037] Figure 2 Another circuit principle diagram of the water volume statistics circuit of the non-magnetic water meter described in the specific implementation method;
[0038] Figure 3 Schematic diagram of the waveform diagram of the positive current pulse counting in the single-channel pulse detection mode of the pulse counting module described in the specific implementation method
[0039] Figure 4 Schematic diagram of the waveform diagram of the reverse flow pulse counting in the single-channel pulse detection mode of the pulse counting module according to the specific implementation method
[0040] Figure 5 A circuit schematic diagram of the first selection channel and the second selection channel of a specific implementation method;
[0041] Figure 6 A flow chart of the method for counting water volume with a non-magnetic water meter according to a specific implementation method.
[0042] The reference numerals in the above drawings are described as follows:
[0043] 110. No magnetic sensor,
[0044] 120. Single chip microcomputer. DETAILED DESCRIPTION
[0045] In order to explain in detail the possible application scenarios, technical principles, specific schemes that can be implemented, and the purposes and effects that can be achieved, the following is a detailed description of the specific embodiments listed in conjunction with the accompanying drawings. The embodiments described herein are only used to more clearly illustrate the technical solutions of the present application, and are therefore only used as examples, and cannot be used to limit the scope of protection of the present application.
[0046] Reference to "embodiment" herein means that the specific features, structures or characteristics described in conjunction with the embodiment may be included in at least one embodiment of the present application. The term "embodiment" appearing in various places in the specification does not necessarily refer to the same embodiment, nor does it particularly limit its independence or association with other embodiments. In principle, in the present application, as long as there is no technical contradiction or conflict, the various technical features mentioned in the embodiments can be combined in any way to form a corresponding implementable technical solution.
[0047] Unless otherwise defined, the technical terms used in this document have the same meanings as those generally understood by those skilled in the art to which this application belongs; the use of relevant terms in this document is only for describing specific embodiments and is not intended to limit this application.
[0048] In the description of this application, the term "and / or" is an expression used to describe the logical relationship between objects, indicating that three relationships may exist, for example, A and / or B, which means: A exists, B exists, and A and B exist at the same time. In addition, the character " / " in this article generally indicates that the objects before and after are in an "or" logical relationship.
[0049] In the present application, terms such as “first” and “second” are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship of quantity, priority or sequence between these entities or operations.
[0050] Without further limitations, in this application, the words "include", "comprises", "has" or other similar expressions used in the sentences are intended to cover non-exclusive inclusion. These expressions do not exclude the presence of additional elements in the process, method or product including the elements, so that the process, method or product including a series of elements may include not only those limited elements, but also other elements not explicitly listed, or also include elements inherent to such process, method or product.
[0051] Similar to the understanding in the Examination Guidelines, in this application, expressions such as "greater than", "less than", "exceed" and the like are understood to exclude the number itself; expressions such as "above", "below", "within" and the like are understood to include the number itself. In addition, in the description of the embodiments of this application, "multiple" means more than two (including two), and similar expressions related to "multiple" are also understood in this way, such as "multiple groups", "multiple times", etc., unless otherwise clearly and specifically limited.
[0052] In the description of the embodiments of the present application, space-related expressions used, such as "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "vertical", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc., indicate the orientation or position relationship based on the orientation or position relationship shown in the specific embodiments or drawings, and are only for the convenience of describing the specific embodiments of the present application or facilitating the reader's understanding, and do not indicate or imply that the referred device or component must have a specific position, a specific orientation, or be constructed or operated in a specific orientation, and therefore cannot be understood as a limitation on the embodiments of the present application.
[0053] Unless otherwise expressly specified or limited, in the description of the embodiments of the present application, the terms such as "install", "connect", "connect", "fix", "set", etc. used should be understood in a broad sense. For example, the "connection" can be a fixed connection, a detachable connection, or an integrated setting; it can be a mechanical connection, an electrical connection, or a communication connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium; it can be the internal connection of two elements or the interaction relationship between two elements. For technicians in the technical field to which the present application belongs, the specific meanings of the above terms in the embodiments of the present application can be understood according to the specific circumstances.
[0054] The current non-magnetic sensor uses an LC oscillation circuit to count the number of turns of the metal rotor on the base meter and determine the direction of water flow. Then, according to the actual situation, it outputs a pulse waveform of positive flow or a pulse waveform of reverse flow.
[0055] The existing HC32L17 series microcontrollers have built-in PCNT modules (Pulse Counter), which can count the input single pulse or dual-channel pulse combination. This module can operate in low-power mode and can output interrupts, and can be used in the field of water meter counting. Although the PCNT module of the HC32L17 series microcontroller can realize water volume statistics, it is impossible to directly connect the two-way positive and negative flow pulse signals of the non-magnetic sensor to the microcontroller in the single-pulse mode. If the dual-channel pulse mode is selected, the non-magnetic sensor cannot meet the pulse counting method in this mode. If the two-way pulse generated by the non-magnetic sensor is directly connected to the general IO port of the microcontroller, and then the pulse statistics can be realized by relying on interrupts, the entire system will be in the wake-up state for a long time when there is water, which greatly increases energy consumption. And when the water flow speed is too fast, too frequent interrupts will also affect the execution of other functions. The PCNT module of the HC32L176 has three counting modes: single-channel pulse, dual-channel orthogonal pulse, and dual-channel non-orthogonal pulse. The dual-channel mode requires that both pulses have signals generated to calculate correctly.
[0056] In order to solve the above technical problems, in the single-pulse mode of the pulse counter of the single-chip microcomputer, the positive flow and reverse flow pulses of the non-magnetic sensor will not appear at the same time. The positive flow pulse and reverse flow pulse of the non-magnetic sensor are designed to be input into the pulse counter of the single-chip microcomputer through two channels respectively. When the non-magnetic sensor outputs a positive flow pulse, the corresponding channel is turned on, so that the positive flow pulse is input into the counter, and when the reverse flow pulse is output, the corresponding channel is turned on, so that the reverse flow pulse is input into the counter, thereby realizing the statistics of the water volume. It is realized that the pulse statistics can be realized without relying on interrupts, and even when there is water, it will not be in the awake state for a long time, which greatly reduces energy consumption. At the same time, it is realized that in the single-pulse mode, the two pulses emitted by the non-magnetic sensor can be counted.
[0057] See also Figure 1 This embodiment provides a non-magnetic water meter water volume statistics circuit, including a non-magnetic sensor 110, a single-chip computer 120, a first selection channel and a second selection channel.
[0058] The single chip microcomputer 120 includes a pulse counting module PCNT, a first general IO port PO NT and a second general IO port RENT, and the pulse counting module PCNT is a single channel pulse counting;
[0059] The positive pulse output terminal PO of the non-magnetic sensor 110 is connected to the pulse counting module PCNT through the first selection channel; the reverse pulse output terminal RE of the non-magnetic sensor 110 is connected to the pulse counting module PCNT through the second selection channel;
[0060] The positive pulse output terminal PO of the non-magnetic sensor 110 is connected to the first general IO port PO NT of the single-chip microcomputer 120, and the reverse pulse output terminal RE of the non-magnetic sensor 110 is connected to the second general IO port RE NT of the single-chip microcomputer 120;
[0061] The single chip microcomputer 120 is used to determine whether the received pulse signal is a positive flow pulse or a reverse flow pulse according to the pulse received by the general IO port, and to perform water volume statistics through the pulse counting module PCNT according to the received pulse signal and the type of the pulse signal.
[0062] A single-chip microcomputer 120 is an integrated circuit chip that uses very large-scale integrated circuit technology to integrate a central processing unit CPU with data processing capabilities, random access memory RAM, read-only memory ROM, multiple I / O ports and interrupt systems, timer / counters and other functions (may also include display drive circuits, pulse width modulation circuits, analog multiplexers, A / D converters and other circuits) onto a silicon chip to form a small and complete microcomputer system. It is widely used in the field of industrial control.
[0063] When the water in the non-magnetic water meter passes through, it drives the metal rotor to rotate. The non-magnetic sensor 110 detects the number of turns of the metal rotor and generates a corresponding pulse signal. At the same time, the non-magnetic sensor 110 determines the direction of the water flow. When the direction of the water flow is forward, a pulse signal is output through the forward pulse output terminal PO, and when the direction of the water flow is reverse, a pulse signal is output through the reverse pulse output terminal RE. When the forward pulse output terminal PO outputs a pulse signal, the first selection channel is turned on, and the second selection channel is disconnected at this time. The pulse signal output by the forward pulse output terminal PO is input into the pulse counting module PCNT of the microcontroller 120 for pulse counting. Please refer to Figure 2After the pulse signal is transmitted to the pulse technology module of the single chip microcomputer 120, the single chip microcomputer 120 also needs to distinguish whether the current pulse is a positive flow pulse or a reverse flow pulse. The signals outputted by the positive pulse output terminal PO and the reverse pulse output terminal RE of the non-magnetic sensor 110 are further divided into two paths, which are respectively connected to the two general IO ports of the single-chip microcomputer 120; that is, the positive pulse output terminal PO of the non-magnetic sensor 110 is connected to the first general IO port PO NT of the single-chip microcomputer 120, and the reverse pulse output terminal RE of the non-magnetic sensor 110 is connected to the second general IO port RE NT of the single-chip microcomputer 120; at the same time, the positive output terminal inputs a pulse signal to the first general IO port PO NT of the single-chip microcomputer 120, and when the single-chip microcomputer 120 receives the pulse signal according to the first general IO port PONT, it can be determined that the pulse signal received by the pulse counting module PCNT is a positive pulse; and when the reverse pulse output terminal RE outputs a pulse signal, the second selection channel is turned on, and the first selection channel is disconnected at this time, and the pulse signal outputted by the reverse pulse output terminal RE is inputted into the pulse counting module PCNT of the single-chip microcomputer 120 for pulse counting, and at the same time, the reverse output terminal inputs a pulse signal to the second general IO port RE of the single-chip microcomputer 120 NT, when the single-chip microcomputer 120 receives a pulse signal according to the second general IO port RENT, it can be determined that the pulse signal received by the pulse counting module PCNT is a reverse flow pulse. The single-chip microcomputer 120 determines whether the received pulse signal is a positive flow pulse or a reverse flow pulse through the first general IO port PO NT or the second general IO. Combined with the pulse counting module PCNT, the water volume statistics of the non-magnetic water meter can be realized. It is realized that the pulse statistics do not need to rely on interrupts, and even when there is water, it will not be in a wake-up state for a long time, which greatly reduces energy consumption and greatly increases the service life of the water meter. At the same time, it is realized that in the single pulse mode, the two pulses emitted by the non-magnetic sensor 110 are counted. At the same time, the water volume statistics can be realized by carrying conventional general-purpose devices, which is highly feasible and low-cost.
[0064] Specifically, Figure 3 The waveform diagram of the positive current pulse counting of the pulse counting module PCNT single-channel pulse detection mode shown in the figure, S0 is the input positive current pulse; S0PF is the pulse after filtering; PCNT_CNT is the pulse count number, which can be set in the single-chip microcomputer 120 to trigger the count, wherein the falling edge trigger is used in this embodiment; PCNT_IFR.OV is the overflow interrupt, when PCNT_CNT reaches the configured maximum value, the single-chip microcomputer 120 will clear the register of PCNT_CNT and restart the counting, and at the same time set the overflow interrupt flag position to 1, at this time, according to the way the non-magnetic sensor 110 generates pulses: one pulse is generated for every 1mL, the maximum value of PCNT_CNT can be set to 100, after recording 100mL, the single-chip microcomputer 120 can add 0.1L to the water volume of the water meter in the interrupt, so as to achieve the purpose of statistical water volume. Figure 4 The waveform diagram of the backflow pulse counting in the single-channel pulse detection mode of the pulse counting module PCNT shown, S0 is the input backflow pulse; S0PF is the pulse after filtering; PCNT_CNT is the pulse count number, which can be set in the single-chip microcomputer 120 to trigger the counting method, wherein the falling edge trigger is used in this embodiment; PCNT_IFR.OV is the overflow interrupt. When PCNT_CNT reaches the configured maximum value, the single-chip microcomputer 120 will clear the register of PCNT_CNT and restart the counting, and at the same time set the overflow interrupt flag position to 1. At this time, according to the way the non-magnetic sensor 110 generates pulses: one pulse is generated for every 1mL, the maximum value of PCNT_CNT can be set to 100. After recording 100mL, the single-chip microcomputer 120 can reduce the water volume of the water meter by 0.1L in the interrupt to achieve the purpose of statistical water volume.
[0065] See also Figure 5 In some embodiments, the first selection channel includes a first MOS transistor Q19, and the second selection channel includes a second MOS transistor Q20, and both the first MOS transistor Q19 and the second MOS transistor Q20 are N-channel MOS transistors;
[0066] The gate of the first MOS transistor Q19 is connected to the positive pulse output terminal PO of the non-magnetic sensor 110, the source is grounded, and the drain is connected to the pulse counting module PCNT of the single chip computer 120;
[0067] The gate of the second MOS transistor Q20 is connected to the reverse pulse output terminal RE of the non-magnetic sensor 110 , the source is grounded, and the drain is connected to the pulse counting module PCNT of the single chip computer 120 .
[0068] MOS tube is the abbreviation of MOSFET. MOSFET Metal-Oxide-Semiconductor Field-Effect Transistor, also known as Metal-Oxide-Semiconductor Field-Effect Transistor (MOSFET). It is generally a metal (metal)-oxide (oxide)-semiconductor (semiconductor) field effect transistor, or a metal-insulator (insulator)-semiconductor. G: gate; S: source; D: drain. The source (source) and drain (depletion layer) of the MOS tube can be swapped. They are both N-type regions formed in the P-type backgate. In most cases, these two regions are the same, and even if the two ends are swapped, it will not affect the performance of the device. Such devices are considered to be symmetrical. Field effect tubes are divided into PMOS tubes (P-channel type) and NMOS (N-channel type) tubes, which belong to insulated gate field effect tubes.
[0069] The non-magnetic sensor 110 outputs a positive pulse at the positive pulse output terminal PO and outputs a reverse pulse at the RE terminal. N-channel MOS tubes are added to the first selection channel of the positive pulse output and the second selection channel of the reverse pulse output respectively. Since only one of the positive and reverse pulses can be triggered at the same time, when a high level appears in one path, the MOS tube of the path is turned on, and the pulse is input to PCNT_S1 as the counting pulse of the PCNT (pulse counting module PCNT) of the single-chip computer 120. For example, when the positive pulse output terminal PO of the non-magnetic sensor 110 outputs a positive pulse, a high level appears on the first selection channel. The first MOS tube Q19 on the first selection channel is turned on, and the positive pulse is output. The reverse pulse is input into PCNT_S1 of the pulse counting module PCNT of the single-chip microcomputer 120. The non-magnetic sensor 110 does not output the reverse pulse this time, and there is no high level on the second selection channel, so the second MOS tube Q20 is in a disconnected state; and when the reverse pulse output terminal RE of the non-magnetic sensor 110 outputs the reverse pulse, a high level appears on the second selection channel, and the second MOS tube Q20 on the second selection channel is turned on, then the reverse pulse is input into PCNT_S1 of the pulse counting module PCNT of the single-chip microcomputer 120. The non-magnetic sensor 110 does not output the positive pulse this time, and there is no high level on the first selection channel, so the first MOS tube Q19 is in a disconnected state. The dual-channel selection in the single pulse mode is realized by setting MOS tubes on the two channels. In other embodiments, the N-channel MOS tubes on the first selection channel and the second selection channel can be replaced with other electronic devices to realize the disconnection of the channel, such as triodes, P-channel MOS tubes, etc.
[0070] In some embodiments, the single chip microcomputer 120 is also used to set the rising edge trigger interrupt of the first general IO port PO NT and the second general IO port RE NT. When one of the general IO port interrupts of the first general IO port PO NT and the second general IO port RE NT is triggered, water volume statistics are started, and at the same time, the general IO port interrupt is closed and the other general IO port interrupt is opened.
[0071] After the pulse is transmitted to the pulse technology module of the single chip microcomputer 120, the single chip microcomputer 120 also needs to distinguish whether the current pulse is a positive flow pulse or a reverse flow pulse. The signals output by the positive pulse output terminal PO and the reverse pulse output terminal RE of the non-magnetic sensor 110 are further divided into two paths, which are respectively connected to the two general IO ports of the single-chip microcomputer 120; that is, the positive pulse output terminal PO of the non-magnetic sensor 110 is connected to the first general IO port PO NT of the single-chip microcomputer 120, and the reverse pulse output terminal RE of the non-magnetic sensor 110 is connected to the second general IO port RE NT of the single-chip microcomputer 120; the single-chip microcomputer 120 sets the first general IO port PO NT and the second general IO port RE NT rising edge trigger interrupt; when one of the general IO port interrupts of the first general IO port PO NT and the second general IO port RE NT is triggered, the single-chip microcomputer 120 can increase or decrease the total water volume, and at the same time, close the general IO port terminal and open the other general IO port interrupt; if the positive pulse output terminal PO of the non-magnetic sensor 110 outputs a positive pulse, the first general IO port PO NT of the single-chip microcomputer 120 The interrupt of NT is triggered, and then the single-chip microcomputer 120 increases the total water volume according to the received positive flow pulse. At the same time, the single-chip microcomputer 120 closes the interrupt of the first general IO port PO NT and opens the interrupt of the second channel IO; on the contrary, the reverse flow pulse output terminal RE of the non-magnetic sensor 110 outputs the rice flow pulse, and the second general IO port RE NT of the single-chip microcomputer 120 is triggered, the single-chip microcomputer 120 starts to reduce the total water volume, and closes the interrupt of the second general IO port RE NT and opens the interrupt of the first channel IO; prevent the continuous interruption of the corresponding general IO port caused by a large number of pulses generated by water flowing in the same direction, so as to ensure that the single-chip microcomputer 120 can enter the low power consumption state.
[0072] In some embodiments, the single-chip microcomputer 120 is a HC32L176 single-chip microcomputer 120. The HC32L17 series single-chip microcomputer has a built-in PCNT module, which can count the input single pulse or dual-channel pulse combination. This module can operate in low-power mode and can output interrupts, and can be used in the field of water meter counting. In other embodiments, the single-chip microcomputer 120 can also use the EFM32 series single-chip microcomputer 120. The EFM32 series single-chip microcomputer generally has a pulse technician, which can not only count the number of external input pulses, but also has an orthogonal decoding module inside that can be used to parse the speed and steering information from the input orthogonal encoding signal interrupt. The pulse technician (PCNT) of the EFM32 series single-chip microcomputer has three working modes, namely single input oversampling mode, external clock input counter mode and external clock orthogonal decoding mode.
[0073] See also Figure 6 In another embodiment, a method for counting water volume of a non-magnetic water meter is applied to the above-mentioned non-magnetic water meter water volume counting circuit, and the method comprises the following steps:
[0074] Step S610: The non-magnetic sensor obtains the water flow direction in the non-magnetic water meter;
[0075] If the water flow direction is forward, then execute step S620: generate a pulse signal according to the number of revolutions of the metal rotor of the non-magnetic water meter, output the pulse signal through the positive flow pulse output terminal to turn on the first channel, input the pulse signal into the pulse counting module of the single-chip microcomputer, and send the pulse signal to the first general IO port of the single-chip microcomputer at the same time;
[0076] If the water flow direction is reverse, then execute step S630: generate a pulse signal according to the number of revolutions of the metal rotor of the non-magnetic water meter, output the pulse signal through the reverse flow pulse output terminal to turn on the second channel, input the pulse signal into the pulse counting module of the single chip microcomputer, and send the pulse signal to the second general IO port of the single chip microcomputer at the same time;
[0077] Step S640: the single chip computer determines the direction of the water flow according to the pulse signal received by the first general IO port or the second pulse IO port, and then counts the water volume of the non-magnetic water meter through the pulse information received by the pulse counting module.
[0078] When the water in the non-magnetic water meter passes through, it drives the metal rotor to rotate. The non-magnetic sensor detects the number of turns of the metal rotor and generates a corresponding pulse signal. At the same time, the non-magnetic sensor determines the direction of the water flow. When the direction of the water flow is forward, the pulse signal is output through the forward pulse output end, and when the direction of the water flow is reverse, the pulse signal is output through the reverse pulse output end. When the forward pulse output end outputs a pulse signal, the first selection channel is turned on, and the second selection channel is disconnected at this time. The pulse signal output from the forward pulse output end is input into the pulse counting module of the microcontroller for pulse counting. After the pulse signal is transmitted to the pulse technology module of the microcontroller, the microcontroller also needs to distinguish whether the current pulse is a forward pulse or a reverse pulse. The signals output from the positive pulse output terminal and the reverse pulse output terminal of the non-magnetic sensor are further divided into two paths, which are respectively connected to the two general IO ports of the single-chip microcomputer; that is, the positive pulse output terminal of the non-magnetic sensor is connected to the first general IO port of the single-chip microcomputer, and the reverse pulse output terminal of the non-magnetic sensor is connected to the second general IO port of the single-chip microcomputer; at the same time, the positive output terminal inputs a pulse signal to the first general IO port of the single-chip microcomputer, and when the single-chip microcomputer receives the pulse signal according to the first general IO port, it can be determined that the pulse signal received by the pulse counting module is a positive pulse; and when the reverse pulse output terminal outputs a pulse When the signal is received, the second selection channel is turned on, and the first selection channel is disconnected at this time. The pulse signal output from the reverse pulse output end is input into the pulse counting module of the single-chip microcomputer for pulse counting. At the same time, the pulse signal is input into the second general IO port of the single-chip microcomputer from the reverse output end. When the single-chip microcomputer receives the pulse signal according to the second general IO port, it can be judged that the pulse signal received by the pulse counting module is a reverse pulse. The single-chip microcomputer judges whether the received pulse signal is a positive pulse or a reverse pulse through the first general IO port or the second general IO. Combined with the pulse counting module, the water volume of the non-magnetic water meter can be counted. It realizes the pulse statistics without relying on interrupts. Even when there is water, it will not be in the awake state for a long time, which greatly reduces energy consumption and greatly increases the service life of the water meter. At the same time, it realizes the counting of the two pulses emitted by the non-magnetic sensor in the single pulse mode. At the same time, the water volume statistics can be realized by carrying conventional general devices, which is highly feasible and low in cost.
[0079] In this embodiment, the step of "the single chip computer determines the direction of the water flow according to the pulse signal received by the first general IO port or the second pulse IO port, and then counts the water volume of the non-magnetic water meter through the pulse information received by the pulse counting module" also includes the following steps:
[0080] When one of the first general IO port and the second general IO port interrupt is triggered, the single chip microcomputer starts to count the water volume, and at the same time turns off the general IO port interrupt and turns on the other general IO port interrupt.
[0081] The single-chip microcomputer sets the rising edge trigger interrupt of the first general IO port and the second general IO port; when one of the first general IO port and the second general IO port interrupt is triggered, the single-chip microcomputer can increase or decrease the total water volume, and at the same time, close the terminal of the general IO port and open the interrupt of another general IO port; if the positive flow pulse output end of the non-magnetic sensor outputs a positive flow pulse, the interrupt of the first general IO port of the single-chip microcomputer is triggered, and then the single-chip microcomputer increases the total water volume according to the positive flow pulse received, and at the same time, the single-chip microcomputer closes the first general IO port interrupt and opens the second channel IO interrupt; conversely, the reverse flow pulse output end of the non-magnetic sensor outputs a reverse flow pulse, the second general IO port of the single-chip microcomputer is triggered, the single-chip microcomputer starts to reduce the total water volume, closes the second general IO port interrupt, and opens the first channel IO interrupt; prevent the corresponding general IO port from being continuously interrupted due to a large number of pulses generated by water flowing in the same direction, so as to ensure that the single-chip microcomputer can enter a low power consumption state.
[0082] See also Figure 1 In another embodiment, a non-magnetic water meter includes a water quantity statistics circuit, which is the non-magnetic water meter water quantity statistics circuit shown in the above embodiment. The water quantity statistics circuit includes a non-magnetic sensor 110, a single-chip computer 120, a first selection channel and a second selection channel.
[0083] The single chip microcomputer 120 includes a pulse counting module PCNT, a first general IO port PO NT and a second general IO port RENT, and the pulse counting module PCNT is a single channel pulse counting;
[0084] The positive pulse output terminal PO of the non-magnetic sensor 110 is connected to the pulse counting module PCNT through the first selection channel; the reverse pulse output terminal RE of the non-magnetic sensor 110 is connected to the pulse counting module PCNT through the second selection channel;
[0085] The positive pulse output terminal PO of the non-magnetic sensor 110 is connected to the first general IO port PO NT of the single-chip microcomputer 120, and the reverse pulse output terminal RE of the non-magnetic sensor 110 is connected to the second general IO port RE NT of the single-chip microcomputer 120;
[0086] The single chip microcomputer 120 is used to determine whether the received pulse signal is a positive flow pulse or a reverse flow pulse according to the pulse received by the general IO port, and to perform water volume statistics through the pulse counting module PCNT according to the received pulse signal and the type of the pulse signal.
[0087] When the water in the non-magnetic water meter passes through, it drives the metal rotor to rotate. The non-magnetic sensor 110 detects the number of turns of the metal rotor and generates a corresponding pulse signal. At the same time, the non-magnetic sensor 110 determines the direction of the water flow. When the direction of the water flow is forward, a pulse signal is output through the forward pulse output terminal PO, and when the direction of the water flow is reverse, a pulse signal is output through the reverse pulse output terminal RE. When the forward pulse output terminal PO outputs a pulse signal, the first selection channel is turned on, and the second selection channel is disconnected at this time. The pulse signal output by the forward pulse output terminal PO is input into the pulse counting module PCNT of the microcontroller 120 for pulse counting. Please refer to Figure 2 After the pulse signal is transmitted to the pulse technology module of the single chip microcomputer 120, the single chip microcomputer 120 also needs to distinguish whether the current pulse is a positive flow pulse or a reverse flow pulse. The signals outputted by the positive pulse output terminal PO and the reverse pulse output terminal RE of the non-magnetic sensor 110 are further divided into two paths, which are respectively connected to the two general IO ports of the single-chip microcomputer 120; that is, the positive pulse output terminal PO of the non-magnetic sensor 110 is connected to the first general IO port PO NT of the single-chip microcomputer 120, and the reverse pulse output terminal RE of the non-magnetic sensor 110 is connected to the second general IO port RE NT of the single-chip microcomputer 120; at the same time, the positive output terminal inputs a pulse signal to the first general IO port PO NT of the single-chip microcomputer 120, and when the single-chip microcomputer 120 receives the pulse signal according to the first general IO port PONT, it can be determined that the pulse signal received by the pulse counting module PCNT is a positive pulse; and when the reverse pulse output terminal RE outputs a pulse signal, the second selection channel is turned on, and the first selection channel is disconnected at this time, and the pulse signal outputted by the reverse pulse output terminal RE is inputted into the pulse counting module PCNT of the single-chip microcomputer 120 for pulse counting, and at the same time, the reverse output terminal inputs a pulse signal to the second general IO port RE of the single-chip microcomputer 120 NT, when the single-chip microcomputer 120 receives a pulse signal according to the second general IO port RENT, it can be determined that the pulse signal received by the pulse counting module PCNT is a reverse flow pulse. The single-chip microcomputer 120 determines whether the received pulse signal is a positive flow pulse or a reverse flow pulse through the first general IO port PO NT or the second general IO. In combination with the pulse counting module PCNT, the water volume of the non-magnetic water meter can be counted. It is realized that the pulse statistics can be realized without relying on interrupts, and even when there is water, it will not be in the awake state for a long time, which greatly reduces energy consumption and greatly increases the service life of the water meter. At the same time, it is realized that in the single pulse mode, the two pulses emitted by the non-magnetic sensor 110 are counted.
[0088] Specifically, Figure 3The waveform diagram of the positive current pulse counting of the pulse counting module PCNT single-channel pulse detection mode shown in the figure, S0 is the input positive current pulse; S0PF is the pulse after filtering; PCNT_CNT is the pulse count number, which can be set in the single-chip microcomputer 120 to trigger the count, wherein the falling edge trigger is used in this embodiment; PCNT_IFR.OV is the overflow interrupt, when PCNT_CNT reaches the configured maximum value, the single-chip microcomputer 120 will clear the register of PCNT_CNT and restart the counting, and at the same time set the overflow interrupt flag position to 1, at this time, according to the way the non-magnetic sensor 110 generates pulses: one pulse is generated for every 1mL, the maximum value of PCNT_CNT can be set to 100, after recording 100mL, the single-chip microcomputer 120 can add 0.1L to the water volume of the water meter in the interrupt, so as to achieve the purpose of statistical water volume. Figure 4 The waveform diagram of the backflow pulse counting in the single-channel pulse detection mode of the pulse counting module PCNT shown, S0 is the input backflow pulse; S0PF is the pulse after filtering; PCNT_CNT is the pulse count number, which can be set in the single-chip microcomputer 120 to trigger the counting method, wherein the falling edge trigger is used in this embodiment; PCNT_IFR.OV is the overflow interrupt. When PCNT_CNT reaches the configured maximum value, the single-chip microcomputer 120 will clear the register of PCNT_CNT and restart the counting, and at the same time set the overflow interrupt flag position to 1. At this time, according to the way the non-magnetic sensor 110 generates pulses: one pulse is generated for every 1mL, the maximum value of PCNT_CNT can be set to 100. After recording 100mL, the single-chip microcomputer 120 can reduce the water volume of the water meter by 0.1L in the interrupt to achieve the purpose of statistical water volume.
[0089] See also Figure 5 In some embodiments, the first selection channel includes a first MOS transistor Q19, and the second selection channel includes a second MOS transistor Q20, and both the first MOS transistor Q19 and the second MOS transistor Q20 are N-channel MOS transistors;
[0090] The gate of the first MOS transistor Q19 is connected to the positive pulse output terminal PO of the non-magnetic sensor 110, the source is grounded, and the drain is connected to the pulse counting module PCNT of the single chip computer 120;
[0091] The gate of the second MOS transistor Q20 is connected to the reverse pulse output terminal RE of the non-magnetic sensor 110 , the source is grounded, and the drain is connected to the pulse counting module PCNT of the single chip computer 120 .
[0092] MOS tube is the abbreviation of MOSFET. MOSFET Metal-Oxide-Semiconductor Field-Effect Transistor, also known as Metal-Oxide-Semiconductor Field-Effect Transistor (MOSFET). It is generally a metal (metal)-oxide (oxide)-semiconductor (semiconductor) field effect transistor, or a metal-insulator (insulator)-semiconductor. G: gate; S: source; D: drain. The source (source) and drain (depletion layer) of the MOS tube can be swapped. They are both N-type regions formed in the P-type backgate. In most cases, these two regions are the same, and even if the two ends are swapped, it will not affect the performance of the device. Such devices are considered to be symmetrical. Field effect tubes are divided into PMOS tubes (P-channel type) and NMOS (N-channel type) tubes, which belong to insulated gate field effect tubes.
[0093] The non-magnetic sensor 110 outputs a positive pulse at the positive pulse output terminal PO and outputs a reverse pulse at the RE terminal. N-channel MOS tubes are added to the first selection channel of the positive pulse output and the second selection channel of the reverse pulse output respectively. Since only one of the positive and reverse pulses can be triggered at the same time, when a high level appears in one path, the MOS tube of the path is turned on, and the pulse is input to PCNT_S1 as the counting pulse of the PCNT (pulse counting module PCNT) of the single-chip computer 120. For example, when the positive pulse output terminal PO of the non-magnetic sensor 110 outputs a positive pulse, a high level appears on the first selection channel. The first MOS tube Q19 on the first selection channel is turned on, and the positive pulse is output. The reverse pulse is input into PCNT_S1 of the pulse counting module PCNT of the single-chip microcomputer 120. The non-magnetic sensor 110 does not output the reverse pulse this time, and there is no high level on the second selection channel, so the second MOS tube Q20 is in a disconnected state; and when the reverse pulse output terminal RE of the non-magnetic sensor 110 outputs the reverse pulse, a high level appears on the second selection channel, and the second MOS tube Q20 on the second selection channel is turned on, then the reverse pulse is input into PCNT_S1 of the pulse counting module PCNT of the single-chip microcomputer 120. The non-magnetic sensor 110 does not output the positive pulse this time, and there is no high level on the first selection channel, so the first MOS tube Q19 is in a disconnected state. The dual-channel selection in the single pulse mode is realized by setting MOS tubes on the two channels. In other embodiments, the N-channel MOS tubes on the first selection channel and the second selection channel can be replaced with other electronic devices to realize the disconnection of the channel, such as triodes, P-channel MOS tubes, etc.
[0094] In some embodiments, the single chip microcomputer 120 is also used to set the rising edge trigger interrupt of the first general IO port PO NT and the second general IO port RE NT. When one of the general IO port interrupts of the first general IO port PO NT and the second general IO port RE NT is triggered, water volume statistics are started, and at the same time, the general IO port interrupt is closed and the other general IO port interrupt is opened.
[0095] After the pulse is transmitted to the pulse technology module of the single chip microcomputer 120, the single chip microcomputer 120 also needs to distinguish whether the current pulse is a positive flow pulse or a reverse flow pulse. The signals output by the positive pulse output terminal PO and the reverse pulse output terminal RE of the non-magnetic sensor 110 are further divided into two paths, which are respectively connected to the two general IO ports of the single-chip microcomputer 120; that is, the positive pulse output terminal PO of the non-magnetic sensor 110 is connected to the first general IO port PO NT of the single-chip microcomputer 120, and the reverse pulse output terminal RE of the non-magnetic sensor 110 is connected to the second general IO port RE NT of the single-chip microcomputer 120; the single-chip microcomputer 120 sets the first general IO port PO NT and the second general IO port RE NT rising edge trigger interrupt; when one of the general IO port interrupts of the first general IO port PO NT and the second general IO port RE NT is triggered, the single-chip microcomputer 120 can increase or decrease the total water volume, and at the same time, close the general IO port terminal and open the other general IO port interrupt; if the positive pulse output terminal PO of the non-magnetic sensor 110 outputs a positive pulse, the first general IO port PO NT of the single-chip microcomputer 120 The interrupt of NT is triggered, and then the single-chip microcomputer 120 increases the total water volume according to the received positive flow pulse. At the same time, the single-chip microcomputer 120 closes the interrupt of the first general IO port PO NT and opens the interrupt of the second channel IO; on the contrary, the reverse flow pulse output terminal RE of the non-magnetic sensor 110 outputs the rice flow pulse, and the second general IO port RE NT of the single-chip microcomputer 120 is triggered, the single-chip microcomputer 120 starts to reduce the total water volume, and closes the interrupt of the second general IO port RE NT and opens the interrupt of the first channel IO; prevent the continuous interruption of the corresponding general IO port caused by a large number of pulses generated by water flowing in the same direction, so as to ensure that the single-chip microcomputer 120 can enter the low power consumption state.
[0096] In some embodiments, the single-chip microcomputer 120 is a HC32L176 single-chip microcomputer 120. The HC32L17 series single-chip microcomputer 120 has a built-in PCNT module, which can count the input single pulse or dual-channel pulse combination. This module can operate in low-power mode and can output interrupts, and can be used in the field of water meter counting. In other embodiments, the single-chip microcomputer 120 can also use the EFM32 series single-chip microcomputer 120. The EFM32 series single-chip microcomputer 120 generally has a pulse technician, which can not only count the number of external input pulses, but also has an orthogonal decoding module inside that can be used to parse speed and steering information from the input orthogonal encoding signal interrupt. The pulse technician (PCNT) of the EFM32 series single-chip microcomputer 120 has three working modes, namely single input oversampling mode, external clock input counter mode and external clock orthogonal decoding mode.
[0097] Finally, it should be noted that although the above embodiments have been described in the specification and drawings of this application, this does not limit the scope of patent protection of this application. All technical solutions generated by replacing or modifying equivalent structures or equivalent processes based on the essential concept of this application using the contents recorded in the specification and drawings of this application, as well as directly or indirectly implementing the technical solutions of the above embodiments in other related technical fields, are included in the scope of patent protection of this application.
Claims
1. A non-magnetic water meter water volume statistics circuit, characterized in that: It includes a non-magnetic sensor, a single chip computer, a first selection channel and a second selection channel; The single chip microcomputer comprises a pulse counting module, a first general IO port and a second general IO port, and the pulse counting module is a single channel pulse counting; The positive current pulse output end of the non-magnetic sensor is connected to the pulse counting module through the first selection channel; The reverse current pulse output end of the non-magnetic sensor is connected to the pulse counting module through the second selection channel; The positive current pulse output end of the non-magnetic sensor is connected to the first general IO port of the single-chip microcomputer, and the reverse current pulse output end of the non-magnetic sensor is connected to the second general IO port of the single-chip microcomputer; The single chip microcomputer is used to determine whether the received pulse signal is a positive flow pulse or a reverse flow pulse according to the pulse received by the general IO port, and to perform water volume statistics through a pulse counting module according to the received pulse signal and the type of the pulse signal; The first selection channel includes a first MOS transistor, the second selection channel includes a second MOS transistor, and both the first MOS transistor and the second MOS transistor are N-channel MOS transistors; The gate of the first MOS tube is connected to the positive current pulse output end of the non-magnetic sensor, the source is grounded, and the drain is connected to the pulse counting module of the single chip microcomputer; The gate of the second MOS tube is connected to the reverse current pulse output end of the non-magnetic sensor, the source is grounded, and the drain is connected to the pulse counting module of the single chip microcomputer.
2. The non-magnetic water meter water quantity statistics circuit according to claim 1, characterized in that: The single chip microcomputer is also used to set the rising edge trigger interrupt of the first general IO port and the second general IO port. When one of the general IO port interrupts of the first general IO port and the second general IO port is triggered, water volume statistics are started, and at the same time, the general IO port interrupt is closed and the other general IO port interrupt is opened.
3. The non-magnetic water meter water quantity statistics circuit according to claim 1, characterized in that: The single chip microcomputer is a HC32L176 single chip microcomputer.
4. A method for counting water volume of a non-magnetic water meter, characterized in that: Applied to the water volume statistics circuit of the non-magnetic water meter described in any one of claims 1 to 3 above, the method comprises the following steps: The non-magnetic sensor obtains the direction of water flow in the non-magnetic water meter; If the water flow direction is positive, a pulse signal is generated according to the number of revolutions of the metal rotor of the non-magnetic water meter, and the pulse signal is output through the positive flow pulse output terminal to turn on the first channel, and the pulse signal is input into the pulse counting module of the single-chip microcomputer, and the pulse signal is sent to the first general IO port of the single-chip microcomputer at the same time; If the water flow direction is reverse, a pulse signal is generated according to the number of revolutions of the metal rotor of the non-magnetic water meter, and the pulse signal is output through the reverse flow pulse output terminal to turn on the second channel, and the pulse signal is input into the pulse counting module of the single-chip microcomputer, and the pulse signal is sent to the second general IO port of the single-chip microcomputer at the same time; The single chip computer determines the direction of water flow according to the pulse signal received by the first general IO port or the second pulse IO port, and then counts the water volume of the non-magnetic water meter through the pulse information received by the pulse counting module.
5. The method for counting water volume using a non-magnetic water meter according to claim 4, characterized in that: The step of "the single chip computer determines the direction of the water flow according to the pulse signal received by the first general IO port or the second pulse IO port, and then counts the water volume of the non-magnetic water meter through the pulse information received by the pulse counting module" also includes the following steps: When one of the first general IO port and the second general IO port interrupt is triggered, the single chip microcomputer starts to count the water volume, and at the same time turns off the general IO port interrupt and turns on the other general IO port interrupt.
Citation Information
Patent Citations
Reusable pulsed quantity input and switch quantity input circuit
CN201570987U
Electromagnetic flowmeter
JP1990057918A