Development a New Intelligent System for Monitoring Environment Information using Wireless Sensor Networks

Wireless Sensor Networks are a new technology that has been on the agenda lately and can be applied to many areas. By using Wireless Sensor Networks, information can be gathered interactively and this information can be collectively evaluated and can be changed on the basis of information when necessary. In this work, a sensor node and a gateway node are designed and developed. With designed new nodes, a new intelligent system is developed. In the new system, Temperature, humidity, sound and water level data are perceived and monitored. This system can be used in all environments that need these four information. It is estimated that our work will benefit sensor


Introduction
Wireless Sensor Network is used for wireless networks that use sensors to monitor cooperatively the physical or environmental conditions such as temperature, humidity, light, sound, pressure, pollution, soil composition, noise level. The node, which is used in wireless sensor networks and has the ability to collect computation, perceptual information, and communicate with other connected nodes in the network, is called sensor node. The sensor nodes that form the Wireless Sensor Networks come from the components of the detection unit, data processing unit and communication unit [1], [2], [3]. These sensor nodes, which are scattered over a large area, are able to organize themselves and monitor the environmental environment. Wireless Sensor Networks are driven by the fact that the sensor nodes interacting with the physical world are self-organizing to form a wireless network [2]. Recently, a variety of low-power and cost-effective sensor platforms have been developed in line with advances in wireless communications and micro-system technologies. Increased work with Wireless Sensor Networks is intended to serve people well with interactive monitoring applications with physical environments [4], [5], [6]. Wireless Sensor Networks are used in many environmental monitoring applications, such as tracking birds' zones [7], [8], researching redwood tree growth models [9], or monitoring the impact of environmental parameters on the quality of agricultural products [10]. Wireless sensor networks are also used extensively in monitoring geographical areas [11]. Lately, the variety and amount of chemicals left in the environment has increased. These emissions and effects are much higher. These influences adversely affect human health and ecosystems. Therefore, it is very important to monitor the environment and take necessary precautions [12]. Due to the increase in human activities, the damage to the environment has increased [13]. In particular, the negative impact on the environment in developed countries is significant. Effective monitoring systems need to be proliferated to ensure environmental sustainability [14]. Examples of environmental monitoring systems are air quality monitoring [15], [16], [17], water quality monitoring [18], [19], [20], [21] animal monitoring [22], [23], [24] and earthquake monitoring [25], [26] systems. In this study, a new intelligent system is developed. This system can be used several monitoring applications which need temperature, humidity, sound and water lever information. Sensor Node and Gateway Node are designed and developed by us which are used in this system. The rest of the article is as follows. In the second part, we talk about wireless sensor networks, in the third part, hardware design, and in the fourth chapter, monitoring of environment data. The last part of the article contains the general conclusions of the study.

Wireless Sensor Networks
Wireless Sensor Networks consist of small-sized sensor nodes. These nodes go into a physical field business alliance, bringing what they learn from the physical world into the virtual world [27]. In the sensor networks, the data perceived by the various sensors from the physical world are transferred wirelessly to the information processing network, which is the target by the collaboration method called as the remote ear. The gateway to the computing network is called the base station. This station is a special node that can communicate with both the sensor nodes and the communication network. The base node is considered to be a static node with no energy problem and a node with high computation capability. Sensor nodes are wireless and generally communicate with radio technology, with limited energy and computational capabilities. These units are automatically installed and set up to detect and track certain situations and events in the detection area. Numbers can be hundreds or even thousands depending on the application. Their small size is a physical necessity in terms of usability. The areas of use of sensor networks are increasing day by day. Military, environment, health, commercial, home automation etc. It is widely used in the fields [28]. It is used to monitor battlefields, to monitor enemy movements, to explore land, to monitor personnel and military vehicles, to monitor friendly forces, and to determine the speed and location of targets in military applications. It is used in applications such as detection of air pollution, monitoring natural disasters such as floods, earthquakes, forest fires, monitoring of agricultural activities in Environmental applications. It is used to determine the location of the doctors in the hospital, to monitor the conditions of the patients, to supervise the elderly and to follow various healthful parameters in health practices. It is used in areas such as monitoring and detection of vehicles, monitoring of energy lines, monitoring by small children's families, lighting control, traffic lights control, fire systems in commercial applications. It is used in intelligent home environments and building security systems in home automation applications.

Hardware Design
The hardware design section consists of two parts, the sensor node and the gateway node.

Sensor Node
In the sensor node circuit, the information contained in the environment is detected. The sensor node consists of Arduino Pro Mini, Wireless NRF24L01+ 2.4GHz Transceiver Module, DHT11 Temperature-Humidity sensor, SparkFun Sound Detector, Water Level Sensor. Arduino Pro Mini [29], is a microcontroller card based on Atmega328 (Figure 1). It has 14 digital input / output pins (6 can be used as PWM output), 8 analog inputs, 16Mhz crystal and reset key. The breadboard is made for use on places where size is important to use. The Pro Mini does not have a usb socket and a scheduler. USB-Serial Converter or other usb-serial converters can be used to program the card.   (Figure 2). It is a low power consumption module that allows wireless communication at 2.4GHz frequency. It has 2MBps communication speed which can be used frequently in various robotics and industrial projects and it supports SPI interface.  DHT11 is an advanced sensor unit that provides temperature and humidity sensor calibrated digital signal output. It is highly reliable and stable in long term work. Includes 8-bit microprocessor, fast and quality response. Temperature measuring unit with 2 ° C error between 0 and 50 ° C, Humidity meter with 5% RH error between 20-90% RH. SparkFun Sound Detector [32] ( Figure 4) is a small and very easy to use audio sensing board with three different outputs.

Fig. 4. SparkFun Sound Detector
The Sound Detector not only provides an audio output, but also a binary indication of the presence of sound, and an analog representation of its amplitude. The 3 outputs are simultaneous and independent, so you can use as many or as few as you want at once. Water Level Sensor [33] ( Figure 5) is an easy-to-use, cost-effective high level/drop recognition sensor, which is obtained by having a series of parallel wires exposed traces measured droplets/water volume in order to determine the water level. Easy to complete water to analog signal conversion and output analog values can be directly read Arduino development board to achieve the level alarm effect.

Gateway Node
In the gateway node circuit, information is obtained from the sensor nodes in the environment. The gateway node consists of Arduino Nano Sensor Shield, Arduino Nano 328 and Wireless NRF24L01+ 2.4GHz Transceiver Module. With this Arduino Nano Sensor Shield [34] designed for Arduino Nano (Figure 8), Arduino Nano's pins are inserted into the standard shield structure for a more comfortable operation. Therefore, standard Arduino Shields can be used with Nano.
All Arduino pins are inserted in 3-pin form (GND-5V-Signal) to more easily connect the sensor and various input / output elements.

Fig. 8. Arduino Nano Sensor Shield
The reset pin is pulled onto the card, and the DC adapter input is 2.1 mm center positive input like the other Arduino cards. 5V, 3.3V and GND power was replicated on the pins and taken on the card.
Features of Shield: It is compatible with Arduino Nano and puts all pins into a standard shield structure. Arduino can be used with Uno, Leonardo and Mega. In order to make it easier to use various input and output units such as sensors and servo motors, the pins are provided with 3 's. Ground and feed pins are placed next to each pin. The reset pin is pulled onto the card. For the supply voltage between 7-12V, the adapter is located on the input card. Card dimensions: 58x59mm. Arduino Nano 328 [35] (Figure 9)is an Atmega328 based microcontroller card. It has 14 digital input / output pins (6 can be used as PWM output), 8 analog inputs, 16Mhz crystal, usb socket, ICSP connector and reset key. The card has everything it needs to operate the microcontroller. It can be connected to the computer via usb cable easily, it can be operated with adapter or battery.  Figure 10 shows the gateway node designed in the environment. Gateway Node can be programmed via USB interface. Thanks to the Gateway Node, the information of nodes in the environment can be seen by the user.

Monitoring of Environment Data
The architecture of the study is given in Figure 11. The Arduino 1.8.1. Program is used for programming the nodes. First, the sensor nodes detect the information in the environment and send it to the gateway node. The data coming to the Gateway Node can be monitored.
The data coming to the Gateway Node is transferred to the serial port. The information coming from the serial port is saving to database. PostgreSQL is used as database management system. The data coming from Sensor Nodes can be sent in two ways as wireless or serial port. When the Sensor Node is attached to any pc, the values read at the same time are read by the serial port reading program and stored in the database. Temperature, humidity, sound and water level values are low / medium / high according to the data coming to the database, as can be seen in Figure 12 on web platforms. PHP is used for web application. However, when the volume and the water level in the web software are higher / lower than the set thresholds, the number sms specified by the user is sent instantly. In this way, the user can generally see the results on the web platform, and suddenly he gets sms. The developed sensor nodes were placed at the center and successfully measured temperature, humidity, sound and water levels in the environment.

Conclusion
In this study, a sensor node and a gateway node were developed to monitor the environmental data with wireless sensor networks. The developed sensor is equipped with temperature, humidity, sound and water level sensors. Then, this information was read from the medium. The read information is transferred to the gateway node. The data transferred to the gateway node is monitored with the help of the serial port read program. Arduino 1.8.1 was used for the programming of the nodes. With the work done, a new application has been added to the environmental monitoring applications. The advantages of working are as follows. Thanks to the developed system, temperature, humidity, water level and sound values in the environment can be monitored wirelessly. These values can be controlled independently of time and space. In addition, since historical records are kept in the database, the statistical data of the environment can be obtained. Measures in the system will provide information early on, so that precautions can be taken without fire, flood or other disaster. The total cost of the system is low because the hardware used in the work is cheap. In this case the user provides a separate convenience. In the current system, the gateway node must be connected to the personal computer. In the next study, the SIM900 GPS/GPRS module will be connected to the gateway node to provide independence for this node.
Here are a few suggestions as to where to use the system. It can be used in systems, pharmacies, food agriculture and animal husbandry applications, products subject to cold chain, hospitals, greenhouses, systems and archive rooms. In addition, this system can be set up for the classes so that the classes can be controlled and the class can be determined by the obtained audio information whether the class is empty/full or not. As a result, the system can be used in all systems and applications where temperature, humidity, sound and water level information is required.