CN105841770A - Water meter pulse signal metering method and system based on interruption and AD sampling - Google Patents
Water meter pulse signal metering method and system based on interruption and AD sampling Download PDFInfo
- Publication number
- CN105841770A CN105841770A CN201610177855.0A CN201610177855A CN105841770A CN 105841770 A CN105841770 A CN 105841770A CN 201610177855 A CN201610177855 A CN 201610177855A CN 105841770 A CN105841770 A CN 105841770A
- Authority
- CN
- China
- Prior art keywords
- line
- level signal
- pulse signal
- signal
- water meter
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01F—MEASURING VOLUME, VOLUME FLOW, MASS FLOW OR LIQUID LEVEL; METERING BY VOLUME
- G01F15/00—Details of, or accessories for, apparatus of groups G01F1/00 - G01F13/00 insofar as such details or appliances are not adapted to particular types of such apparatus
- G01F15/07—Integration to give total flow, e.g. using mechanically-operated integrating mechanism
- G01F15/075—Integration to give total flow, e.g. using mechanically-operated integrating mechanism using electrically-operated integrating means
Landscapes
- Physics & Mathematics (AREA)
- Fluid Mechanics (AREA)
- General Physics & Mathematics (AREA)
- Measuring Volume Flow (AREA)
Abstract
The invention discloses a water meter pulse signal metering method and system based on interruption and AD sampling; the method comprises the following steps: a sensor detects the water meter so as to obtain an A line pulse signal and a B line pulse signal; a microcontroller obtains a corresponding A line level signal and B line level signal according to the A line pulse signal and B line pulse signal; the microcontroller outputs a high level signal according to a preset detection period; if the A line level signal is high level signal, the microcontroller triggers interruption; if the A line level signal is firstly high level signal, the B line level signal is determined whether to be a low level signal; if the B line level signal is low level signal, the water meter is determined to spin forward; if the B line level signal is high level signal, the water meter is determined to spin backward; water meter spin forward and backward metering data are stored. If the A line level signal has a rising edge, the microcontroller can trigger interruption for metering, thus reducing small flow pulse signal measuring errors, and improving metering accuracy.
Description
Technical field
The present invention relates to water meter measurement technical field, particularly relate to a kind of based on interrupting and the water meter of AD sampling
Pulse signal metering method and system thereof.
Background technology
Traditional water meter pulse signal metering method is all with fixed cycle AD sampling and to be judged by magnitude of voltage
A, B two line adhesive, release conditions combination measure, and needleless is to open sensor, short circuit, magnetic disturbance
Metering, this metering method often has the problem of omission to the pulse signal sampling of low discharge, and metering is inaccurate
Really and measuring accuracy is poor, for outside artificial disturbance cannot and alarm to Surveillance center.
Refer to Fig. 1, if the waveform of sensors A, B two line output is as is illustrated in the left side of fig. 1, then it represents that water
Table rotates forward, if as shown in the right side of Fig. 1, then it represents that water meter inverts.
In the Chinese patent open file of Publication No. CN104330119A, it is proposed that a kind of smart electronics
Water meter and metering method thereof, method includes: S1, transmitter monitor the first Hall element and the second Hall passes
The output voltage of sensor, and judge whether described output voltage occurs saltus step, the most then enter step S2;
If it is not, then repeat step S1;S2, transmitter record the first Hall element and the jumping of the second Hall element
Change order;S3, transmitter judge whether described hopping sequence is the first Hall element adhesive, the second Hall
Sensor disconnects, to the first Hall element adhesive, the second Hall element adhesive, to the first hall sensing
Device disconnects, the second Hall element adhesive, then breaks to the first Hall element disconnection, the second Hall element
Open, the most then control electronic measurement numerical value and also add one, if it is not, then control electronic measurement numerical value to subtract one.Should
Method by judging that hopping sequence judges water meter forward or reverse, but the method to need to detect at least one complete
Whole hop period, simultaneously for the pulse signal of low discharge, easily occurs omitting when sampling, thus leads
Cause to survey by mistake, and the method can not detect other states of water meter and sensor, as open circuit, short circuit, magnetic are done
The state such as disturb.
Summary of the invention
The technical problem to be solved is: provide a kind of based on interrupting and the water meter pulse of AD sampling
Signal metering method and system thereof, can realize the metering of the pulse signal of low discharge, thus improve measuring accuracy.
In order to solve above-mentioned technical problem, the technical solution used in the present invention is: a kind of based on interrupting and AD
The water meter pulse signal metering method of sampling, including:
Sensor detection water meter, obtains A line pulse signal and B line pulse signal;
Microcontroller, according to described A line pulse signal and B line pulse signal, obtains the A line level letter of correspondence
Number and B line level signal;
Microcontroller is according to the detection cycle output high level signal preset;
When A line level signal is high level signal, microcontroller triggers and interrupts;
If A line level signal is high level signal first, then judge whether B line level signal is low level letter
Number;
If B line level signal is low level signal, then judge that described water meter rotates forward;
If B line level signal is high level signal, then judge that described water meter inverts;
Preserve the continuous data that described water meter rotates and reverse.
The invention still further relates to a kind of based on interrupting and the water meter pulse signal metering system of AD sampling, including:
First obtains module, detects water meter for sensor, obtains A line pulse signal and B line pulse signal;
Second obtains module, for microcontroller according to described A line pulse signal and B line pulse signal,
To corresponding A line level signal and B line level signal;
Output module, for microcontroller according to the detection cycle output high level signal preset;
Trigger module, for when A line level signal is high level signal, microcontroller triggers and interrupts;
First judge module, if being high level signal first for A line level signal, then judges B line level
Whether signal is low level signal;
First determination module, if being low level signal for B line level signal, then judges that described water meter rotates forward;
Second determination module, if being high level signal for B line level signal, then judges that described water meter inverts;
Preserve module, for preserving the continuous data that described water meter rotates and reverse.
The beneficial effects of the present invention is: during microcontroller output high level signal, represent and be currently at detection
State;In the case of being high level signal first in A line level signal, i.e. A line level signal is from low
When level signal becomes high level signal, it is judged that now whether B line level signal is low level signal, thus
Determine whether water meter rotates forward, say, that as long as A line level signal has rising edge to produce, can carry out
Metering, the pulse signal sampling solving low discharge often has the problem of omission, is greatly improved accurate measurement
Property, expand wide-measuring range, improve Small flowrate measurement characteristic.
Accompanying drawing explanation
Fig. 1 is the waveform diagram of A, B two paths of signals of sensor output;
Fig. 2 is a kind of flow chart based on the water meter pulse signal metering method interrupted with AD sampling of the present invention;
Fig. 3 is the method flow diagram of the embodiment of the present invention one;
Fig. 4 is the method flow diagram of the embodiment of the present invention two;
Fig. 5 is the circuit diagram of the conditioning module of the embodiment of the present invention three;
Fig. 6 is that the present invention is a kind of to be shown based on the structure interrupted with the water meter pulse signal metering system of AD sampling
It is intended to;
Fig. 7 is the system structure schematic diagram of the embodiment of the present invention four.
Label declaration:
1, first obtains module;2, second obtains module;3, output module;4, trigger module;
5, the first judge module;6, the first determination module;7, the second determination module;8, module is preserved;
9, the second judge module;10, the 3rd judge module;11, first module is removed;12, second module is removed;
13, first module has been put;14, the 3rd obtains module;15, the 3rd determination module;16, the 4th judges mould
Block;17, the 5th determination module;18, the 6th determination module;19, the 7th determination module;
21, transmitting element;22, conversion unit;
51, the first judging unit;52, the first clearing cell;53, first unit has been put;54, second is clear
Except unit;55, the second judging unit.
Detailed description of the invention
By describing the technology contents of the present invention in detail, being realized purpose and effect, below in conjunction with embodiment also
Accompanying drawing is coordinated to be explained in detail.
The design of most critical of the present invention is: when A line level signal is in rising edge, i.e. trigger interrupt into
Row metering.
Refer to Fig. 2, a kind of based on interrupting and the water meter pulse signal metering method of AD sampling, including:
Sensor detection water meter, obtains A line pulse signal and B line pulse signal;
Microcontroller, according to described A line pulse signal and B line pulse signal, obtains the A line level letter of correspondence
Number and B line level signal;
Microcontroller is according to the detection cycle output high level signal preset;
When A line level signal is high level signal, microcontroller triggers and interrupts;
If A line level signal is high level signal first, then judge whether B line level signal is low level letter
Number;
If B line level signal is low level signal, then judge that described water meter rotates forward;
If B line level signal is high level signal, then judge that described water meter inverts;
Preserve the continuous data that described water meter rotates and reverse.
Knowable to foregoing description, the beneficial effects of the present invention is: be greatly improved metering accuracy, expand
Measurement scope, improves Small flowrate measurement characteristic.
Further, after described " microcontroller is according to the detection cycle output high level signal preset ",
Farther include:
Microcontroller according to described A line pulse signal and B line pulse signal, obtain correspondence A line voltage and
B line voltage;
If A line voltage is more than the open circuit threshold value preset, then judge A line open circuit;
If A line voltage is less than the short-circuit threshold value preset, then judge the short circuit of A line;
If B line voltage is more than the open circuit threshold value preset, then judge B line open circuit;
If B line voltage is less than the short-circuit threshold value preset, then judge the short circuit of B line;
If B line voltage is more than or equal to the first interference threshold preset and less than or equal to the second interference threshold preset,
Then it is determined that the presence of magnetic disturbance.
Seen from the above description, magnitude of voltage can be gathered by AD and judge water meter and the open circuit of sensor, short
The state such as road, magnetic disturbance, provides complete the long-range of active message-reporting water meter to monitor for Surveillance center of water undertaking.
It is further, described that " microcontroller, according to described A line pulse signal and B line pulse signal, obtains
Corresponding A line level signal and B line level signal " particularly as follows:
Described A line pulse signal and B line pulse signal are sent to conditioning module by sensor;
Described A line pulse signal and B line shift pulse signal are corresponding A line level signal by conditioning module
Send to microcontroller with after B line level signal.
Seen from the above description, realize impedance matching by conditioning module and pulse signal is converted to level letter
Number, make microcontroller according to level signal, water meter state can be judged.
Further, described " if A line level signal is high level signal first, then judge that B line level is believed
Number whether it is low level signal " particularly as follows:
Judge that A line level signal is first for high level signal;
The most then close external interrupt and remove external interrupt flag bit;
Put A line low level flag bit first;
Remove A line high level flag bit first;
Judge whether B line level signal is low level signal.
Further, described " when A line level signal is high level signal, microcontroller triggers and interrupts "
Before, farther include:
Judge whether A line level signal is high level signal;
If it is not, then judge that A line level signal is first for low level signal;
If A line level signal is low level signal first, opens external interrupt and remove external interrupt flag bit;
Remove A line low level flag bit first;
Put A line high level flag bit first.
Seen from the above description, by remove interrupt flag bit, make next time rising edge time can trigger interruption;
By removing or having put A line index position, prevent repeat count.
Refer to Fig. 6, the present invention also proposes a kind of metering based on the water meter pulse signal interrupted and AD samples and is
System, including:
First obtains module, detects water meter for sensor, obtains A line pulse signal and B line pulse signal;
Second obtains module, for microcontroller according to described A line pulse signal and B line pulse signal,
To corresponding A line level signal and B line level signal;
Output module, for microcontroller according to the detection cycle output high level signal preset;
Trigger module, for when A line level signal is high level signal, microcontroller triggers and interrupts;
First judge module, if being high level signal first for A line level signal, then judges B line level
Whether signal is low level signal;
First determination module, if being low level signal for B line level signal, then judges that described water meter rotates forward;
Second determination module, if being high level signal for B line level signal, then judges that described water meter inverts;
Preserve module, for preserving the continuous data that described water meter rotates and reverse.
Further, also include:
3rd obtains module, for microcontroller according to described A line pulse signal and B line pulse signal,
To corresponding A line voltage and B line voltage;
3rd determination module, if for A line voltage more than the open circuit threshold value preset, then judges A line open circuit;
4th determination module, if for A line voltage less than the short-circuit threshold value preset, then judges the short circuit of A line;
5th determination module, if for B line voltage more than the open circuit threshold value preset, then judges B line open circuit;
6th determination module, if for B line voltage less than the short-circuit threshold value preset, then judges the short circuit of B line;
7th determination module, and if being less than or equal to more than or equal to the first interference threshold preset for B line voltage
The second interference threshold preset, then it is determined that the presence of magnetic disturbance.
Further, described second obtains module and includes:
Transmitting element, sends described A line pulse signal and B line pulse signal to nursing one's health mould for sensor
Block;
Conversion unit, is corresponding for conditioning module by described A line pulse signal and B line shift pulse signal
A line level signal and B line level signal after send to microcontroller.
Further, described first judge module includes:
First judging unit, is used for judging that A line level signal is first for high level signal;
First clearing cell, for the most then closing external interrupt and removing external interrupt flag bit;
First has put unit, is used for having put A line low level flag bit first;
Second clearing cell, is used for removing A line high level flag bit first;
Second judging unit, is used for judging whether B line level signal is low level signal.
Further, also include:
Second judge module, is used for judging whether A line level signal is high level signal;
3rd judge module, for if it is not, then judge that A line level signal is low level signal first;
First removes module, if being low level signal first for A line level signal, opens external interrupt also
Remove external interrupt flag bit;
Second removes module, is used for removing A line low level flag bit first;
First has put module, is used for having put A line high level flag bit first.
Embodiment one
Refer to Fig. 3, embodiments of the invention one are a kind of based on interrupting and the water meter pulse signal of AD sampling
Metering method, comprises the steps:
S1: system initialization;Described system initialization include microcontroller initialize, I/O interface initialize,
AD initializes, interrupts initialization etc., i.e. configures the pin of microcontroller, and carries out setting of interrupt source
Fixed;In the method, interrupt source is A line level signal and is in rising edge.
S2: sensor detection water meter, obtains A line pulse signal and B line pulse signal;
Described A line pulse signal and B line pulse signal are sent to micro-control by S3: sensor by conditioning module
Device processed, sends to microcontroller, microcontroller after pulse signal being converted to level signal by conditioning module
Obtain corresponding A line level signal and B line level signal.
S4: judge whether current time is the default detection time, the most then perform step S5, if it is not,
Then perform step S10.
S5: microcontroller output high level signal.
S6: judge whether A line level signal is high level signal, if not, then it represents that A line level signal is
Low level signal, performs step S7, the most then A line level signal is high level signal, triggers and interrupts,
Perform step S11.
S7: judge that A line level signal is low level signal first, the most then perform step S8, if
No, then perform step S10.
S8: open external interrupt and remove external interrupt flag bit.
S9: remove A line low level flag bit juxtaposition first and play A line high level flag bit first;Perform step
S10。
S10: microcontroller output low level signal, performs step S4.
S11: judge that A line level signal is high level signal first, the most then perform step S12,
If it is not, then perform step S4.
S12: close external interrupt and remove external interrupt flag bit.
S13: put A line low level flag bit first and removed A line high level flag bit first.
S14: judge whether B line level signal is low level signal, the most then perform step S15, if it is not,
Then perform step S16.
S15: judge that described water meter rotates forward.
S16: judge that described water meter inverts.
S17: preserve the continuous data that described water meter rotates and reverse;Perform step S10.
In the present embodiment, triggered by A line level signal rising edge and interrupt, then believe according to B line level
Number height determine the positive-negative rotation state of water meter;As long as A line level signal has rising edge to produce, can touch
Send out interruption to measure, can avoid omission that the measurement of low discharge pulse signal is produced error, improve metering
Accuracy.
Embodiment two
Refer to Fig. 4, the present embodiment is the further expansion of embodiment one, and something in common is not repeated;Difference
Part is:
After described step S5, also comprise the steps:
S18: microcontroller, according to described A line pulse signal and B line pulse signal, obtains the A line of correspondence
Voltage and B line voltage.
S19: judge that A line voltage whether more than the open circuit threshold value preset, the most then performs step S20, if
No, then perform step S21.
S20: judge A line open circuit;Analysis causes whether the reason of open circuit is that sensor comes off with water meter further.
S21: judge that A line voltage whether less than the short-circuit threshold value preset, the most then performs step S22, if
No, then perform step S23.
S22: judge the short circuit of A line.
S23: judge that B line voltage whether more than the open circuit threshold value preset, the most then performs step S24, if
No, then perform step S25.
S24: judge B line open circuit.
S25: judge that B line voltage whether less than the short-circuit threshold value preset, the most then performs step S26, if
No, then perform step S27.
S26: judge the short circuit of B line.
S27: judge that B line voltage is whether more than or equal to the first interference threshold preset and less than or equal to the preset
The most whether two interference thresholds, be in a closed interval, the most then perform step S28, if it is not, then perform step
Rapid S10;Preferably, described first interference threshold is 0.3V, and described second interference threshold is 1.5V.
S28: it is determined that the presence of magnetic disturbance.
In the present embodiment, water meter and biography are judged by the magnitude of voltage of microcontroller AD collection A, B two-way
The states such as sensor open circuit, short circuit, magnetic disturbance, provide complete active sender water for Surveillance center of water undertaking
The long-range monitoring of table.
Embodiment three
Refer to Fig. 5, the present embodiment is a kind of specific implementation of conditioning module in above-described embodiment.
Described conditioning module includes that modulate circuit, described modulate circuit include the first resistance R1 and the second resistance
R2;One end of described first resistance R1 is connected, separately with the A line output of pulse signal pin of described sensor
One end is connected with the interrupt pin of described microcontroller;One end of described second resistance R2 and described sensor
B line output of pulse signal pin connects, and the other end is connected with the GPIO pin of described microcontroller.
Described conditioning module also includes the first electric capacity C1 and the second electric capacity C2;Oneth AD of described microcontroller
Pin is connected with described A line output of pulse signal pin by the first resistance R1;The second of described microcontroller
AD pin is connected with described B line output of pulse signal pin by the second resistance R2;Described first electric capacity
One end of C1 connects an AD pin, other end ground connection;One end of described second electric capacity C2 connects second
AD pin, other end ground connection.
Described modulate circuit also include the 3rd resistance R3, the 4th resistance R4, the first electrostatic impedor ESD1 and
Second electrostatic impedor ESD2, described detection pin is connected by the 3rd resistance R3 and the first resistance R1;
Described detection pin connects also by the 4th resistance R4 and the second resistance R2;Described first electrostatic impedor
One end of ESD1 is connected between described first resistance R1 and the 3rd resistance R3, other end ground connection;Described
One end of two electrostatic impedor ESD2 is connected between described second resistance R2 and the 4th resistance R4, the other end
Ground connection.
Described modulate circuit also includes the 5th resistance R5, the 3rd electric capacity C3 and the 3rd electrostatic impedor ESD3;
Described one end of 5th resistance R5 is connected with the first power pin of described sensor, the other end and described micro-control
The second source pin of device processed connects;One end of described 3rd electric capacity C3 connects described first power pin, separately
One end ground connection;One end of described 3rd electrostatic impedor ESD3 connects second source pin, other end ground connection.
Described sensor also includes ground pin, described ground pin ground connection.
Described detection pin is controlled by GPIO signal, when not considering power problems, and can be with fixing high electricity
Flat output;When must take into system power dissipation, low and high level can be exported with the fixed cycle.When needs detect
During the signal of sensor, then export high level.
By interconnecting power pin, microcontroller can be that sensor provides power supply;Meanwhile, in order to prevent
Sensor internal provides the clock source output dynamic drift of working mechanism for Hall detection pin, needs periodically to carry out
Once switching homing action, microcontroller can be by second source pin output reset signal to sensor;Can
Selection of land, reset signal exports once every month.
Preferably, described sensor is ring-like buckle-type sensor.
Preferably, described microcontroller is PIC single chip microcomputer.
Embodiment four
Refer to Fig. 7, the present embodiment is a kind of based on interrupting and the water meter of AD sampling of corresponding above-described embodiment
Pulse signal metering system, including:
First obtains module 1, detects water meter for sensor, obtains A line pulse signal and B line pulse letter
Number;
Second obtains module 2, for microcontroller according to described A line pulse signal and B line pulse signal,
Obtain A line level signal and the B line level signal of correspondence;
Output module 3, for microcontroller according to the detection cycle output high level signal preset;
Trigger module 4, for when A line level signal is high level signal, microcontroller triggers and interrupts;
First judge module 5, if being high level signal first for A line level signal, then judges B line electricity
Whether ordinary mail number is low level signal, including:
First judging unit 51, is used for judging that A line level signal is first for high level signal;
First clearing cell 52, for the most then closing external interrupt and removing external interrupt flag bit;
First has put unit 53, is used for having put A line low level flag bit first;
Second clearing cell 54, is used for removing A line high level flag bit first;
Second judging unit 55, is used for judging whether B line level signal is low level signal, obtains first and sentences
Disconnected result.
First determination module 6, if being yes for described first judged result, then judges that described water meter rotates forward;
Second determination module 7, if being no for described first judged result, then judges that described water meter inverts;
Preserve module 8, for preserving the continuous data that described water meter rotates and reverse.
Also include:
Second judge module 9, is used for judging whether A line level signal is high level signal, obtains second and sentences
Disconnected result;
3rd judge module 10, if being no for the second judged result, then judges that A line level signal is whether
It is low level signal first, obtains the 3rd judged result;
First removes module 11, if being yes for described 3rd judged result, outside opening external interrupt and removing
Portion's interrupt flag bit;
Second removes module 12, is used for removing A line low level flag bit first;
First has put module 13, is used for having put A line high level flag bit first.
Described second obtains module 2 includes:
Transmitting element 21, sends described A line pulse signal and B line pulse signal to conditioning for sensor
Module;
Conversion unit 22, is right for conditioning module by described A line pulse signal and B line shift pulse signal
Send to microcontroller after the A line level signal answered and B line level signal.
Also include:
3rd obtains module 14, for microcontroller according to described A line pulse signal and B line pulse signal,
Obtain A line voltage and the B line voltage of correspondence;
3rd determination module 15, if for A line voltage more than the open circuit threshold value preset, then judges A line open circuit;
4th determination module 16, if for A line voltage less than the short-circuit threshold value preset, then judges the short circuit of A line;
5th determination module 17, if for B line voltage more than the open circuit threshold value preset, then judges B line open circuit;
6th determination module 18, if for B line voltage less than the short-circuit threshold value preset, then judges the short circuit of B line;
7th determination module 19, and if being less than more than or equal to the first interference threshold preset for B line voltage
In the second default interference threshold, then it is determined that the presence of magnetic disturbance.
In sum, what the present invention provided is a kind of based on interrupting and the water meter pulse signal metering side of AD sampling
Method and system thereof, triggered by A line level signal rising edge and interrupt, then according to the height of B line level signal
The low positive-negative rotation state determining water meter;As long as A line level signal has rising edge to produce, interruption can be triggered
Measure, the error produced when can reduce low discharge pulse measure, improve metering accuracy, expand
Measurement scope, improves Small flowrate measurement characteristic;Gather magnitude of voltage by AD and judge water meter and sensor
The states such as open circuit, short circuit, magnetic disturbance, provide complete active message-reporting water meter for Surveillance center of water undertaking
Remotely monitoring;Realize impedance matching by conditioning module and pulse signal is converted to level signal, making micro-control
Water meter state can be judged by device processed according to level signal;By removing interrupt flag bit, make next time
Interruption can be triggered during rising edge;By removing or having put A line index position, prevent repeat count.
The foregoing is only embodiments of the invention, not thereby limit the scope of the claims of the present invention, every profit
The equivalents made by description of the invention and accompanying drawing content, or directly or indirectly it is used in relevant technology
Field, is the most in like manner included in the scope of patent protection of the present invention.
Claims (10)
1. the water meter pulse signal metering method sampled based on interruption and AD, it is characterised in that including:
Sensor detection water meter, obtains A line pulse signal and B line pulse signal;
Microcontroller, according to described A line pulse signal and B line pulse signal, obtains the A line level letter of correspondence
Number and B line level signal;
Microcontroller is according to the detection cycle output high level signal preset;
When A line level signal is high level signal, microcontroller triggers and interrupts;
If A line level signal is high level signal first, then judge whether B line level signal is low level letter
Number;
If B line level signal is low level signal, then judge that described water meter rotates forward;
If B line level signal is high level signal, then judge that described water meter inverts;
Preserve the continuous data that described water meter rotates and reverse.
It is the most according to claim 1 based on interrupting and the water meter pulse signal metering method of AD sampling,
It is characterized in that, after described " microcontroller is according to the detection cycle output high level signal preset ", enter
One step includes:
Microcontroller according to described A line pulse signal and B line pulse signal, obtain correspondence A line voltage and
B line voltage;
If A line voltage is more than the open circuit threshold value preset, then judge A line open circuit;
If A line voltage is less than the short-circuit threshold value preset, then judge the short circuit of A line;
If B line voltage is more than the open circuit threshold value preset, then judge B line open circuit;
If B line voltage is less than the short-circuit threshold value preset, then judge the short circuit of B line;
If B line voltage is more than or equal to the first interference threshold preset and less than or equal to the second interference threshold preset,
Then it is determined that the presence of magnetic disturbance.
It is the most according to claim 1 based on interrupting and the water meter pulse signal metering method of AD sampling,
It is characterized in that, described ", according to described A line pulse signal and B line pulse signal, it is right to obtain for microcontroller
The A line level signal answered and B line level signal " particularly as follows:
Described A line pulse signal and B line pulse signal are sent to conditioning module by sensor;
Described A line pulse signal and B line shift pulse signal are corresponding A line level signal by conditioning module
Send to microcontroller with after B line level signal.
It is the most according to claim 1 based on interrupting and the water meter pulse signal metering method of AD sampling,
It is characterized in that, described " if A line level signal is high level signal first, then judge B line level signal
Whether it is low level signal " particularly as follows:
Judge that A line level signal is first for high level signal;
The most then close external interrupt and remove external interrupt flag bit;
Put A line low level flag bit first;
Remove A line high level flag bit first;
Judge whether B line level signal is low level signal.
It is the most according to claim 4 based on interrupting and the water meter pulse signal metering method of AD sampling,
It is characterized in that, described " when A line level signal is high level signal, microcontroller trigger interrupt " it
Before, farther include:
Judge whether A line level signal is high level signal;
If it is not, then judge that A line level signal is first for low level signal;
If A line level signal is low level signal first, opens external interrupt and remove external interrupt flag bit;
Remove A line low level flag bit first;
Put A line high level flag bit first.
6. the water meter pulse signal metering system sampled based on interruption and AD, it is characterised in that including:
First obtains module, detects water meter for sensor, obtains A line pulse signal and B line pulse signal;
Second obtains module, for microcontroller according to described A line pulse signal and B line pulse signal,
To corresponding A line level signal and B line level signal;
Output module, for microcontroller according to the detection cycle output high level signal preset;
Trigger module, for when A line level signal is high level signal, microcontroller triggers and interrupts;
First judge module, if being high level signal first for A line level signal, then judges B line level
Whether signal is low level signal;
First determination module, if being low level signal for B line level signal, then judges that described water meter rotates forward;
Second determination module, if being high level signal for B line level signal, then judges that described water meter inverts;
Preserve module, for preserving the continuous data that described water meter rotates and reverse.
It is the most according to claim 6 based on interrupting and the water meter pulse signal metering system of AD sampling,
It is characterized in that, also include:
3rd obtains module, for microcontroller according to described A line pulse signal and B line pulse signal,
To corresponding A line voltage and B line voltage;
3rd determination module, if for A line voltage more than the open circuit threshold value preset, then judges A line open circuit;
4th determination module, if for A line voltage less than the short-circuit threshold value preset, then judges the short circuit of A line;
5th determination module, if for B line voltage more than the open circuit threshold value preset, then judges B line open circuit;
6th determination module, if for B line voltage less than the short-circuit threshold value preset, then judges the short circuit of B line;
7th determination module, and if being less than or equal to more than or equal to the first interference threshold preset for B line voltage
The second interference threshold preset, then it is determined that the presence of magnetic disturbance.
It is the most according to claim 6 based on interrupting and the water meter pulse signal metering system of AD sampling,
It is characterized in that, described second obtains module includes:
Transmitting element, sends described A line pulse signal and B line pulse signal to nursing one's health mould for sensor
Block;
Conversion unit, is corresponding for conditioning module by described A line pulse signal and B line shift pulse signal
A line level signal and B line level signal after send to microcontroller.
It is the most according to claim 6 based on interrupting and the water meter pulse signal metering system of AD sampling,
It is characterized in that, described first judge module includes:
First judging unit, is used for judging that A line level signal is first for high level signal;
First clearing cell, for the most then closing external interrupt and removing external interrupt flag bit;
First has put unit, is used for having put A line low level flag bit first;
Second clearing cell, is used for removing A line high level flag bit first;
Second judging unit, is used for judging whether B line level signal is low level signal.
It is the most according to claim 9 based on interrupting and the water meter pulse signal metering system of AD sampling,
It is characterized in that, also include:
Second judge module, is used for judging whether A line level signal is high level signal;
3rd judge module, for if it is not, then judge that A line level signal is low level signal first;
First removes module, if being low level signal first for A line level signal, opens external interrupt also
Remove external interrupt flag bit;
Second removes module, is used for removing A line low level flag bit first;
First has put module, is used for having put A line high level flag bit first.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610177855.0A CN105841770B (en) | 2016-03-25 | 2016-03-25 | Based on the water meter pulse signal metering method and its system interrupted and AD is sampled |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610177855.0A CN105841770B (en) | 2016-03-25 | 2016-03-25 | Based on the water meter pulse signal metering method and its system interrupted and AD is sampled |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105841770A true CN105841770A (en) | 2016-08-10 |
CN105841770B CN105841770B (en) | 2019-01-22 |
Family
ID=56584555
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610177855.0A Active CN105841770B (en) | 2016-03-25 | 2016-03-25 | Based on the water meter pulse signal metering method and its system interrupted and AD is sampled |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105841770B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108151816A (en) * | 2016-12-06 | 2018-06-12 | 辽宁思凯科技股份有限公司 | A kind of magnetic passes electronic water meter and its metering method |
CN111964756A (en) * | 2020-07-23 | 2020-11-20 | 四川广安爱众股份有限公司 | Method for simultaneously improving pulse metering accuracy of water meter with low power consumption |
CN112729484A (en) * | 2020-12-24 | 2021-04-30 | 天信仪表集团有限公司 | Flow rate measuring circuit, flow rate measuring method, flow rate measuring device, gas correction instrument, and storage medium |
CN114047354A (en) * | 2021-10-20 | 2022-02-15 | 太原理工大学 | Rotating shaft state measuring device and measuring method |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH1183563A (en) * | 1997-09-01 | 1999-03-26 | Mitsubishi Electric Corp | Flowmeter |
CN2497280Y (en) * | 2001-09-14 | 2002-06-26 | 李顺爱 | Two-wire system pulse sampling apparatus |
WO2002084227A1 (en) * | 2001-04-13 | 2002-10-24 | Badger Meter, Inc. | Meter register with programmable meter pulse output resolution |
CN101614572A (en) * | 2008-06-25 | 2009-12-30 | 上海协霖电子有限公司 | A kind of acquisition method of pulse data of water meter |
CN104330119A (en) * | 2014-11-20 | 2015-02-04 | 福建智恒软件科技有限公司 | Intelligent electronic water meter and metering method thereof |
-
2016
- 2016-03-25 CN CN201610177855.0A patent/CN105841770B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH1183563A (en) * | 1997-09-01 | 1999-03-26 | Mitsubishi Electric Corp | Flowmeter |
WO2002084227A1 (en) * | 2001-04-13 | 2002-10-24 | Badger Meter, Inc. | Meter register with programmable meter pulse output resolution |
CN2497280Y (en) * | 2001-09-14 | 2002-06-26 | 李顺爱 | Two-wire system pulse sampling apparatus |
CN101614572A (en) * | 2008-06-25 | 2009-12-30 | 上海协霖电子有限公司 | A kind of acquisition method of pulse data of water meter |
CN104330119A (en) * | 2014-11-20 | 2015-02-04 | 福建智恒软件科技有限公司 | Intelligent electronic water meter and metering method thereof |
Non-Patent Citations (2)
Title |
---|
吴雅楠 等: "基于MSP430单片机的网络智能电子水表的设计", 《自动化仪表》 * |
张在新,孔繁军: "基于nRF905的无线水表自动抄表系统设计", 《电子设计工程》 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108151816A (en) * | 2016-12-06 | 2018-06-12 | 辽宁思凯科技股份有限公司 | A kind of magnetic passes electronic water meter and its metering method |
CN111964756A (en) * | 2020-07-23 | 2020-11-20 | 四川广安爱众股份有限公司 | Method for simultaneously improving pulse metering accuracy of water meter with low power consumption |
CN112729484A (en) * | 2020-12-24 | 2021-04-30 | 天信仪表集团有限公司 | Flow rate measuring circuit, flow rate measuring method, flow rate measuring device, gas correction instrument, and storage medium |
CN114047354A (en) * | 2021-10-20 | 2022-02-15 | 太原理工大学 | Rotating shaft state measuring device and measuring method |
Also Published As
Publication number | Publication date |
---|---|
CN105841770B (en) | 2019-01-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105841770A (en) | Water meter pulse signal metering method and system based on interruption and AD sampling | |
CN201945387U (en) | Distribution type multipoint temperature humidity detecting system based on PICI6F876A singlechip | |
CN203587694U (en) | Test circuit for resistance and time sequence of initiating explosive device | |
CN202915962U (en) | Water meter data collector | |
CN103954861A (en) | Double-way USB load insertion detecting device | |
CN105318918A (en) | A non-magnetic flow metering device and a metering method thereof | |
CN104122814B (en) | Switch acquisition transition detection circuitry and detection method thereof | |
CN102809725B (en) | Sensitive element device for bypass signal of sensing circuit and detection method of sensitive element device | |
CN205426249U (en) | Water gauge pulse signal measurement system based on suspend and AD sampling | |
CN202007662U (en) | Direct-reading double temperature probe compensation pressure instrument | |
CN109343157B (en) | Accurate rainfall telemetering terminal | |
CN204099914U (en) | Intelligent Pipe Leak Detection Instrument | |
CN103267519A (en) | Hydrographic measurement system with wireless transmission function and measurement method | |
CN207502010U (en) | Inside is equipped with the intellectual water meter of two-way detection sensor component | |
CN206657451U (en) | door sensor sensing device | |
CN207457322U (en) | A kind of electric energy meter | |
CN209248053U (en) | Counting circuit device for tipping bucket rain gauge | |
CN202041275U (en) | Device for detecting and recording shell opening time in real time | |
CN205691645U (en) | A kind of signal detection system | |
CN101710128A (en) | Device for testing rotating speed of automobile engine | |
CN109425636A (en) | Four sections of soil moisture detection sensors based on TDR mode | |
CN103868617A (en) | Platinum resistor temperature measuring circuit | |
CN211230431U (en) | Distributed underground data acquisition system | |
CN103823116A (en) | Self-checking type precision battery internal resistance instrument | |
WO2015142143A1 (en) | Capacitive water level detection circuit |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |