Design of Wireless Sensor Network Node Based on Microcontroller and Wireless Communication Module

This paper introduces the design and implementation of a wireless sensor network node based on ATmega128L and CC2420 operating in the 2.4GHz frequency band, and discusses the hardware components of each part in detail. Experiments show that nodes can flexibly form wireless sensor networks. The network system composed of nodes has stable performance, high communication efficiency and low power consumption, and can be widely used in control, signal acquisition and transmission.

Authors: Lu Chong, Ma Jiancang

This paper introduces the design and implementation of a wireless sensor network node based on ATmega128L and CC2420 operating in the 2.4GHz frequency band, and discusses the hardware components of each part in detail. Experiments show that nodes can flexibly form wireless sensor networks. The network system composed of nodes has stable performance, high communication efficiency and low power consumption, and can be widely used in control, signal acquisition and transmission.

Wireless sensor network is an emerging research field with huge potential application prospects in many fields such as military, environment, health, family, business and so on. The wireless sensor network node is the basic unit of the network. The rapid development of wireless sensor network brings many challenges to the design and management of wireless sensor network nodes.

wireless sensor network node

Wireless sensor network is a distributed self-organizing network integrating data acquisition, processing and communication functions. Wireless sensor network consists of multiple network nodes with wireless communication, sensing and data processing functions within a certain area. Sensor nodes are responsible for collecting, processing, compressing data, transferring data packets from other nodes, and sending the data packets out. In different applications, the structure of sensor network nodes is not the same, generally composed of data acquisition unit (sensor, A/D converter), data processing and control unit (microprocessor, memory), wireless communication unit (wireless transceiver) ) and a power supply unit (battery), etc.

Compared with traditional wireless network nodes, wireless sensor network nodes have obvious technical characteristics: (1) network nodes have high density and large number; (2) nodes have limited computing and storage capabilities; (3) nodes are small in size and usually carry a lot of energy. Limited battery, limited node energy; (4) limited communication capability, the communication bandwidth of sensor network is narrow, and the single-hop distance of communication between nodes is usually only tens to hundreds of meters, so how to design network communication under limited communication capability The mechanism to meet the communication of sensor network is a problem that must be considered; (5) The positions of each sensor node are randomly distributed and have self-organization characteristics.

Because the wireless sensor network node has the above characteristics, in the design of the node, the node hardware cost is required to be low, the energy consumption must be low, and the multi-hop routing protocol must be supported. The IEEE802.15.4/ZigBee protocol fully considers the needs of wireless sensor network applications, and has the characteristics of equipment power saving, reliable communication, network self-organization, strong self-healing ability, low cost, large network capacity, and network security. Based on these basic requirements, the hardware design of wireless sensor network nodes supporting 802.15.4/ZigBee protocol is carried out.

network structure

Nodes can be composed of three topological structures: star structure, mesh structure (Mesh) and cluster structure (Cluster tree). The nodes form a network in a self-organizing form, each node can collect data independently, and the data is sent to the sink node (Sink node) through single-hop or multi-hop relay. The gathering node sends the collected data to the remote control center, or sends the data to the PC through the RS232 interface for data processing and storage.

B

The node hardware adopts a modular structure design as shown in Figure 1, which is composed of an operation and communication sub-board, a sensor sub-board, and a charging and status Display sub-board. The operation and communication sub-board is composed of microprocessor, data storage circuit, wireless communication module, power management module, etc. Its main function is to store and process data, complete wireless communication between nodes and provide energy for the system. The sensor sub-board consists of several sensors, which are responsible for the collection of information in the monitoring area. The charging and status display sub-board is composed of a charging module and an LCD liquid crystal display module, which is used to display the node’s battery charging status and the node’s working state and battery power.

microprocessor circuit

The microprocessor circuit adopts ATmega128L microcontroller of Atmel Company, which is produced by low-power CMOS process, based on RISC structure, with on-chip 128KB program memory (Flash), 4KB data memory (SRAM) and 4KB EEPROM. 8 10-bit ADC channels, 2 8-bit and 2 16-bit hardware timer/counters, 8 PWM channels with programmable watchdog timer and on-chip oscillator, on-chip analog comparator, JTAG, UART, SPI, Interfaces such as I2C bus. ATmega128L can work in many different modes, in addition to the normal operation mode, it also has six different levels of low-power operating modes, so this microcontroller is suitable for low-power applications. The schematic diagram of its interface is shown in Figure 2.

The working clock source of ATmega128L can choose external crystal oscillator, external RC oscillator, internal RC oscillator, external clock source and so on. The selection of the working clock source is designed by the internal fuse bit of ATmega128L, and the fuse bit can be set by JTAG programming, ISP programming and so on. In this design, ATmega128L adopts two external crystal oscillators: 7.3728MHz crystal oscillator is used as the working clock of ATmega128L; 32.768kHz crystal oscillator is used as real-time clock source.

data storage circuit

Due to the limited transmission capacity of the communication module of the wireless sensor node and the very small duty cycle of the node’s work, many data cannot be forwarded in real time, so a manageable memory is needed to store these data, temporarily store the data collected by itself or need to be forwarded. data collected by other nodes. This design selects 512KB serial FLASHAT45DB041 to store data. Compared with ordinary data memory, the chip has the characteristics of low power consumption, small size, serial interface, simple external circuit, etc., and is suitable for sensor nodes. The schematic diagram of the data storage circuit is shown in Figure 3.

wireless communication module

The wireless communication module adopts wireless radio frequency CC2420 module. It is a wireless transceiver module compatible with the 2.4GHz IEEE802.15.4 standard launched by Chipcon at the end of 2003. Based on Chipcon’s SmartRF03 technology, it is produced by CMOS technology, with low operating voltage, low energy consumption, small size, and high output strength and The transceiver frequency is programmable, etc. The chip can work normally with few external components such as crystal oscillator and load capacitors, input/output matching components and power supply decoupling capacitors, which can ensure the effectiveness and reliability of short-distance communication, and its maximum transceiver rate is 250kbps .

CC2420 has 33 16-bit configuration registers, 15 command strobe registers, a 128-byte transmit FIFO buffer, a 128-byte receive FIFO buffer, and a 112-byte security information memory. The connection between CC2420 and the processor is relatively simple. It uses four pins of SFD, FIFO, FIFOP and CCA to indicate the status of sending and receiving data; the processor exchanges data and sends commands with CC2420 through the SPI interface (CSn, SO, SI, SCLK). Use the RESETn pin to reset the chip, and use the VREG_EN pin to enable the voltage regulator of the CC2420 to generate the 1.8V voltage required by the CC2420, so that the CC2420 enters a normal working state; the CC2420 communicates through a monopole antenna or a PCB antenna. The schematic diagram of its module is shown in Figure 4.

CC2420 needs a 16MHz reference clock for data transmission and reception. The reference clock can come from an external clock source or it can be generated by the internal crystal oscillator. If an external clock is used, input directly from the XOSC16_Q1 pin, and the XOSC16_Q2 pin should be left floating; if the internal crystal oscillator is used, the crystal oscillator should be connected between the XOSC16_Q1 and XOSC16_Q2 pins. The starting of the crystal oscillator needs to be enabled on the CC2420 strobe command register SXOSCON.

Power Management Module

Electric energy is a very valuable resource for sensor networks. In order to ensure the low-power design of hardware circuits, the selection of node chips uses chips that work with low power consumption and low voltage. The system works with ordinary batteries or rechargeable lithium-ion batteries, and the power management chip adopts ADP3338-3.3 and SOT-223 package of AD company.

Charging and status display module

When the node is conditionally charged, the node uses the lithium-ion battery to work, and the charging module can be used to supplement the node with electrical energy, thereby ensuring the continuity of the node’s work and avoiding the node’s work interruption caused by battery replacement. The charging module is designed using DS2770 and battery protection chip DS2720 from Dallas, and has functions such as charging control, power control, power counting, and battery protection. The processor and the DS2770 use a one-line interface to transmit information, and an external connection of about 4.7k is required! pull-up resistor. The schematic diagram of the charging module is shown in Figure 5. The LCD display module adopts LCM6432ZK liquid crystal display, which is connected to the main MCU through the serial interface, and is used for the display of system working status information, charging process, battery power and other states. The node hardware has an LCD interface, which can be easily connected to the LCD display module when display is required.

sensor module

The node sensor module is separated from the computing and communication daughter boards, and the modular design improves the flexibility of the node in different applications. The sensor module can determine suitable sensors according to actual needs, such as temperature, humidity, vibration, light intensity, gas alarm, magnetoresistance, infrared, etc. to meet different needs. Since the nodes are mostly powered by batteries, the sensors are required to be small in size, low in power consumption, and simple in peripheral circuits. It is best to use digital sensors that do not require complex signal conditioning circuits.

Some of the sensors selected in this design are:

The temperature sensor DS18B20 is a new type of digital temperature sensor. The external circuit is very simple and uses a one-wire bus interface. The measurement range is -55°C to 125°C, the measurement accuracy between -10°C to 85°C is ±0.5°C, the maximum resolution can be designed to be 12 bits, and the measurement data is accurate and reliable.

Infrared sensor PD632 is a digital pyroelectric sensor, the working wavelength: 7.5ηm ~ 14ηm, the detection distance can reach 6m ~ 15m in the working environment of -20 ℃ ~ 60 ℃.

The acceleration sensor ADXL202 is a two-dimensional digital acceleration sensor of AD company. The working temperature is -40℃~85℃. It adopts advanced MEMS technology and can measure vibration acceleration and static acceleration.

External interface

The external interface of the node includes JTAGE interface, ISP programming interface, RS232 interface, charging interface, sensor interface, SMA antenna base interface, etc. Nodes use JTAGE and ISP to download programs; use RS232 interface to directly connect to the serial port of the PC; different sensor modules can be connected through the sensor interface according to different needs; under the condition of charging conditions, the node can be quickly connected to the node through the charging interface Replenish energy. Figure 6 is a schematic diagram of the RS232 interface, and Figure 7 is a schematic diagram of the JTAG/ISP interface.

The main points of node design and matters needing attention

The RF part is the focus and difficulty of this design, and it is also the key to the success of the system design. The main problems encountered in the module design process and their solutions are:

The carrier frequency of CC2420 is 2.4GHz, and a channel is added every 5MHz, and the accuracy of the crystal oscillator will affect the frequency of the carrier, thereby affecting the establishment and stability of communication. The CC2420 requires the accuracy of the clock source to be within ±40ppm. If an external crystal oscillator is used, a four-pin chip crystal oscillator with high precision and stable performance should be used as much as possible.

The CC2420 radio frequency circuit works in the high frequency working frequency band of 2.400GHz to 2.4835GHz, and the anti-jamming design is directly related to the radio frequency performance and the operation of the entire sensor node. When wiring the RF part, reasonable layout and wiring and the use of multi-layer boards are not only necessary for wiring, but also an effective means to reduce electromagnetic interference and improve anti-interference ability. Pay special attention to the following points when wiring: First, the area of ​​the RF circuit that is not used for wiring needs to be filled with copper and connected to the ground to provide RF shielding to achieve effective anti-interference; Second, the bottom of the CC2420 chip should be grounded; To delay, reduce crosstalk, and ensure the transmission of high-frequency signals, multiple ground vias should be used to connect the bottom of the CC2420 chip to the ground layer; the third is to reduce crosstalk as much as possible and reduce the influence of distribution parameters, and the devices should be closely distributed around the CC2420 , and use a smaller package.

For wireless communication networks, antennas play a pivotal role. The selection and setting of the antenna will directly affect the operation quality of the entire wireless communication network. The RF chip CC2420 of this node can use two design schemes: metal inverted-F PCB lead antenna and monopole antenna. A PCB lead antenna is a wire printed on a circuit board, through which it senses air waves and receives information. The shape and size of the PCB antenna should be designed in strict accordance with the data sheet. In recent years, with the decreasing cost of computers and the shrinking of the size of microprocessors, more and more attention has been paid to wireless sensor networks. This design is a low-power, low-cost, practical wireless sensor network node designed by the author on the basis of summarizing the research results of wireless sensor networks at home and abroad. The node adopts an independent optional charging module, LCD status display module and abundant external interfaces, which has strong practicability and can work in a variety of environments. It can be configured according to various needs to complete the system functions. It has obvious advantages in terms of power consumption and flexibility.

The Links:   PD050VX2 CLAA170EA07QL