A kind of meter reading repeater based on LORA communications
Technical field
The utility model is related to meter reading repeater fields, more particularly to a kind of meter reading relaying based on LORA communications
Device.
Background technology
Repeater is a kind of connection network line device, is usually used in the two-way converting of physical signal between two network nodes
Work.Repeater mainly completes the function of physical layer, is responsible for the step-by-step in the physical layer of two nodes and transmits information, completes signal
Duplication, adjustment and enlarging function, extend the length of network with this.It is lost due to existing, the signal work(transmitted on the line
Rate can gradually decay, decaying to a certain extent when will cause distorted signals, therefore can cause receive mistake, therefore how so that in
It is in preferable working condition for a long time after device, and reduces the emphasis of energy consumption researcher's concern always of repeater.
With the fast development in city and the Large-scale Migration of population, city high residential building scale is more and more, is located at
The quantity of the water meter of different floor heights sharply increases, when manual metering is in face of huge and dispersion water meter system, it is difficult to ensure that in time,
Accurately or effective meter reading, to solve the above-mentioned problems, it will usually which long-range water meter reading system, traditional long-range water meter are set
Kilowatt meter reading-out system is generally made of table body and concentrator, usual table body at a distance from concentrator in 10KM can normal meter reading, surpass
Go out this distance, because transmission power is inadequate, signal decaying is fast, if having barrier obstruction, will be unable between table body and concentrator
Communication.
Chinese patent literature publication number CN201035720U discloses a kind of wireless remote two-way real-time meter reading system, including
The concentrator being connected with control centre by M-BUS buses and the wireless transmission acquisition terminal being battery powered, in the collection
It is equipped with the repeater being associated by wireless signal between middle device and wireless transmission acquisition terminal.This wireless remote is two-way in real time
Kilowatt meter reading-out system can extend the communication distance between table body and concentrator by repeater, but its repeater energy consumption is higher, it is difficult to
Preferable working condition is kept for a long time.
Utility model content
In order to overcome the deficiencies of existing technologies, the technical problem to be solved by the utility model is to propose that one kind is based on
The meter reading repeater control method of LORA communications when in running order, have signal that is strong and stablizing, is in off working state
When, system is run in the state of super low-power consumption, and energy consumption is extremely low and easy to maintain.
For this purpose, the utility model uses following technical scheme:
Based on the meter reading repeater of LORA communications, including MCU control module, wireless frequency expansion module, receiving circuit, transmitting electricity
Road, analog switch and antenna, the MCU control module are electrically connected with the wireless frequency expansion module by SPI interface, the nothing
Line spread spectrum module is electrically connected with the receiving circuit, the radiating circuit, and the receiving circuit is electrically connected with the analog switch,
The radiating circuit is electrically connected with the analog switch, and the analog switch is electrically connected with the antenna;When the meter reading relays
When device receives data, the analog switch connects the wireless frequency expansion module, the receiving circuit and the antenna;Work as institute
When stating meter reading repeater transmission data, the analog switch is by the wireless frequency expansion module, the radiating circuit and the day
Line is connected.
Preferably, the MCU control module is internally provided with AWU modules, described in the AWU modules wake up every 1S
MCU control module after the MCU control module is waken up, inquires whether the wireless frequency expansion module detects effective lead code,
If detecting effective lead code, the AWU modules are converted to reception pattern, start to receive signal.
Preferably, the wireless frequency expansion module is configured to SX1278 modules, and the SX1278 modules carry out long-range with PC machine
Communication, the PC machine can change the messaging parameter of SX1278 modules, and the messaging parameter includes transmission frequency, spreading factor, band
Wide power and transmission power.
Preferably, the operating mode of the SX1278 modules includes sleep pattern, standby mode, CAD patterns, receives mould
Formula and sending mode;When the SX1278 modules are in sleep pattern, the current consumption of the SX1278 modules is
0.1uA/h;When the SX1278 modules are in sending mode, the SX1278 modules are led to using uplink agreement
Letter;When the SX1278 modules in a receive mode when, the SX1278 modules are communicated using downlink transfer agreement.
Preferably, further include power module, the power module and the MCU control module and the wireless frequency expansion module
Electrical connection.The power module includes low pressure difference linear voltage regulator and lithium battery, and the voltage of the lithium battery is configured to 3.6V, electricity
Capacity configuration is 3000mAh, and the low pressure difference linear voltage regulator is connect with the lithium battery.
The beneficial effects of the utility model are:
The utility model is when repeater is not detected and receives signal, the main energy-consuming parts of repeater, such as:MCU is controlled
Module and wireless frequency expansion module are in sleep state, are only called by CAD and wake up MCU controls when needed with interrupt mode
Molding block and wireless frequency expansion module etc. can be in low energy consumption state this guarantees repeater, only copy for a long time
Transmitting-receiving and the transfer processing of data are carried out during table or data transmission.This has just been effectively ensured when repeater is in work shape
When state, MCU control module and wireless frequency expansion module can wake up processing and send out signal that is strong and stablizing in time;In inoperative shape
When state, system is run in the state for extended periods of super low-power consumption.
Description of the drawings
Fig. 1 is the flow of the meter reading repeater control method for the LORA communications that specific embodiment of the present invention provides
Figure;
Fig. 2 is the flow chart of the overflow detection method for the memory that specific embodiment of the present invention provides;
Fig. 3 is the circuit controling drawing for the meter reading repeater that specific embodiment of the present invention provides.
In figure:
1, MCU control module;2, wireless frequency expansion module;3, receiving circuit;4, radiating circuit;5, analog switch;6, antenna;
11, AWU modules;7, power module.
Specific implementation mode
Further illustrate the technical solution of the utility model below with reference to the accompanying drawings and specific embodiments.
Embodiment one:
As shown in Figure 1, the meter reading repeater control method communicated based on LORA provided in embodiment, real as follows
It applies:
Step S00:Repeater powers on, repeater system initialization, by system initialization process by variable and control tune
Whole is default value, and repeater starts to work normally after system initialization.
Step S10:MCU control module 1, wireless frequency expansion module 2 inside repeater enter sleep pattern.MCU is controlled
Module 1 and wireless frequency expansion module 2 are the main devices inside meter reading repeater, when the two is in sleep state, are integrally copied
The energy consumption of table repeater will be down to extremely low level.
Step S20:According to the preset time of the AWU modules 11 in MCU control module 1, for the letter of wireless frequency expansion module 2
Number receiving port carries out CAD calling, if MCU control module 1 detects reception data, into S30 patterns, if MCU control module 1
Reception data are not detected, then enter S10 steps.
In S20 steps, CAD calling is carried out by CADDetect interrupt modes, if detecting reception data, is sent
CADDetect is interrupted to MCU control module 1, into S30 patterns.AWU modules 11 are a kind of timer modules, and AWU modules 11 are every
1s wakes up MCU control module 1 once with CADDetect interrupt modes, and it is effectively leading whether inquiry wireless frequency expansion module 2 detects
Code.If detecting effective lead code, into S30 patterns, MCU control module 1 is waken up with 2 sleep state of wireless frequency expansion module.
Step S30:Wireless frequency expansion module 2 is waken up, and repeater system is converted to reception pattern, starts to receive signal.In
After device system is converted to reception pattern, wireless frequency expansion module 2, receiving circuit 3, analog switch 5 and the conducting of antenna 6 constitute nothing
Line receives link, receives signal.
Step S40:After MCU control module 1 inside repeater carries out data processing to reception data, generates and send number
According to repeater system is converted to sending mode.After repeater system is converted to sending mode, wireless frequency expansion module 2, radiating circuit
4, analog switch 5 and the conducting of antenna 6 constitute wireless transmission link, are sent to signal.
In step S30 and step S40, under reception pattern and sending mode, using the Handshake Protocol of independent development, hold
The curriculum offering of Handball Association's view is initial code, water meter address code, control word, number of frames, relay address, data length and verification
Code and end code, and identify that the data are upstream data or downlink data by the way that the highest order of control word is arranged.
Step S50:Transmission data is sent to repeater long-distance management system, MCU control module by repeater by antenna 6
1 and wireless frequency expansion module 2 enter sleep pattern.In sending mode, wireless frequency expansion module 2, radiating circuit 4, analog switch 5
And the conducting of antenna 6 constitutes wireless transmission link, sends the signal to repeater long-distance management system, MCU control module 1 and nothing
After line spread spectrum module 2 completes data transmit-receive, it is returned to low energy consumption state.It can be seen that the LORA communications provided in the present embodiment
Meter reading repeater control method make the main energy-consuming parts MCU control module of meter reading repeater and wireless frequency expansion module isometric
Time is in low-power sleep state, this energy consumption for allowing for meter reading repeater is greatly reduced.
As shown in Fig. 2, the meter reading repeater provided in the present embodiment usually can effectively manage 100 meters and 20
Repeater, therefore usually require to carry out matching detection to platform meter and repeater, overflow checking is carried out to memory.In S00 steps
In, during repeater system initializes, the memory inside repeater is also initialized, memory initialization
Afterwards and MCU control module 1 detects after receiving data, and memory first carries out overflow checking, and the overflow checking of memory includes such as
Lower step:
Step S001:MCU control module 1 detects the effective address for receiving data.In S001 steps, data are received
Effective address includes meter address and/relay address.
Step S002:MCU control module 1 judges whether there is effective address in memory, if there is effective address in memory,
Into S003 steps, if there is no effective address in memory, into S004 steps.
Step S003:After MCU control module 1 inside repeater carries out data processing to reception data, generates and send number
According to.
Step S004:Effective address is added in memory, MCU control module 1 judges that the storage address of memory inside is
It is no to have expired, if the storage address of memory inside is less than, into S003 steps;If the storage address of memory inside has expired, hair
Memory is sent to overflow message to host computer, operator sends corresponding technical staff to handle according to the prompt of host computer.
Embodiment two:
As shown in figure 3, what is provided in the present embodiment is a kind of for the above-mentioned meter reading repeater control communicated based on LORA
The meter reading repeater based on LORA communications of method, including MCU control module 1, wireless frequency expansion module 2, receiving circuit 3, transmitting
Circuit 4, analog switch 5 and antenna 6, MCU control module 1 are electrically connected with wireless frequency expansion module 2 by SPI interface, wireless to expand
Frequency module 2 is electrically connected with receiving circuit 3, radiating circuit 4, and receiving circuit 3 is electrically connected with analog switch 5, radiating circuit 4 and simulation
Switch 5 is electrically connected, and analog switch 5 is electrically connected with antenna 6.When meter reading repeater receives data, analog switch 5 is by wireless frequency expansion
Module 2, receiving circuit 3 and antenna 6 are connected;When meter reading repeater transmission data, analog switch 5 by wireless frequency expansion module 2,
Radiating circuit 4 and antenna 6 are connected.When specific works, after the power is turned on, the MCU control module 1 of meter reading repeater starts to execute control
Program, MCU control module 1 initialize wireless frequency expansion module 2 by SPI interface after completing itself initialization, are arranged
The important parameters such as communication frequency, bandwidth, transmission power, the spreading factor of wireless frequency expansion module 2, then will by analog switch 5
Antenna 6 is connect with receiving circuit 3, sets wireless frequency expansion module 2 to reception state and suspend mode, at the same MCU control module also into
Enter suspend mode.MCU control module 1 is internally provided with AWU modules 11, and during suspend mode, AWU modules 11 wake up MCU controls every 1S
Molding block 1, after MCU control module 1 is waken up, whether inquiry wireless frequency expansion module 2 detects effective lead code, if having detected
Lead code is imitated, AWU modules 11 are converted to reception pattern, start to receive signal, otherwise MCU control module 1 and wireless frequency expansion module 2
Keep dormant state.Further, wireless frequency expansion module 2 is configured to SX1278 modules, and SX1278 modules are carried out with PC machine
Telecommunication, PC machine can change the messaging parameter of SX1278 modules, and messaging parameter includes transmission frequency, spreading factor, bandwidth work(
Rate and transmission power.It is further preferred that the operating mode of SX1278 modules includes sleep pattern, standby mode, CAD moulds
Formula, reception pattern and sending mode;When SX1278 modules are in sleep pattern, the current consumption of SX1278 modules is
0.1uA/h;When SX1278 modules are in sending mode, SX1278 modules are communicated using uplink agreement;When
SX1278 modules in a receive mode when, SX1278 modules are communicated using downlink transfer agreement.SX1278 modules use certainly
The Handshake Protocol of main exploitation, curriculum offering are initial code, water meter address code, control word, number of frames, relay address, data
Length and check code and end code, and identify that the data are upstream data or downlink by the way that the highest order of control word is arranged
Data.
Meter reading repeater further includes power module 7, and power module 7 is electrically connected with MCU control module 1 and wireless frequency expansion module 2
It connecing, the voltage of lithium battery is configured to 3.6V, capacitance is configured to 3000mAh, and low pressure difference linear voltage regulator is connect with lithium battery,
Low pressure difference linear voltage regulator has low-power consumption voltage stabilizing function, and static working current only needs 2uA, when enabling to meter reading repeater long
Between be in low-power consumption stable state.This power module 7 enables the meter reading repeater continuous work provided in this implementation
Up to 10 years as long as.
The utility model is described with reference to the preferred embodiments, and those skilled in the art know, is not departing from this reality
In the case of with novel spirit and scope, various changes or equivalence replacement can be carried out to these features and embodiment.This reality
It is not limited to the particular embodiment disclosed with novel, other embodiments fallen into claims hereof all belong to
In the range of the utility model protection.