Design and Implementation of a Wireless Sensor Network Node Based on Arduino

— For dealing with the limitations and deficiencies of present wireless sensor network nodes, including poor flexibility, low degree of variability, low generality, Arduino development advantages are combined with ZigBee wireless communication technologies characteristics. The versatility and flexibility of wireless sensor network nodes and the cost and energy consumption of nodes are studied. First of all, ZigBee communication protocol and networking technology are studied, and based on this, communication protocols that the subjects need are designed. Secondly, the hardware system of ZigBee wireless sensor network node based on Arduino technology is discussed and designed. In addition, suitable Arduino development panel is selected in accordance with requirements of ZigBee wireless sensor network node. With the development panel as the design prototype, the circuit of functional module is designed. Thirdly, based on the wireless sensor network node communication protocol and hardware design, the software system of wireless sensor network node is designed and realized. The results showed that, through designing reasonable software working flow and compiling efficient information acquisition and wireless communication program, the intelligence orientation of node information acquisition and information transmission is achieved. In a word, it can be concluded that, combined with Arduino, a better function can be achieved.


Introduction
Wireless sensor network is a self-organized distributed system that is composed of many sensor nodes in the sensing region through communication form. And it is currently the research field that has attracted much attention at home and abroad, involving a wide range of disciplines, with high degree of knowledge fusion and high research heat. Wireless sensor network integrates sensor technology, modern network technology, embedded computing technology and distributed information processing technology. It can realize real-time sensing and acquisition of various types of monitoring object data information through cooperation of all kinds of integrated micro sensors, and send the data information collected to users in the wireless communication form [1]. Wireless sensor network (WSN) is a self-organized network that does not need to establish infrastructure in advance. Generally, a large number of wireless sensor network nodes are randomly placed in the monitored area, thus forming a network.
Arduino is a controller that has gained popularity rapidly in recent years. It is an open source electronic prototype platform with high flexibility, easy to use and low price. It has a rich interface, simple programming environment and great development freedom. The scalability of Arduino is very high, and it can rapidly design and implement personalized systems according to the field application requirements, and reduce the cost and volume of the system while improving system efficiency and versatility. This paper combines the ZigBee technology and wireless sensor technology in Arduino technology advantages, and conducts the research on wireless sensor network node that meets the needs of wireless sensor network applications. It is of important significance to broaden the space available for the wireless sensor network node.

2
Overview of related theories

Wireless sensor networks
Wireless sensor network can be defined as: the network system with multi hop and self-organized nature composed of information wireless transmission means and the wireless sensor network contains a large number of inexpensive sensor nodes with volume miniaturization. The main purpose of wireless sensor network is to collect and process the information which needs to be monitored in the monitored area, and to process the collected monitoring result and transmit it to the user. From the definition and purpose of the wireless sensor network, it can be seen that, sensor, monitoring target and user are the basic elements of the wireless sensor network. Wireless network is the key path linking the several basic elements, sensors, monitoring target, and users form a sensor network through a wireless communication mode, sensing and monitoring information in a collaborative manner. The characteristics of wireless sensor network include: limited power supply capacity, limited computing and storage capacity, limited information transmission capacity, large number of nodes, wide distribution and so on [2].
The system architecture of the wireless sensor network is shown in figure 1. In general, the nodes that make up wireless sensor networks can be divided into three kinds according to their functions, namely sensor nodes, sink nodes and management nodes. The working process of wireless sensor network system can be divided into sensing data transmission direction and wireless sensor network control direction according to data flow direction. Among them, the working process of sensing data transmission direction is: the sensor nodes in the monitoring area that are scattered placed are not only taken as the terminal node for collecting sensor information, but also can be used as a routing node. The sensing information obtained by terminal node, by single hop or multi hop, is transmitted to the sink node, and then transmitted to the external network, such as UAV, satellite communication network or the Inter- net. Then, these data information, through the external network, are transmitted to the remote task management nodes, so as to make a preliminary processing of the received data on the remote task management node. Finally, remote task management node will present the result data to the user after initial processing according to their own needs. The working process of the wireless sensor network to control the direction is: users directly interfaced with the remote task management nodes, to send wireless sensor network control information to the remote task management node, and then, by the remote task manager node, it sends control information to the external network. Next, the control information is sent to the sink node by the external network and transmitted to the sensor node from the sink node [3].
Wireless sensor network nodes have different functions depending on the application scenarios. In the same application scenario, wireless sensor network nodes will also have functional differences depending on the specific work roles. However, the wireless sensor network nodes in different application scenarios and the wireless sensor network nodes with different working roles in the same application scene have the same basic structure. The basic structure consists of four parts: energy supply module, sensor module, processor module and wireless communication module. Among them, the processor module can be divided into processor, memory device and high application three parts; the sensor module can be divided into two parts: sensor and A/D converter; wireless communication module can be divided into physical layer, medium access and RF (radio frequency ) three parts. The architecture of the wireless sensor network node is shown in Figure 2 [4].

Arduino technology
Arduino was originated from instructional development and then used for commercial development. It is a simple convenient and flexible software and hardware opensource electronics prototyping platform, derived from a simple I/O interface of open source code, and its development environment uses the programming language similar to Java and C language. Arduino mainly consists of two parts: one is the hardware resources required by the development, including various types of Arduino circuit boards; the second is the software resources needed for the development, including 5. Arduino programming language is similar to C language that this language contains a number of built-in functions. And these built-in functions can achieve a simple function through the not complicated statement, such as some common sensor communication, data conversion, serial reading and so on.

Method
As the basic unit of wireless sensor network, wireless sensor node design is the premise and basis of constructing the wireless sensor network, and the hardware design of wireless sensor network node is the foundation of the whole node design. Therefore, on the basis of Arduino open source hardware, with the consideration of the low power consumption, scalability and ease of use, the hardware design of wireless sensor network nodes is carried out.
In combination with the actual requirements of the project, the wireless sensor network node which is designed in this paper includes the sensor nodes as the terminal nodes and the non terminal nodes as routing nodes and sink nodes. The terminal node is mainly responsible for monitoring processing and transmitting the sensing data, and the non terminal nodes are responsible for transmitting the sensing data to the host computer in a variety of transmission modes. Although the two have different working modes and functional requirements, they are basically the same in the formation of the circuit hardware. As a result, this paper will take the generality as the principle to only perform the hardware design of sensor nodes in wireless sensor network, and the node can not only be used as a terminal node, but also as a non terminal node [6].
According to the general basic structure of wireless sensor network node, it is known that, the hardware system of wireless sensor network node must include processor module, sensor module, wireless communication module and power module. Among them, the power module serves as the power supply function component to provide energy for the entire sensor node, and the remaining three functional modules of the sensor nodes are energy consuming modules. In addition, the debugger and the download program interface should be considered to be added in the hardware design. Considering the low power consumption, small size, low cost and high flexibility design requirements of the node, the overall framework design of the hardware system of sensor nodes is shown in figure 3.
The processor module, as the core module of sensor nodes, is composed of the processor chip MCU and peripheral circuit that ensures the normal operation. In addition, for the direct communication of sensor nodes and PC, the processor module also includes serial USB conversion chip. The sensor module is composed of digital interface, analog interface, and sensor power switch circuit. The digital interface and analog interface in the module are the interface of the sensor and the sensor node, and the sensor power switch circuit, through the sensor controlling a power supply off, is designed so as to reduce the energy consumption of the sensor module. The wireless communication module is composed of a radio frequency module supporting the ZigBee protocol. The power supply module consists of a battery power supply circuit,  a USB power supply circuit, a power supply mode switching circuit and a battery energy monitoring circuit [7]. The design of the battery energy monitoring circuit aims to realize the intelligent management of the power supply of the node. It is worth noting that the design process of sensor node is divided into two parts. One part is the function module circuit design with reference to Arduino Uno R3 circuit design, and the other part is the circuit module design that Arduino Uno R3 cannot meet the sensor nodes and other functions. After the completion of the circuit design, the sensor node PCB design and PCB board physical production are carried out.

Result and discussion
The whole framework of wireless sensor network software system can be divided into two parts: node software and host computer software. The wireless sensor node software includes the terminal node software and sink node software. The terminal node software mainly realizes the function of data acquisition and processing of various types of sensor data, acquisition and processing of power battery information, network identification, network joining, and transmission of sensor information and power battery information in the form of wireless communication according to the communication protocol [8]. The sink node software's main function is to achieve networking, discovering equipment, receiving the sensor data and power battery information data sent by the terminal node, and transmitting sensor information and power battery information in the form of serial means according to the communication protocol. The sensor data and battery information received by the serial transmission. The host computer software is responsible for reading the information received by the serial port, then analyzing the data obtained in accordance with the communication protocol and processing accordingly, and finally displaying the required information in an intuitive form. The wireless sensor network node software system is constructed, as shown in  The working process of the software system of wireless sensor network node is: the equipment after powering on, the terminal node and sink node are networked, and then the sensor data and the power battery remaining electricity data are collected and processed by the terminal node. Next, in accordance with the ZigBee protocol, they are transmitted to the sink node in a wireless way, the sink node, after receiving the data sent by the terminal nodes, through USB connection line, is sent to the PC port, and the host computer on the PC machine reads the information obtained from the port and stores according to the classification [9]. And after the processing of all kinds of information, they are displayed on the interface of the host computer on the side of the PC machine.

Conclusion
The design scheme of ZigBee wireless sensor network node based on Arduino is presented, and from the design and implementation of the node hardware system and software system two aspects, the specific content of the design scheme is discussed. What's more, the feasibility and practicability of the scheme are verified by the node function test and performance test in the actual environment. Specifically, the ZigBee communication protocol and networking technology are studied, and on this basis, the communication protocol needed for the subject is designed. Besides, the hardware system of ZigBee wireless sensor network node based on Arduino technology is designed and implemented, and then, combined with ZigBee wireless sensor network node needs, the appropriate Arduino development board is chosen, and the circuit design of functional module with the development board for the design prototype is conducted. The design of Arduino based ZigBee wireless sensor network node is feasible, which provides a reference for wireless sensor network node design and practical application.