A kind of Modular Data registering instrument and method of work based on the Zigbee wireless telecommunications
Technical field
The present invention relates to a kind of datalogger, relate in particular to the Modular Data registering instrument that adopts Wireless Data Transmission.
Background technology
At present, traditional datalogger mainly is made of digital circuit board and analog circuit board two parts, and these two parts are the monoblock board structure of circuit, and digital circuit board is connected with analog circuit board with the communication cable connection, and its defective is; 1, Function Extension is very inconvenient, often needs to change the monoblock circuit board during function upgrading; 2, the degree of modularity is not high, needs the dedicated tunnel number when user purchases, and it is very inconvenient that later stage upgrading and function increase; 3, do not support wireless transmission, that pickup wire need be extended when carrying out Distance Test is very long, causes measuring accuracy and reliability all to reduce.
" Zigbee " is a kind of brand-new radio network data communication technology, be one by a wireless data sending network platform that can how form to 65000 wireless data transmission modules, the CDMA net of similar existing mobile communication or GSM net, the similar mobile network's of each Zigbee network data module a base station, starlike, sheet and mesh network topology are arranged, in whole network range, can intercom mutually between them; Distance between each network node can from 75 meters of standard, arrive the hundreds of rice after expanding, even several kilometers; Whole Zigbee network can also be connected with existing other diverse network in addition, and Zigbee has following characteristics: 1, low-power consumption is fit to powered battery.2, low cost, communications protocol is simple, and frequency range is exempted from license.3, communication speed is 20~250kpbs, is fit to signals collecting.4, safe and reliable, adopt three level security patterns.
Summary of the invention
The objective of the invention is to utilize the advantage of existing ZigBee technology wireless transmission, overcome the deficiency that available data recorder module degree is low, measuring distance is short and a kind of Modular Data registering instrument based on the Zigbee wireless telecommunications is provided.
Another object of the present invention is to provide the method for work of this Modular Data record, but realizes the complete modularization expanded of datalogger and the long distance data acquisition of facilitation.
The technical scheme that Modular Data registering instrument of the present invention adopts is: comprise host module, host node module and some from node module, host module connects the host node module, the host node module respectively with from node module by wireless connections, jointly form star-like wireless network topology structure.
the method of work of Modular Data registering instrument of the present invention comprises: host module is set to configure each from the function of node module, host module arranges data message with this and sends to the host node module, the host node module by a Zigbee wireless communication module and a transmit receive antenna wireless transmission send to appointment from node module, receive from node module and as requested test is configured after these arrange data message, signal to passage gathers and calculates, result is sent to the host node module by the 2nd Zigbee wireless communication module and another transmit receive antenna, the host node module is saved to EEPROM with data after receiving, send to host module when host module is idle,
The physical address from node module by host module man-machine interface input expanding or deletion, and physical address and order are sent to the host node module, after the host node module receives, order is broadcast to each online from node module, respond if there is the physical address of node to be complementary with it, the host node module receives that response is with physical address interpolation or deletion from node module;
When using the external application power supply, battery management circuit is powered to mimic channel, low-power scm and Zigbee wireless communication module by the battery charging inlet, simultaneously to lithium cell charging; When not using externally fed, battery management circuit is enabled lithium battery power supply, and carries out supplying with mimic channel, low-power scm, Zigbee wireless communication module after voltage transitions;
If from node module acquisition module image data and transfer data to the host node module, if transmitting module or alarm module are carried out the instruction that the host node module sends.
The invention has the beneficial effects as follows:
1, data acquisition realizes modularization, and whole instrument system comprises a primary module and some from module.Primary module is realized data are kept in as host node on the one hand, realizes on the other hand can being acquisition module, transmitting module or alarm module to being configured from node from module.
2, system extension and upgrading are convenient, and the node capacity of Zigbee is large, and the node expansion is convenient, if system will insert new module, can directly increase or deletion of node by host node is configured.
3, realize portability, acquisition module uses the high-capacity lithium battery power supply, because the power consumption of Zigbee is smaller, add the use of the relatively very little and low-power scm of the power consumption of data acquisition circuit, disposable can be for module work tens days after being full of electricity, only need carry individual acquisition module card just can carry out data acquisition in the valid wireless communication context.
4, need not complicated wiring and power supply when the system of establishment, transmission becomes more reliable.
Description of drawings
Fig. 1 is structure composition diagram of the present invention;
Fig. 2 is the structure composition diagram of host module 1 in Fig. 1;
Fig. 3 is the structure composition diagram of host node module 2 in Fig. 1;
Fig. 4 is single structure composition diagram from node module in Fig. 1;
Fig. 5 is the method flow diagram that in Fig. 1, host node module 2 increases from node module;
Fig. 6 is the method flow diagram that in Fig. 1, host node module 2 is deleted from node module.
Embodiment
As shown in Figure 1, whole datalogger comprise host module 1, host node module 2 and other several from node module 3 ... n.Host module 1 connects host node module 2, host node module 2 respectively with from node module 3, from node module 4, from node module 5, from node module 6, from node module n by wireless connections.Host module 1, host node module 2 and several are from node module 3 ... the star-like wireless network topology structure of the common composition of n.
The composition of host module 1 such as Fig. 2, host module 1 comprises arm processor 20, arm processor 20 is connected with LCDs 19, keyboard 24, USB flash disk interface 21, Ethernet interface 22, SPI (synchronous serial bus) host interface 23 respectively.Host module 1 is mainly realized human interface function, data hold function, data operation function, is controlled function and Ethernet interface function, and the control of these calculation functions and peripheral hardware is all to be realized by arm processor 20.When carrying out without the paper data recording, send to host module 1 after data process host node module 2 transfers that all acquisition modules collect, host module 1 can deposit data in USB flash disk by USB flash disk interface 21 according to customer requirements, also can data be uploaded PC or miscellaneous equipment by Ethernet interface 22 according to customer requirements.LCDs 19 is used for showing data or some parameters that collects, and while and keyboard 24 have formed man-machine interface and arranged for the user, can be to each from node module 3 by host node module 2 ... the node of n carries out functional configuration.
The composition of host node module 2 as shown in Figure 3, mainly formed by single-chip microcomputer 16, EEPROM15, SPI slave interface 14 and a Zigbee wireless communication module 17, single-chip microcomputer 16 connects respectively EEPROM (electric read-write non-volatile reservoir) 15, Zigbee wireless communication module 17 and SPI slave interface 14, and Zigbee wireless communication module 17 is connected with a transmit receive antenna 18 of host node module 2 inside.Single-chip microcomputer 16 is connected by the SPI host interface 23 of SPI slave interface 14 and host module 1, and host module 1 carries out communication.By Zigbee wireless communication module 17 with from node module 3 ... n carries out communication.While single-chip microcomputer 16 use EEPROM15 set up storehouse data are carried out buffer memory, play coordinative role when communication.Transmit receive antenna 18 plays and strengthens signal and the effect of transmitting of receiving.
Each is from node module 3 ... the composition of n as shown in Figure 4, from node module module 3 ... n mainly is comprised of battery management circuit 10, mimic channel 9, low-power scm 11, the 2nd Zigbee wireless communication module 12.Battery management circuit 10 is connected with lithium battery 7, battery charging inlet 8 respectively, simultaneously battery management circuit 10 and mimic channel 9, low-power consumption monolithic connect 11, Zigbee wireless communication module 12 is connected, and Zigbee wireless communication module 12 and this are connected from the transmit receive antenna 13 of node module inside.Battery management circuit 10 carries out Charge Management to battery when charging, when powered battery, battery supply is carried out voltage transitions and other circuit is powered, and monitors simultaneously battery electric quantity.Low-power scm 11 major functions are that mimic channel is controlled and the data that collect are carried out computing, monitor battery electric quantity information, carried out communication by Zigbee wireless communication module 12 and host node module 2.Transmit receive antenna 12 plays and strengthens signal and the effect of transmitting of receiving.The difference of the kind of mimic channel 9 can be acquisition module, transmitting module or alarm module.Acquisition module is the data collecting card of a 8 passages, and input signal can be that various thermocouple signals, thermal resistance signal, 4~20mA electric current fieldbus signal can be also 0~5V voltage fieldbus signal or 0~10kHz frequency signal.Transmitting module is a functional module that sensor signal is become the fieldbus signal that send into 4~20mA electric current or 0~5V voltage signal.When the user need to send into fieldbus signal with certain sensor signal change, host module 1 obtains specifying by host node module 2 after the sensor signal of the dedicated tunnel on acquisition module by sending instruction after computing to host node module 2, also will be wirelessly sent to the transmitting module of appointment by 2 transfers of host node module, transmitting module is according to the corresponding fieldbus signal curtage of instruction output that receives.The alarm module function is by certain signal that gathers the road is monitored, in case find that this signal exceeds host module 1 and sets scope, just control open or closed module on relay, host module 1 sends instruction to host node module 2 obtain specifying the sensor signal of the dedicated tunnel on acquisition module by host node module 2 after after setting upper lower limit value with the user, by 2 transfers of host node module and will be wirelessly sent to the alarm module of appointment.
For realize complete wireless penetration and realize portable, from node module 3 ... n supports powered battery.When using the external application power supply, battery management circuit 10 by 8 pairs of mimic channels 9 of battery charging inlet, low-power consumption monolithic connect 11, Zigbee wireless communication module 12 powers, simultaneously lithium battery 7 is charged.When not using externally fed, battery management circuit 10 is enabled lithium battery 7 power supply, and carries out supplying with after voltage transitions that mimic channel 9, low-power consumption monolithic connect 11, Zigbee wireless communication module 12 modules.Mimic channel 9 has adopted a large amount of low energy-consumption electronic devices, the low-power consumption monolithic connects 11 and adopts the MSP430 series low-power scm of Texas Instrument, working current is below 1mA, the power consumption of Zigbee module under the sending/receiving formula is only also tens milliamperes, add the sleep mode that this module possesses, only need just to wake up when enabling transmission, therefore the average power consumption of whole node module can be controlled in ten milliamperes.When lithium battery 7 adopted the lithium battery of 4.2 volt of 5000 MAH, this module can continuous working more than 20 days.When battery electric quantity descends, can cross by the wireless transmission information exchange that electric weight is too low from node module and be given to host module 1 host node module 2, can the prompting user after host module 1 is received.
Zigbee wireless communication module 17 and the Zigbee wireless communication module 12 in Fig. 4 in Fig. 3 are same modular circuits, the core of this modular circuit is a radio frequency chip, its function is the serial ports asynchronous communication to be changed into meet 802.15.4 (the 802.15.4 agreement is the official standard that meets ieee specification, mainly apply to the low-speed wireless personal area network) wireless telecommunications of agreement, it works in 2.4G and exempts to authorize frequency range, supports 16 channels that peak transfer rate is 250kbps.This module has very low power consumption, has simultaneously park mode and therefore is very suitable for battery power supply system.
Whole wireless network topology structure in Fig. 1 adopts star-like connection, host node module 2 plays telegon and controller in whole network, to from node module 3 ... n carries out functional configuration and control, simultaneously will be from node module 3 ... the data that n collects are temporarily stored in jumbo outside EEPROM15, and transfer data to host module 1 when host module 1 is idle.1 pair of host node module 2 of host module sends to host node module 2 with order when arranging, and is wirelessly sent to each from node module 3 through its transfer ... n.From node module 3 ... n if acquisition module mainly be responsible for image data and transfer data to host node module 2, if individual transmitting module or alarm module are carried out the instruction that host node module 2 sends over.Host node module 2 is connected with host module to connect by SPI and is carried out high-speed bidirectional communication, and the power supply of host node module 2 is provided by host module 1.All networkings (each physical address from node module is unique from the node physical address, be stored in the EEPROM from the single-chip microcomputer of node module) be stored in 15 li of the EEPROM of host node module 2, these physical addresss and data composition data bag together when communication.
Also mainly completed by host node module 2 from the dilatation of node.When whole system need to be expanded, flow process such as Fig. 5: the physical address from node module that the user will expand by host module 1 man-machine interface input, and physical address and order are issued host node module 2 together, after host node module 2 receives, order is broadcast to each online from node module 3 ... n, if there is the physical address of node to be complementary with it, respond, host node module 2 receives that response adds this physical address from node module in address list to.
when whole system need to be deleted, flow process such as Fig. 6: the physical address from node module that the user will delete by host module 1 man-machine interface input, and physical address and order are issued host node module 2 together, broadcast to each after ordering after host node module 2 receives online from node module 3 ... n, if there is the physical address of node to be complementary with it, respond, host node module 2 receives that response was with should delete from the address of node module in address list, host node module 2 no longer should be included communication context in from node, namely spin off in network.
Workflow of the present invention is as follows: the user is by configuring each from node module 3 to host module 1 is set ... the function of n, as arrange data sample rate, arrange the sampling which kind of sensor signal, enable several passages etc.Host module 1 arranges data message with these and sends to host node module 2 by spi bus, 2 of host node modules with these order datas by a Zigbee wireless communication module 17 and transmit receive antenna 18 wireless transmission send to appointment from node module 3 ... n.From node module 3 ... n receives and can be configured test according to customer requirements after these arrange data message.after configuration is completed, should be from node module 3 ... n begins the signal of passage is gathered and calculates, result is sent to host node module 2 by the 2nd Zigbee wireless communication module 12 and transmit receive antenna 13, host node module 2 can first be saved in data in EEPROM15 after receiving these data, send to together host module 11 free time of host module, if data recording function is opened, host module 1 is recorded in USB flash disk with data, these data messages are by a structure array, comprise temporal information for a structure, test result, sensor type, test channel number.If from node module 3 ... n is transmitting module or alarm module, host module 1 can be rerun test result, with result by host node module 2 send to formulation from node module 3 ... n allows these from node module 3 ... warning message or the change number of delivering letters that n output is correct.