A kind of intelligent telemetering water meter based on wireless sensor network
The present invention relates to wireless sensor network technology, data collecting field, relate in particular to a kind of intelligent water consumption measurement and distant kilowatt meter recorder based on wireless sensor network technology.
Wireless sensor network (Wireless Sensor Network, be called for short WSN) is considered to one of most important technology of 21 century, is the numerous sensor mode by radio communication, connects each other, handles, transmits the network of information.This network synthesis sensor technology, embedded computing technique, distributed information processing and the communication technology, the various environment in monitoring in real time, perception and the collection network distributed areas or the information of monitoring target, and these information are handled, send required user to.Wireless sensor network all has purposes widely in military affairs, industry, traffic, safety, medical treatment, detection and family and working environment etc. aspect a lot, its research, development and application, be related to each great aspects such as national security, economic development, caused in the world in recent years and paid attention to widely and drop into.
(Wireless Sensor Network, WSN) structure as shown in Figure 1 for wireless sensor network.Sensor node is distributed in the various piece of network, is used to collect data, and data are routed to base station (also claiming the information gathering node).Base station and information processing node communicate by Wide Area Network (as Internet network or satellite network), thereby the data of collecting are handled.
Far checking meter is a kind of convenience-for-people system, system has comprised that water, electricity, gas automatic data logging and family's gas leakage preventing and administrative authority carry out multiple functions such as real-time break-make control to user's water, electricity consumption, with gas, as the important component part of modern management system, this system has brought into play considerable effect.Teletransmission is checked meter principle as shown in Figure 2.Remote meter reading is still continued to use wire transmission mode mostly at present.Adopt the remote meter reading transmission quality of private-line mode good, but cost of investment is very high, and the line upkeep amount is very big.It mostly is that intensive style is checked meter that minority adopts the scheme of wireless long-distance meter-reading, needs artificial execute-in-place, because number of base stations is bigger, the cost of input is higher, and can not realize real-time data acquisition and monitoring.
Summary of the invention
The present invention is directed to above-mentioned prior art problems and weak point, proposed a intelligent telemetering water meter, and realize the long-range method of making a copy for and monitoring of intellectual water meter based on wireless sensor network technology.
The present invention is achieved in that
A kind of intelligent telemetering water meter based on wireless sensor network, this equipment comprises: radio receiving transmitting module, microprocessor module, power management module (containing supply voltage detects), water parameter acquisition module, memory module, universal external interface module, LCD MODULE.These unit have constituted intelligent telemetering water meter.
Radio receiving transmitting module is used for receiving and sending radiofrequency signal;
Microprocessor module is used to finish data processing and logical operation on the node;
Power management module (contain supply voltage detect) is provided by the energy that provides node required and voltage detecting and early warning;
Water parameter acquisition module is used to gather parameters such as water consumption, water quality;
Memory module is used for storage of collected gained data and local water meter information and state parameter;
The universal external interface module is used to provide the interface of external logic module and microprocessor;
LCD MODULE is used for explicit user water consumption and other information.
Preferably, described microprocessor module adopts MSP430F149.Described power management module adopts MAX708S.Described memory module adopts EERPOM, is erasable storer.Described LCD MODULE adopts LCD, a serial display module.Described radio receiving transmitting module adopts the CC2420 chip.
As shown in Figure 3, Fig. 3 is the structural drawing of water meter.The center processing unit of system is MSP430F149, at first sends protocol command by serial ports on the substrate of water meter, data of water meter that the base table that reads back collects and water meter address and water meter ID.Simultaneously, can also gather battery electric quantity by the built-in A/D of MSP430F149 in real time.Then can be with the data of water meter that collects, all kinds of state variables such as battery data and valve send to CC2420 by spi bus, and each node is forwarded to the base station again with data and focuses on.
IMP809 is the chip that resets in the block diagram, and the system of can be provides reliable reset signal.MAX708S is a voltage checking chip, guarantees that when level is lower than certain value be to produce an interruption, is handled by single-chip microcomputer.EERPOM is an erasable storer, is used for storage system information.LCD is a serial display module, uses when being convenient to debug.Field effect transistor, is turn-offed field effect transistor when not needing to gather data of water meter as the power switch that is communicated with base table, when reading of data, allows the instantaneous conducting of field effect transistor, has so just guaranteed the requirement of reduction power consumption.
Each water meter equipment is as a terminal node of gathering and monitoring.The present invention take all factors into consideration object, user's distribution, number of users, geographical conditions, expectation that system faces reach with target and the expansion upgrading of system and with the factors such as compatibility of other networks, preferably, the employing wireless sensor network is realized remote data transmission and is supported the ZigBee agreement.Designed a kind of mechanism of supporting remote-code-update, program that can long-range replacing water meter.
Preferably, adopt a kind of water yield acquisition method of supporting photo-electronic directly reading, guaranteed the consistance of image data.The water supplemental characteristic can be supported initiatively and passive dual mode sends.
Preferably, be provided with a power down protection mechanism, can be in the moment of power down, the data in memory protection this locality and the forwarding.Be provided with the electric power controller of photo-electronic directly reading module, can be by instantaneous power supply to the photo-electronic directly reading module, reading of data realizes the low-power consumption purpose rapidly.
Preferably, designed the intellectual water meter function of supporting local prepayment mode.
Preferably, designed tamper-proof function, can when finding destruction, send alerting signal to long-distance management system.Adopt the both-way communication mode, realize Long-distance Control, comprise out valve, close valve, warning etc. local water meter.
From technique scheme as can be seen, the intelligent telemetering water meter equipment based on wireless sensor network provided by the invention has important effect for the research and the product development of wireless sensor network technology.The present invention utilizes the remote meter reading that carries out of wireless sensor network technology, has improved reliability greatly.Than existing radio meter register technology, possess higher redundance, data can be transmitted by mulitpath.Saving comprises the cost of manpower, has replaced intensive checking meter.Meanwhile improved electricity consumption service management level.Timely grasp by for the user power utilization situation for preventing professional leaks such as stealing, electricity use based on human relationships, provides system and technical foundation.And gathered more power consumption parameter information, as: reactive power, active power, power factor etc., realize more senior service management function.Improved the security of communication greatly.Adopted world advanced person's data network communication security technology.Realize more complicated electricity consumption charging policy, helped promoting energy-conservation motion.As ladder electricity price, time-of-use tariffs etc.Has higher extensibility.The renewal of system can be passed through the long-range realization of software fully, and need not to change ammeter.Support intelligent water leakage monitoring and warning function.For the specific aqueous mode of using, judge and distinguish normal water with leak.
Description of drawings
Below in conjunction with accompanying drawing the present invention is made a detailed description.
Fig. 1 is the wireless sensor network structural drawing
Fig. 2 is the teletransmission schematic diagram of checking meter
Fig. 3 is for the invention provides water meter structure figure
Fig. 4 is an interaction figure between the module provided by the invention
Fig. 5 is Msp430 processor each several part figure provided by the invention
Fig. 6 is CC2420 partial circuit figure provided by the invention
For making the purpose, technical solutions and advantages of the present invention clearer,, structure based on the intelligent telemetering water meter of wireless sensor network of the present invention is further described below in conjunction with specific embodiment based on water meter structure figure shown in Figure 3.
Typical wireless sensor network structural drawing provided by the invention is referring to shown in Figure 1.
As shown in Figure 4, Fig. 4 is an interaction figure between the module provided by the invention.System mainly is divided into three parts:
The one, essentic-water-meter part of data acquisition, the 2nd, MSP430F149 single-chip microcomputer CPU (central processing unit), the 3rd, CC2420 data wireless data transmit-receive part.
First: the base table of water meter inside adopts the direct water-meter reading counter of the mode window numerical value of photo-electronic directly reading, does not adopt the pulse signal acquisition circuit, has reduced the failure rate of water meter.
Second portion: the function that 430 single-chip datas are handled and data transmit-receive is mainly finished comprises:
1. serial communication is gathered the base table data, and single-chip microcomputer will communicate by serial ports and water meter internal base plate, sends a strings of commands to substrate, returns a string data by substrate again, wherein receives the data that send and all should meet the data protocol that has provided.
2. the parsing of data: by data protocol, will parse the concrete numerical value gathered of water meter, information such as water meter address ID number.
3. basic motor operation, the switch of by-pass valve control, and can obtain the concrete state of valve by tooth case signal wire.
4. prevent the dismounting of circuit, the tamper signal wire of drawing by water meter triggers an interruption to 430 single-chip microcomputers, is handled by single-chip microcomputer.
5. pass through the SPI mouth with data, state, information such as address send to radio receiving transmitting module CC2420.
Third part: CC2420 is the radio transmitting and receiving chip of Chipcon company at a compatible 2.4GHZ IEEE802.15.4 of release in the end of the year 2003.CC2420 has fully-integrated voltage controlled oscillator, only needs antenna, and considerably less peripheral circuits such as 16MHZ crystal just can be worked on the 2.4GHZ frequency range.CC2420 only provides a SPI interface to be connected with microprocessor, finishes the task of setting and transceive data two aspects by this interface.
As shown in Figure 5, Fig. 5 is Msp430 processor each several part figure provided by the invention.
● the serial ports part: the P3.4TXD data sending terminal on the msp430 links to each other with the serial data receiving end of base table, and the P3.5RXD data receiver links to each other with the serial data transmitting terminal of base table.According to water meter communication protocol, msp430 sends instruction to serial ports, and the water meter substrate is resolved instruction, returns the data message (as discharge) that collects by serial ports to single-chip microcomputer, and wherein data message is to transmit according to the mode of communication protocol.
● the motor-driven part: the P5.1 on the msp430 is connected with figure below H bridge-type motor-drive circuit as two common I/O mouths with P5.0, and the output terminal of driving circuit is connected with the motor lines that base table is drawn, the rotating and reverse of drive motor.When the P5.1 of single-chip microcomputer output high level, during the P5.0 output low level, Q1, Q3, the Q5 conducting, the OUTA output low level, OUTB exports high level.Can drive valve by drive motor.When the P5.1 of single-chip microcomputer output low level, during P5.0 output high level, Q2, Q4, the Q6 conducting, OUTA exports high level, OUTB output low level.Can close valve by drive motor.
● AD battery electric quantity collecting part: the P6.0 on the msp430 is the analog input end of battery electric quantity, battery is received P6.0 by a bleeder circuit, because the reference voltage of the AD converter of msp430 inside is 2.5V, so bleeder circuit should play the effect that full battery electric quantity is divided to 2.5V, but consider the low-power consumption of system, should use million grades of resistance on the bleeder circuit, therefore can not ignore the internal resistance of msp430 single-chip microcomputer IO mouth, the AD acquisition module by 430 inside converts the respective digital amount to then.
● tooth case signal section: the P3.6 on the msp430, P3.7 directly links to each other with the tooth case signal wire of base table, and when the P3.6 high level, the P3.7 low level shows that valve closes fully, on the contrary when the P3.7 high level, the P3.6 low level shows that valve opens fully.Thereby fed back the duty of valve.When valve state need be understood in the upper strata, single-chip microcomputer detected the level of P3.6 and P3.7 and determines that state sends to the upper strata.
● the tamper part: the P2.7 on the msp430 is connected with anti-the taking out stitches of base table with P4.3.Wherein defining P2.7 is FCOUT, and it is put 1, and definition P4.3 is FCIN.Split when water meter, prevent taking out stitches connections for two, FCIN just becomes high level by low level, and rising edge triggers and interrupts.
● cut the electric switch part: the P5.3 on the msp430 as control end with cut electric switch MOSFET2SJ206 and be connected.In the time will gathering the base table data, metal-oxide-semiconductor UNICOM is to base table power supply, image data; Otherwise metal-oxide-semiconductor disconnects, to reduce system power dissipation.
● SPI part (with the CC2420 coupling part): the P3.1SIMO0 on the msp430, P3.2SOMI0, P3.3SCLK, P4.0CSN is connected with the respective pins of CC2420 as the connection line of SPI, guarantees the correct transmitting-receiving by the spi bus data.P1.2FIFO on the msp430, P1.3FIFOP, P1.4CCA, P4.1SFD is connected with CC2420 as the control line of CC2420.P4.6VREGEN on the msp430 can enable the reference voltage of CC2420, and the reset terminal that P4.5RST can be used as CC2420 is connected with CC2420.
As shown in Figure 6, Fig. 6 is CC2420 partial circuit figure provided by the invention.
Among the figure, CSn, SI, SO, SCLK are 4 lines of spi bus, are connected on the SPI interface of microcontroller, and the CSn low level is effective, and SO is high-impedance state when for high level.CSn answers external pull-up resistor, perhaps puts high to prevent input drift when the builtin voltage adjuster is forbidden.SI, the level that SCLK should be set to determine prevents input drift, so SI, SO, SCLK should external pull-up resistors.
FIFO, FIFOP, CCA, SFD are four control pins, and wherein, FIFO, FIFOP receive to send the buffer state pin, and CCA removes the channel estimating pin, and SFD provides temporal information.
Other two control lines that need link to each other with single-chip microcomputer are: VREG_EN and RESET.
Each control line is described below table:
||Driving this signal is the voltage adjuster that high level is used to enable CC2420
||Pulse signal (low level is effective) is used to the CC2420 that resets
||When having at least a byte not to be read out in RX FIFO, this signal is a high level.After last byte was read, signal became low level.
||When the data byte of not reading in RX FIFO surpasses the value of IOCFG_FIFOP_THR setting (being defaulted as 64 bytes), this signal becomes high level.
||After being received an of complete data packet, also can uprise, even the length of bag is less than predetermined value.In this case, after data were read from FIFO, this signal became low level
||In receiving course, SFD becomes high level after being checked through effective start frame separation, becomes low level after whole packet is received.At process of transmitting, the SFD signal becomes high level after SFD is transmitted, and whole packet has passed and become low level immediately
||Under accepting state, as long as CC2420 is through 8 symbol periods, if do not have data CCA signal to become high level in the channel otherwise be low level.
It is as shown in the table wherein specifically to connect situation:
|31 pin CSn
|32 pin SCLK
||P3.3 pin UCLK
|33 pin SI
||P3.2 pin SOMI0
|34 pin SO
||P3.1 pin SIMO0
|41 pin VREG_EN
|21 pin RST
|27 pin SFD
|28 pin CCA
|29 pin FIFOP
|30 pin FIFO
Above-described specific embodiment; purpose of the present invention, technical scheme and beneficial effect are further described; institute is understood that; the above only is specific embodiments of the invention; be not limited to the present invention; within the spirit and principles in the present invention all, any modification of being made, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.