Smart test
The design of wireless sensor network to ocean monitoring system
With the rapid development of marine industry, marine environmental protection has been put on the agenda. Therefore, marine water environment monitoring has become the focus of more and more attention.
Wireless sensor networks are widely used in military reconnaissance, environmental monitoring, target positioning and other fields. They can perceive, collect and process object information within the network coverage in real time, and send it to observers. It has the advantages of wide coverage, remote monitoring, high monitoring accuracy, fast network deployment and low cost. The application of wireless sensor network technology to the marine water environment monitoring system has been the focus of research in recent years.
Compared with other wireless communication standards, Zigbee is suitable for occasions where the throughput is small, the network construction investment is small, the network security is high, and it is not convenient to frequently replace the power supply. In the industrial control field, using sensors to form a sensor network based on Zigbee technology can make data collection and analysis convenient and easy. A very important point for Zigbee network to be used in the formation of sensor network is its low power consumption, its transmit power is only 0~3.6dBm; its communication distance can reach 30~70m, and it has energy detection and link quality indicator capabilities. , Can automatically adjust its own transmission power, and can consume energy under the premise of ensuring the quality of the communication link. Network function is an important feature of Zigbee, and it is also different from other wireless LAN standards. In terms of the network layer, Zigbee's main job is to be responsible for the establishment and management of network mechanisms, and has self-configuration and self-repair functions.
The IEEE 802.15.4 specification is an economical, efficient, and low data rate (<250kb/s) wireless technology that works at 2.4GHz and 868/928MHz. The protocol above the network layer is formulated by the ZigBee Alliance, IEEE802.15.4 Responsible for physical layer and link layer standards. The complete zigBee protocol suite consists of high-level application specifications, application convergence layer, network layer, data link layer and physical layer. The protocol stack structure is shown in Figure 1.
1 The composition of the sensor network
The composition of the wireless sensor network designed in this paper includes sensor nodes, sink nodes and gateway nodes, which are mainly responsible for detecting various conditions in the ocean area, including oil pollution detection, turbidity measurement, chemical oxygen demand measurement, seaweed measurement, and so on.
The sensor node is mainly responsible for the formation of the network, the collection of various ocean parameters, and the transmission of data to the sink node in the form of multi-hop.
The convergence node is the central node of the wireless sensor network, responsible for the initiation of the network, the formation and maintenance of the topology, the convergence and processing of network data, and the communication and information interaction with the monitoring system. The sink node is the more capable one of the terminal nodes of the sensor node.
The gateway node receives data from other nodes, performs correction, fusion and other processing on the data, and then sends it to the monitoring center. The instructions issued by the monitoring center are processed accordingly to determine the working status of each node.
The background monitoring center is responsible for summarizing and processing the marine parameter data sent back, controlling the network topology, and monitoring the network.
The entire ocean monitoring system consists of a certain number of sensor network terminal nodes, a small number of convergent nodes, a gateway node and a background monitoring system. In order to detect a certain area, a certain number of sensor nodes need to be arranged in the area to cover the entire area, and a gateway node is needed to complete the fusion of the data from the sensor terminal, upload it to the background monitoring system, and complete the data analysis And processing. The distance from the gateway node to the monitoring center is generally relatively long, and the existing GPRS network can be used for remote data transmission. The GPRS network connection cost is relatively low, the transmission rate is higher, the cost performance is higher, and it can always be online. The schematic diagram of the sensor network structure is shown in Figure 2.
The design of wireless sensor network to ocean monitoring system
Sensor terminal nodes and sink nodes can automatically form a self-organizing, multi-hop network. The sensor terminal node collects data according to instructions, and transmits the data to the gateway node through adaptive routing and multi-hop relay in a timely manner. The gateway node packages the collected data and forwards it to the background monitoring system.
2 hardware design
The sensor node in this ocean monitoring system is an important part of the sensor network. Its hardware includes a microprocessor unit, a zigbee communication module and a power management module; the convergence node hardware includes a microprocessor unit, two Zigbee communication modules and a power supply Management module: The gateway node hardware includes a microprocessor unit, a Zigbee communication module, a GPRS module and a power management module.
2. A node microprocessor MSP430F149 microcontroller
Since the wireless sensor network node needs to convert the analog signal output by the sensor into a digital signal, a microcontroller with integrated AD conversion function can be selected. In addition, wireless sensor network nodes must complete data forwarding and routing functions in addition to data collection, so they must have sufficient processing capabilities, program space, and data space. The MCU used in this design is MSP-430F149, which is a 16-bit ultra-low-power mixed-signal processor produced by TI. It is called a mixed-signal processor. It is mainly due to its practical application requirements and many analogue Circuits, digital circuits, and microprocessors are integrated on a single chip to provide a "single-chip" solution. Its outstanding advantages are low power supply voltage and ultra-low power consumption. Because it is a FLASH type, it is possible to debug and program the microcontroller online.
MSP430F149 low-frequency auxiliary clock is directly driven by a 32kHz clock crystal oscillator, which can be used as a background real-time clock to achieve self-wake-up function. The integrated high-speed digital control oscillator (DCO) has a frequency of 8MHz, which can be used as the main system clock (MSLK) source of the CPU or the subsystem clock (SMCLK) source of the CPU.
2.2 Node Zigbee communication module CC2420
The Zigbee communication module in the wireless sensor network hardware in this system is realized by the low-power high-performance wireless network module CC2420, which works in the general 2.4GHz frequency band. CC2420 is a radio frequency transceiver that meets the IEEE802. 15.4 standard, with stable performance and extremely low power consumption. The selectivity and sensitivity index of CC2420 exceeds the requirements of the IEEE802.15.4 standard, which can ensure the effectiveness and reliability of short-distance communication. The wireless communication equipment developed by this chip supports data transmission rates up to 250kb/s, which can achieve multiple points. Fast networking of multiple points. When CC2420 sends data, it uses direct quadrature up-conversion. The in-phase and quadrature components of the baseband signal are directly converted into analog signals by the DAC, and are directly converted to the set channel through the low-frequency filter, and then transmitted by the antenna.
The connection circuit of Zigbee communication module CC2420 and the one-chip computer is shown as in Fig. 3.
CC2420 only needs very few peripheral circuits, including clock circuit, radio frequency I/O matching circuit and microcontroller interface circuit. The local oscillator signal of the chip can be provided either by an external active crystal or by an internal circuit. When provided by the internal circuit, an external crystal oscillator and two load capacitors are needed. The size of the capacitor depends on the crystal frequency and input capacitance and other parameters. For example, when a 16MHz crystal oscillator is used, its capacitance is about 22pF. The radio frequency I/O matching circuit is mainly used to match the input/output impedance of the chip. The connection between CC2420 and the microprocessor is very convenient. It uses SFD, FIFO, FIFOP, and CCA four pins to indicate the status of sending and receiving data; the microprocessor exchanges data and sends commands with CC2420 through the SPI interface.
After CC2420 receives the SFD field of the physical frame, it will output a high level on the SFD pin until the frame is received. If the address recognition is enabled, after the address recognition fails, the SFD pin immediately turns to output low level. The FIFO and FIFOP pins indicate the status of the receiving FIFO buffer area. If there is data in the receiving FIFO buffer area, the FIFO pin outputs a high level; when the receiving FIFO buffer area is empty, the FIFO pin outputs a low level; when the FIFO pin is in When the data in the receive FIFO buffer exceeds a certain critical value, or when the CC2420 outputs a high-level critical value after receiving a complete frame, it can be set through the CC2420 register. The CCA pin outputs a high level when there is a signal on the channel. It is only valid in the receiving state. After the CC2420 enters the receiving state for at least 8 symbol periods, valid channel state information will be output on the CCA pin.
The SPI interface is composed of CSn, SI, SO and SCLK pins. The microprocessor accesses CC2420 internal registers and memory through the SPI interface. In the access process, CC2420 is a slave device of the SPI interface, receiving the clock signal and chip selection signal from the microprocessor and performing input/output operations under the control of the microprocessor. When the SPI interface receives or sends data, it is aligned with the falling edge of the clock. CC2420 and MSP430F149 are connected through SPI, where MSP430F149 is in master mode and CC2420 is in slave mode. MSP430F149 also has 4 I/O ports connected with CC2420, which are mainly used to query the status of CC2420.
The power management module provides energy for the sensor unit, the processor unit, and the wireless communication module, and manages the power supply to improve energy utilization.
2.3 System IEEE802. 15.4 working mode
The IEEE802. 15. 4 specification stipulates the use of DSSS modulation, and the modulation and spread spectrum functional block diagram in CC2420 is shown in Figure 4.
Each byte is divided into two groups of symbols, a group of 4 bits. The low-order symbol is transmitted first. For multi-byte fields, the low-order byte is transmitted first. However, the safety-related fields transmit the high-order byte first. Each symbol is mapped to a pseudo-random sequence with more than 16 bits, that is, a 32-bit chip code sequence. The chip code sequence is transmitted at a rate of 2Mchip/s. For each symbol, the low-order chip code is transmitted first.
The modulation method is offset quadrature phase shift keying, which has the shape of half a sine, which is equivalent to frequency shift keying (MFSK) modulation. The shape of each slice is transmitted alternately in the in-phase and quadrature phase channels by half a sine wave.
2.4 Data communication frame format setting
The synchronization header includes the preamble sequence and the start frame delimiter. The length of the preamble sequence and the start frame delimiter can be set in CC2420. The default values are 4 bytes and 1 byte, which are in line with IEEE. 80 2.15.4 protocol; the physical header is 1 byte, the frame control and the serial number are 2 bytes and 1 byte respectively: the address and source address are 6 bytes in total, and the length of the data segment to be sent is the frame length minus To address and frame check sequence. When MODEMCTRL0. When the AUTOCRC control bit is set, this frame check sequence automatically generates 2 bytes and is automatically inserted by the CC2420 hardware.
3 software design
In this design, the wireless sensor network is a multi-channel self-organizing wireless network, which can realize automatic networking, automatic routing query, automatic data collection and transmission, and the software design must be able to realize the function of multi-hop self-organization. In addition, sensor nodes must require extremely low power consumption. In addition to low power consumption in hardware design, low power consumption is more important in software design.
The wireless sensor network terminal first conducts self-check after being turned on. If the self-check fails, it prompts for hardware failure and automatically shuts down. After passing the self-inspection, further judge the working mode. The sensor node enters the access state after passing the self-check, and enters the waiting state if the access fails. The node in the waiting state turns off the radio frequency transceiver to save power consumption. When the waiting timer overflows, the node returns to the access state to make a new intervention attempt. If the node is successfully connected, it will switch to the service state. The node in the business state completes the collection and transmission of data, the relay and forwarding of the near-node data, and the intervention confirmation of the new node's access to the network. In order to achieve low power consumption, a node must rotate between the business state (active state) and the dormant state.
The software development is based on IAR Embedded Workbench V2. 10 as the platform and written in C language. The MSP430 series single-chip microcomputer of the node supports C language programming. The C language suitable for the MSP430 series is highly compatible with the standard C language, which greatly improves the efficiency of software development and enhances the reliability, readability and portability of the program code. The basic idea of software programming is: first initialize the SPI and CC2420 control ports, enable the SPI and UART ports, and enable the ADC. After booting, you can run the task program to receive or send data and commands.
The workflow of sensor nodes and sink nodes is shown in Figure 5.
For the design of the gateway node, the CC2420 wireless transceiver module is still used to receive the data, and a unified transmission protocol can be used to ensure the reliability of transmission; because the data processing is also required, the gateway node does not attach sensors to improve the processor For the data processing capability, the MCU adopts the MSP430F149 single-chip microcomputer; at the same time, the monitoring center is generally far away from the monitoring point, and the GPRS module is required to realize the remote transmission of data. Its workflow is shown in Figure 6.
4 Conclusion
The wireless sensor network for marine water environment monitoring designed in this paper combines wireless sensor technology, embedded computing technology, modern network technology, wireless communication technology and distributed intelligent information processing technology to form wireless intelligent sensors with the same or different functions. The networked and intelligent sensor network has greatly improved the monitoring capabilities of sensors that monitor various parameters of the ocean. Such a real-time monitoring system based on wireless sensor networks adopts short-to-medium-distance, low-power wireless networks, and has low RF transmission costs; it can use multiple power supply modes as needed, which has good energy-saving effects; it can realize flexible and fast networking and automatic configuration. Good scalability.