Smart Tree Care System with Internet of Things

The main aim of this study is to develop a smart system to monitor and control the soil condition of the street trees in a smart city. In this proposed system, a wireless sensor network was developed to collect the soil condition of the trees, an automatic irrigation system was constructed for watering street trees and a graphical user interface was developed to evaluate the performance of the system. NodeMCU ESP8277 is being interfaced with a moisture sensor for the volumetric water content in soil, humidity and temperature sensor for the surrounding environment, rain sensor for detecting rain and relay to control the valves. MQTT broker is used to acquire the data and control to and from NodeMCU ESP8266 and to be interfaced wirelessly with the Node-Red. Thus, the system is controlled and monitored wirelessly with the help of the developed integrated Graphical User Interface. A secured wireless communication system for data transmission was achieved by using NodeMCU ESP8266 and raspberry pi microcontroller. The graphical user interface was built in Node-Red which is IoT platform to evaluate the performance of the system, it displays the data in an interactive method and it can be used for controlling the irrigation system remotely. The data were transmitted with no delay or losses of data and the system was controlled automatically and remotely.


INTRODUCTION
Street trees are one of the most common infrastructures in an urban area.They are available in cities and towns throughout the globe.Even though street trees are not something rare, yet people know only little benefits that street trees can bring to us.The main benefit that street trees provide, is the improvement to the environmental conditions.Trees absorb carbon dioxide and therefore able to reduce the greenhouse effects (Lazim and Misni, 2016).Other than that, street trees are able to provide mental comfort to the people in the urban area, hence reducing the possibility of accidents happening, because people tend to drive slower in that area.Furthermore, the presence of street trees in housing area can increase the property price in that particular area, as compared to housing areas with no trees at all (Kadir and Othman, 2012) However, without proper monitoring and maintenance, street trees can cause harm to the citizens.Overgrown street trees might fall during bad weather and it may cause serious accidents to the road users (Berlian et al., 2016).The worst case happens when the fallen trees cause accidents which take away lives.
Based on statements from city councils, such as Shah Alam City Council and Subang Jaya Municipal Council, in Malaysia, there are around 200 to 300 cases of fallen trees/year (Sreetheran et al., 2011).To avoid or decrease the tree fall incidents, regular maintenance must be done on the trees (Soares et al., 2011).
Street trees are becoming more to a requirement instead of an option to the people.It is understandable that people wish to have more street trees in the urban area, however, the costs behind maintaining the trees are actually quite high.Multiple aspects affect the costs of maintaining the trees and the maintenance also requires manpower and resources.Hence, street tree maintenances are always considered as less-essential component in a city planning or budgeting (Soares et al., 2011).Developing a smart system for taking care the street trees can save high amount of maintenance costs.By utilizing proper sensors and actuators, some simple maintenance can be done automatically (Ferrández-Pastor et al., 2016;Gutierrez et al., 2014).For example, by checking the wetness of the soil, a simple automatic irrigation system to water the trees whenever necessary can be configured (Daniel et al., 2015).Trees are usually strong and durable unlike garden flowers.Most of the time, it is sufficient to water the trees to keep them maintained for a quite long time.This can save the labour and equipment costs and the time needed to do it manually (Madli et al., 2016;Suba et al., 2015).
A smart system should be able to run under minimum human interaction as well (Rama Mohan Babu and Srinivasu, 2016;Mrinmayi et al., 2016).To achieve this, information transmission and handling must be included in the system.In this era of technology, Internet of Things (IoT) are becoming more and more common in most area.The ability and versatility of IoT in information management allows users to use it in different areas (Ahlgren et al., 2016;Tope and Patel, 2016).
A smart irrigation system developed by Daniel et al. (2015) was able to detect the soil moisture level and activate the sprinkles.This method reduces the water spent while still satisfying the need of the plants.However, this system has a weak communication technique and there was no cloud reporting method to allow users to monitor and control the systems remotely (Daniel et al., 2015).
Another smart irrigation system through wireless sensor network developed by Suba et al. (2015) provided an effective power management system using low voltage circuit and solar panel to control and power up the system.While the system had a graphical user interface to monitor the data but failed to allow users to access into the monitoring system from offsite (Suba et al., 2015).
Thus, the proposed system is aimed in developing a smart system to monitor and control the condition of the street trees in a smart city by the implementation of IoT.As a first step a wireless sensor network is designed to collect the soil condition of the tress, followed by the construction of an automatic irrigation system for watering the street tress.Further, an algorithm is developed to analyse the data collected and action taken using the controller, wirelessly.Finally, a Graphical User Interface (GUI) is developed to monitor and evaluate the system performance.

Smart irrigation system:
The focus of the irrigation system is to implement the drip irrigation and to be able to turn on the system automatically when the predefined conditions are met.To achieve this, different sensors are used to monitor the condition of the soil.The information about the soil is collected and sent to a simple Arduino based controller and transceiver, NodeMcu ESP8266.The controller is compatible with the sensors used in the system and is able to receive and send information wirelessly.By programming the controller, it sends out signals to turn ON and turn OFF, whenever the pre-defined conditions are met.
Figure 1 shows the block diagram of the irrigation system which consists of the pipes and valves.The main component needed to be controlled are the valves.Valves are essential and simple components in controlling the flow of the water.The water source is installed at the beginning of the system and is connected to the respective area of soil with pipes.Valves are installed before the irrigation area and by controlling the opening and closing of valves, the irrigation process is controlled.Different areas might With simple modification on the pipes, the concept of drip irrigation is fulfilled.Drips irrigation are able to water a large area of soil with minimum amount of water.Modifications are done on the pipes, where the end of the pipes are sealed off and dripping holes are made along the side of the pipes.When water flows through the pipes, it will drip from the side of the pipes, covering a large area with only a small amount of water.
An additional feature installed on the water source is the rainwater collector.A lid is installed on the water source tank and it is controlled to open or close using a stepper motor.The motor is connected to the controller and is controlled using the information from a rain sensor.Whenever rain is detected, the lid will be opened, allowing rainwater to fill up the water source tank.This helped in saving the amount of water used to refill the water tank.

Wireless sensors network:
Sensors: In the proposed system, there are three sensors to be implemented which are soil moisture sensor, humidity and temperature sensor and rain sensor.These sensors are to be connected to Nodemcu ESP8266 microcontroller.

Wireless communication system:
In this section, the proposed methodology shows the method of achieving the wireless communication system and the GUI of the smart tree care system as shown in Fig. 2 and 3.
Figure 2 shows the flowchart of the wireless communication system with the GUI and it starts by connecting the system with the internet and if the username and the password inserted for the internet are correct, then the system will be connected.The IP address will be printed to show the connections with the internet, then the MQTT broker will be set up through different process as it has username and password for secured data transmission.The data will be collected and sent to the MQTT broker and the process continuous with the GUI.
Figure 3 shows the block diagram of the wireless communication system with the GUI, it shows the flow direction of the data.The GUI is developed in Node-Red platform which is an IoT platform and it can receive and send data from and to the MQTT broker.The MQTT broker is being hosted by Raspberry pi and No-IP server which is Dynamic Domain Name System (DDNS).
The communication between the MQTT broker, the GUI and the Nodemcu ESP8266 is through the internet as shown in Fig. 2. The Nodemcu ESP8266 is supported with built in antenna and it is the main microcontroller which collects the data form the sensors and processes it.It analyzes the data and gives commands to the valve for automation control.Also, it receives data from the MQTT broker for remote control while the commands are sent from the GUI by the user.
Integrated system: A complete flow of the proposed integrated system is shown in Fig. 4. First, the reading from the rain sensor is collected.If the rain is detected, a control signal will be sent out to open the water tank lid, allowing rain water to fill the water tank.After that, the readings from the temperature and humidity sensor are collected.The temperature and humidity of the surrounding will not affect any changes in the decision making, because the effect of these values indirectly affect the moisture level.The final decision of whether to open the valve or not still depends on the moisture level detected.
When collecting readings from the moisture sensor, a few conditions are analyzed.First, the moisture level should never be lower than 0%.When this happens, it means that the sensor is faulty and maintenance should be done to check the problem.If the moisture level detected is higher than 50%, it means that the soil moisture level is still sufficient, therefore no changes will be made and the system will proceed to the next loop from the beginning again.When the moisture level detected is lower than 50%, control signal will be sent to open the solenoid valve at the respective area.An alternative way of turning on the valves are through the GUI.Manual control of the valves could be done using the switches on the GUI.All the readings and data are to the MQTT server through the ESP8266 module and the values are updated and displayed on the GUI.Graphs of the values are plotted against time, to display the overall condition of the soil throughout the day.and hence chosen to be used to design the GUI of the proposed project.

Graphical User Interface (GUI) design
Figure 5 shows the GUI designed and it displays the data of the proposed system in different forms.The charts are designed to show the changes of the received data for the last 1 h.The user can use this GUI to control the irrigation system of the trees through the valve switches.The system proposed works automatically and the water valves are opened when there is a need for the water only, but in case if the user wants to control the valves remotely, it can be done through the switches designed for that purpose.

RESULTS AND DISCUSSION
Figure 6 shows the complete setup of the prototype implemented along with the labelling of each part.The different sensors used in the implementation of the prototype are shown in Fig. 7. Humidity sensor testing is carried and the set up to carry out the same is shown in Fig. 8, in which the humidity sensor is inserted into the dry soil.The sensor readings are given as input to the controller and the controller determines whether the soil humidity is below the desired level and if so, opens the solenoid valve and waters the soil.
The temperature and humidity sensor and the rain sensor can be placed anywhere if there are no external factors affecting the readings.For example, there should not be any heat source near the temperature and humidity sensor and no leakage or water falling on the rain sensor.The readings taken from the sensor were sent to the MQTT server through the ESP8266 and displayed in the GUI.The GUI can be accessed from any laptop, as long as it connects to the correct address.
The ESP8266 module is where all the sensors were connected to and acts as a center where all the readings from the sensors are collected.The readings are converted using suitable algorithm whenever required.All the readings collected and processed are then sent to the MQTT server.Figure 9 shows the connection of the ESP8266.
Figure 10 and 11 shows the results of the proposed system from the sensors displayed through the GUI developed.From the GUI, users are able to know the current condition of the area, including temperature, humidity, moisture level and the presence of rain.Graphs are also plotted based on the readings obtained, allowing the users to trace back the condition of the area at during the past.Manual control of the solenoid valves are also available from the GUI.By clicking on the switch on the GUI, command will be sent to open the respective solenoid valve.

CONCLUSION
Thus, the smart tree care system was developed and tested successfully.A smart irrigation system for watering street trees was developed to work automatically based on the analyzed data by the microcontrollers and remotely controlled by the user from the GUI.A wireless sensor network for collecting the soil conditions was designed and developed to collect the surrounding environment status as well.A sustainable algorithm for input and output data analysis was developed and the data were analyzed with high accuracy.A secured wireless communication system for data transmission was achieved by using NodeMCU ESP8266 and raspberry pi microcontroller.The data were transmitted with no delay or losses of data.Moreover, the GUI was built in Node-Red, which is an IoT platform to evaluate the performance of the system.It displays the data in an interactive method and it can be used for controlling the irrigation system remotely.

Fig. 2 :
Fig. 2: Flowchart of the wireless communication system require a different amount of water.Therefore, sensors and valves are deployed in different areas, controlling the irrigation separately.With simple modification on the pipes, the concept of drip irrigation is fulfilled.Drips irrigation are able to water a large area of soil with minimum amount of water.Modifications are done on the pipes, where the end of the pipes are sealed off and dripping holes are made along the side of the pipes.When water flows through the pipes, it will drip from the side of the pipes, covering a large area with only a small amount of water.An additional feature installed on the water source is the rainwater collector.A lid is installed on the water source tank and it is controlled to open or close using a stepper motor.The motor is connected to the controller and is controlled using the information from a rain sensor.Whenever rain is detected, the lid will be opened, allowing rainwater to fill up the water source tank.This helped in saving the amount of water used to refill the water tank.

:
Fig. 3: Block diagram of the wireless communication with the GUI

Fig. 7 :
Fig. 7: Different sensors used in the implementation