With the advent of the energy crisis, the long-term, safe and efficient mining of oil resources has become a topic of study. The well site environment has three main characteristics: severe condition, high risk, and the lack of efficient monitoring parameters. When the control of the relevant parameters is not timely, some large or small accidents will occur. Besides the geological conditions, the lack of timely control of oil production parameters is the leading cause to these accidents.
As early as more than 30 years ago, remote monitoring technology in other countries has been applied in the field of the well site environmental monitoring  . With the advent of the twenty-first century, experts in western countries not only began to use wireless communication technology to monitor the well site environment, but also began to realize the importance of the automation in drilling technology. But due to the use of wired transmission in the well site environmental monitoring, the system also has some limitations. One case in point is that the signal needs to undergo heavily corroded areas; therefore, wireless communication technology has been highly valued. Compared with wired trans- mission, wireless communication technology has the advantages of low power consumption, low cost and dynamic performance  . They can be well used in environmental wireless monitoring; therefore, it is very important to study the field of the well site environment monitoring system based on wireless sensor network.
2. The Hardware Design of the System
2.1. The Framework of the Hardware Design
This system adopts the fixed end acquisition mode, which is divided into four parts: terminal, router, coordinator and the upper machine. The definitions of these four parts are listed in the following:
Terminal: using various sensors (temperature, humidity, H2S, CH4, smoke, light), to get various well site environmental parameters; the signal will be proce- ssed by MCU; storing data; using ZigBee network to send the stored data to router.
Router: sending the received terminal information to the coordinator.
Coordinator: using the ZigBee network to receive data sent by the terminal, using single-chip microcomputer for data processing and data storage, and exchanging data with the upper machine.
The upper machine: analyzing the received data to determine whether early warning is necessary.
Working principle: this design mainly aims to resolve the difficulty in the process of well site environmental monitoring and accidents that may arise in the complex environment. In the network, sensor nodes distribute in various places of the well site. According to the coverage of the network and the actual area of the well site, the total number of sensor nodes that may be needed can be figured out  . The temperature, humidity, light intensity and a variety of harmful gases in the well site environment will be collected by the sensor nodes in real time. When coordinator is powered on, the network is beginning to be built, and then the wireless connection of the sensor nodes is realized through the use of ZigBee. At this point, the sensor nodes will automatically match the coordinator and then join the ZigBee network. The sensor node will send the collected environmental parameter information to the upper machine, using the upper machine to realize the data display, processing, preservation and other functions  . The system is shown in Figure 1:
Figure 1. Overall design of network node.
2.2. Hardware Design of Network Nodes
2.2.1. Overall Design of Network Nodes
This design is aimed at the monitoring of the well site environmental parameters, which is generally severe. The environmental parameters that need to be collected include combustible gas (methane), temperature and humidity, light intensity, toxic gas hydrogen sulfide and smoke, etc. In this design, the main control chip of the whole network adopts CC2530, which is widely used in the application of ZigBee wireless sensor network for its adaptability in the well site environment. Besides, the network should also have the sensor module, the radio frequency module, the power module, the communication serial port as well as the antenna and so on so as to satisfy the wireless communication function of the entire network data  . The sensor module mainly includes MQ-2 gas sensor, temperature and humidity sensor SHT11, photoelectric sensor and hydrogen sulfide sensor. Sensors and CC2530 chips are integrated on the same board PCB. RS232 is used as the communication serial port.
2.2.2. The Introduction of Main Control Chip CC2530
Based on ZigBee and RFCE applications, CC2530 is an on-chip system, which can create powerful network nodes, and the cost is very low  . Due to its multiple operating modes and the swift shift between different modes, CC2530 is very suitable for low power consumption system. Figure 2 shows the CC2530 chip and its peripheral circuits.
2.2.3. Sensor Circuit Design
This design of well site environmental wireless monitoring system is mainly used to monitor environmental parameters of well site. In order to monitor the parameters, environmental information should be collected first; therefore, it is necessary to configure the corresponding sensor circuit for the network node so as to complete the information acquisition task. The sensor module mainly includes MQ-2 gas sensor, temperature and humidity sensor SHT11, CH4 sensor, photoelectric sensor and hydrogen sulfide sensor  .
Figure 2. CC2530 chip and peripheral circuit.
The module circuit diagram of MQ-2 and MQ-136 has four interfaces: power supply port, analog and digital signal output port and grounding port. Application circuit of SHT11: CC2530’ s P1.6 and P1.7 port are used to control SHT11’ s data and SCK port and 3.3V DC is used as power supply. The function of the photoelectric sensor circuit is to enable the photosensitive device to receive the optical signal and convert it into an electrical signal, amplify the signal by the Noninverting amplifier circuit.
2.2.4. Serial Communication Circuit
This design of serial port communication adopts serial communication. Serial communication is the connection between the computer and the external device through a data signal line, the data is transmitted bit by bit through the signal line. Although this communication mode can save communication costs, the transmission speed is slower than the parallel. The function of serial communication circuit is used to connect the coordinator with the upper machine, thro- ugh which the data can be displayed  . Figure 3 is the serial port communication circuit diagram.
2.2.5. Other Circuit
This part mainly includes the antenna circuit and the power conversion circuit. The antenna circuit causes the communication signal to be transmitted from one node to another node in a wireless way, 9V DC current is converted into 5V DC power supply and 3.3V DC power supply.
3. The Software Design of the Wireless Monitoring System of the Well Site Environment
3.1. MCU End Software Design Framework
MCU end software design framework is shown in Figure 4.
Figure 3. Serial communication circuit.
Figure 4. MCU end software framework of the wireless monitoring system of the well site environment.
The basic idea of SCM end software: start and initialize the whole system; then start A/D conversion, the A/D converter is implemented using the CC2530 peripheral circuit, and using the corresponding sensors to acquisit environmental parameters, the collected data is then sent to CC2530 for storage and data processing, finally, using CC2530 RF transceiver to send data, then the other end of the CC2530 receives the data  -  .
1) Sensor node: The sensor node is mainly responsible for collecting the well site environmental parameters, the design uses a temperature and humidity sen- sor and photoelectric sensor. Start the sensor node first; next, initialize CC2530 chip and transmitter module, build network, and then acquire data, the acqusited data is sent to the upper node  .
2) Coordinator node: Coordinator node is used to establish and manage the whole network, when the network establishment is completed, the coordinator node mainly receives the data packet that comes from the router, and the data is sent to the control center by the serial communication.
In this design, the coordinator is connected to the upper machine through the serial port. The coordinator program includes receiving router node data and sending data to the upper machine.
3.2. The Software Design Framework of the Upper Machine End
The software of the computer terminal is to receive the data wirelessly, then display the data through the serial assistant, and then use the upper machine for data processing, storage, alarm and other functions. The frame figure is shown in Figure 5.
3.3. The Upper Machine Implemention
The design is completed by using LabVIEW. The LabVIEW interface is shown in Figure 6.
As can be seen from the LabVIEW interface, the user login, serial port configuration, data and waveform display, as well as the data storage function are all integrated into one integral interface  .
4. System Testing
4.1. Module Test
1) Data acquisition module test
Due to experimental limitation, in this design, only SHT11 temperature and humidity sensors and photoelectric sensors are selected in the test. The measured temperature, humidity and illumination data are shown in Figure 7.
2) Communication module test
In order to verify whether the CC2530 wireless communication can be carried out properly, therefore, the communication module should be tested. Using two CC2530 templates, one download terminal node program, another download
Figure 5. The software framework of the computer terminal.
Figure 6. The LabVIEW interface of the wireless monitoring system of the well site envi- ronment.
coordinator program, the coordinator is connected with the upper machine through the serial port line. First, the coordinator is turned on, then the terminal node is connected to the power supply, the two modules’ LED display and serial assistant display can be observed. By testing the system module, it shows that the system really works. Then the whole system is tested.
4.2. Integration Test
When all the programs of the system and the LabVIEW interface design are completed, using USB line to connect each hardware of the node, using the serial port communication line to connect the coordinator to the upper machine. The program of the coordinator, router terminal node 1 and terminal node 2 are downloaded to the MCU successively by using the CC Debugger emulator. After the download is completed, the parameters can be acquired, and the relevant information can be displayed in the serial assistant.
Close serial debugging assistant, open LabVIEW interface, and then click “run”. Then enter the correct account number and password to log in, select serial port COM3, the baud rate is set to 38400 in advance, at this point, the read buffer will display the parameter values of terminal node 1 and terminal node 2,
Figure 7. Figure display of acquisition module test serial port.
Figure 8. Historical data preservation figure of the environmental parameters.
at the same time waveform and data display interface also have the corresponding data display.
At this point, clicking the file path to select the location to save the file, when the system stops running, click the saved file to view the historical data, as shown in Figure 8. The figure shows that all the environmental parameters are collected, and the parameters of node 1 and node 2 can be displayed automatically, through the preservation of historical parameters, we can analyze the data and find the possible faults.
4.3. Actual Measurement of Environment
In order to verify the reliability of system design, the system was tested outside the laboratory. First of all, download and deploy computer terminal, coordinator and router. Thereafter, place each terminal node, coordinator and router in proper places. After the placement of the nodes, using the charge pal as the power supply, the upper machine is replaced by computer. After the completion of the preparatory work, we carried out the acquisition of environmental parameters.
The test results show that the system can monitor the outdoor environment in real time, when the environmental parameters exceed the set value, the corresponding location of the LabVIEW interface will send an alarm.
The ZigBee technology-based wireless monitoring system of the well Site environment is introduced in this paper. The system uses the wireless ZigBee technology as the transmission mode, and combines the virtual instrument technology to design the upper machine interface. The experimental results show that the system is stable and reliable, and the anti-interference ability is strong. More- over, the system can also be applied to the acquisition and monitoring of a variety of outdoor environmental parameters.
This work is supported by scientific research starting project of SWPU (No. 2014QHZ029), the State administration of national security (No.sichuan-0011- 2016AQ), Oil Gas Fire Protection Key Laboratory of Sichuan Province (No. YQXF201602),and the University student innovation industry project (No. 201610615030), and the general project of Sichuan Provincial Department of Education (16ZB0082).
 Song, H. and Brandt-Pearce, M. (2013) Model-Centric Nonlinear Equalizer for Coherent Long-Haul Fiber-Optic Communication Systems. 2013 IEEE Global Communications Conference (GLOBECOM), Atlanta, GA, 9-13 December 2013, 2394-2399.
 Asorey-Cacheda, R., García-Sánchez, A.J., García-Sánchez, F., García-Haro, J. and González-Castano, F.J. (2013) On Maximizing the Lifetime of Wireless Sensor Networks by Optimally Assigning Energy Supplies. Sensors, 13, 10219-10244.
 Hou, Y.T., Shi, Y. and Sherali, H.D. (2005) On Energy Provisioning and Relay Node Placement for Wireless Sensor Networks. IEEE Transactions on Wireless Communications, 4, 2579-2590.
 Luz, Y.M. and Wong, V. (2007) An Energy-Efficient Multipath Routing Protocol for Wireless Sensor Networks. International Journal of Communication Systems, 20, 747-766.
 Jayalakshmi, R., Baranidharan, B. and Santhi, B. (2014) Attribute Based Spanning Tree Construction for Data Aggregation in Heterogeneous Wireless Sensor Networks. Indian Journal of Science and Technology, 7, 76-79.
 Lachowski, R., Pellenz, M.E., Penna, M.C., Jamhour, E. and Souza, R.D. (2015) An Efficient Distributed Algorithm for Constructing Spanning Trees in Wireless Sensor Networks. Sensors, 15, 1518-1536.
 Vashist, R. and Dutt, S. (2014) Minimum Spanning Tree based Improved Routing Protocol for Heterogeneous Wireless Sensor Network. International Journal of Computer Applications, 103, 29-33.
 Saha, S. and McLauchlan, L. (2015) An Approach to Construct Weighted Minimum Spanning Tree in Wireless Sensor Networks. In: Lee, R., Ed., Software Engineering, Artificial Intelligence, Networking and Parallel/Distributed Computing, Vol. 569, Springer International Publishing, Cham, 69-84.
 Vijay, U. and Gupta, N. (2013) Clustering in WSN Based on Minimum Spanning Tree Using Divide and Conquer Approach. International Journal of Computer, Electrical, Automation, Control and Information Engineering, 7, 926-930.
 Saravanan, M. and Madheswaran, M. (2014) A Hybrid Optimized Weighted Minimum Spanning Tree for the Shortest Intrapath Selection in Wireless Sensor Network. Mathematical Problems in Engineering, 2014, Article ID: 713427.
 Suto, K., Nishiyama, H., Kato, N. and Huang, C.W. (2015) An Energy-Efficient and Delay-Aware Wireless Computing System for Industrial Wireless Sensor Networks. IEEE Access, 3, 1026-1035.