IoT based autonomous percipient irrigation system using raspberry Pi

0 downloads 0 Views 1MB Size Report
Abstract—This paper propounds a design for automatic water supplying system in farmland using raspberry pi 3, Arduino microcontrollers, WiFi module, GSM ...
19th International Conference on Computer and Information Technology, December 18-20, 2016, North South University, Dhaka, Bangladesh

IoT based Autonomous Percipient Irrigation System using Raspberry Pi Ahmed Imteaj1,2, Tanveer Rahman1, Muhammad Kamrul Hossain2 and Saika Zaman2 1

Department of Computer Science and Engineering, 1International Islamic University Chittagong Department of Computer Science and Engineering, 2Chittagong University of Engineering & Technology Chittagong, Bangladesh. Email: [email protected], [email protected], [email protected], [email protected] 2

Abstract—This paper propounds a design for automatic water supplying system in farmland using raspberry pi 3, Arduino microcontrollers, WiFi module, GSM shield, relay boards and couple of sensors. The components we used in our system ensures overall fecund, scalable and spirited implementation. Depending upon the moisture level of farmland and daylight intensity, the system can detect the appropriate time of water supply in the trees and can also keep track of the water level to prevent water from being accumulated around the roots of the saplings. The analog data received from the sensors are transmitted by Arduino as digital signal via Wifi Module to the Raspberry Pi 3. The system is able to notify the administrator if water shortage arises in the main water supply and an administrator can also communicate with the system by sending SMS (Short message service) of a particular keyword. This system can be applied in farmland as well as small pot plants. Using this system, a very promising outcome is found in sustaining and cherishing the plants in a more scientific way. Keywords—Farmland; water supply; Raspberry Pi; WiFi module; sensors; Arduino; water shortage; notification.

I.

INTRODUCTION

Trees are the best friends of humankind. But, day by day trees are decreasing because of deforestation. Although trees are being planted in large numbers by the conscious people, a portion of those planted die as a result of unplanned forestation and lack of proper care. Many people lose their interest in gardening because it needs a lot of efforts to properly maintain the seedlings. Moreover, lack or abundance of rain can cause damage to the upbringing of the trees. Therefore, an automated and quantified system to take care of plants can be a vital tool. This paper sheds light on an implementation of an automatic water supplying system. There are a number of reasons for choosing it. Water is the source of the most important nourishment for the trees. Without water, they can’t survive, whereas the inaccurate supply of water can also lead to many complications. For instance, water accumulated for a long time around the roots of a sapling may damage the roots and can also cause mineral loss in the soil. Moreover, the amount of water to be supplied to the trees depends upon the soil humidity and sunlight availability. Any error in this regard will cause harm to their upbringing. Therefore, measuring the correct condition of the soil and environment is critical in determining the proper quantity of water needed for the plants.With the help of Arduino sensors and GSM shield, controlled by Raspberry Pi 3 microcomputer, we designed a

978-1-5090-4090-2/16/$31.00 ©2016 IEEE

system to automatically sprinkle accurate amount of water by detecting soil moisture, daylight intensity and water level. Each type of plant needs different soil moisture for smooth growth. Hence the soil moisture is a key variable that can be used to determine the quantity of water needed. Besides, the availability of the amount of daylight is also very crucial for a tree. Wrong timing of watering can cause more harm rather than benefit. The experiment required Arduino sensors, Raspberry pi 3 and pipe to supply water from tank controlled by a gate. Moisture sensor was installed near the roots and daylight sensor was installed further away to clearly detect the sunbeam. These sensors send their data to the raspberry pi to analyze. If a predetermined condition is found, then the Raspberry Pi would command a microcontroller to open the gate of water supply until the moisture value becomes greater than the threshold value. If there is a problem in the main water supply, then the computer will notify the administrator using GSM shield connected to the computer. Besides, the administrator can control the system’s functionality using the same protocol sending a particular keyword command. This scientific method of water supply can be expanded to use in any agricultural sector. It will encourage people in tree plantation and will dramatically decrease the death rate of seedlings. II.

RELATED WORKS

Numerous researchers have worked with automatic water sprinkling or irrigation system. They opted for different metrics for determining the soil condition and quantity of water. They also discussed about different sources of power for the sensors. Besides, the technology for creating network among the sensors and design of control system were also heavily discussed by the scholars. An article on the automated water supply system for urban residential areas showed that such a system can be used to effectively manage water resource [1]. The paper discussed about different technologies that can be used in the implementation of the system. In this paper, a similar system is discussed that will distribute water to trees or agricultural land. An irrigation system using a wireless sensor network and GPRS was implemented [2]. The authors used ZigBee protocols for networking. In this paper, our proposed system uses a GSM shield for SMS based communication and GPRS for data communication which strengthens the system’s control and management. Joaquín Gutiérrez et al. [3] developed an automated irrigation system.

563

ISBN 978-1-5090-4089-6

19th International Conference on Computer and Information Technology, December 18-20, 2016, North South University, Dhaka, Bangladesh

Fig. 1. Proposed system architecture.

Which was powered by photovoltaic panels. As, photocells alone cannot guarantee undisrupted power throughout day and night, our proposed system alternates between rechargeable battery power and power from the main supply line. Te authors in [4] published a work on control of an irrigation system using a distributed wireless sensor network. They used GPS to locate exact positing for sprinkling in large area and Bluetooth devices for wireless radio communication. Our system uses latest Arduino sensors and GSM shield, controlled by Raspberry Pi microcomputer which will improve the speed of communication and the accuracy of information. Besides, our proposed system does not use GPS and the sensors will be placed in the fixed locations by a supervisor. In [5], an implementation of an automatic irrigation system using wireless sensor networks (WSNs) has been explained. After discussing the entire system, they pointed out some future scopes for development of such system. They suggested that weather forecast information can aid in making more efficient decision regarding irrigation. Our system will make use of GPRS to get weather forecast data. It will help the administrator to be alert of rain and command the system to act accordingly. The author in [6] proposed a review paper on automatic irrigation system based on RF module. They pointed out some glitches with existing system like security problems and slow communication speed. In this paper, the proposed system uses a Raspberry Pi microcomputer and GSM shield, which provide a robust security and enable high speed communication. Karan et al. [7] discussed a sensor based automated irrigation system that used MAX232 dual driver/receiver, GPS, WSNs and microcontroller. All of these connected by the internet controls the entire system. The system is very efficient in a large scale, but its cost effectiveness reduces when applied in relatively small fields or gardens. Considering all these shortcomings, we propound a system through which any size of farmland can be irrigated with proper understanding of the conditions and communicating with the owner if any water shortage problem arises. The owner may also be notified about the current weather condition of the place where the system would be integrated

978-1-5090-4090-2/16/$31.00 ©2016 IEEE

and can also retrieve the sensor value and water pump status with a particular keyword. III.

SYSTEM IMPLEMENTATION

A. System Architecture The propounded system consists of one central raspberry pi microcomputer, Arduino microcomputers, different types of sensors, servo motor, relay modules, GSM shield, water pump and water tank (fig.1). The sensors are placed in various positions on land. We used soil moisture sensor, daylight sensor and water level sensor. These sensors send their data to the Arduino microcontrollers. The Arduino microcontroller receives analog data from the sensors. Several Arduino sensors are planted throughout the land for collecting data from sensors. After receiving data, the Arduino microcontrollers throws the data over IP via ESP-1 wifi module so that the raspberry pi can catch them. The audience in the field is also connected to a servo motor, so that it can control the water supplying gate. We used Raspberry Pi 3 microcomputer which has latest technology with very fast processing power. It also has wireless communication feature. The Raspberry Pi goes through each IP listed in it, requests for data, then it receives the data and processes them. An Arduino is set in the water tank connected with a water level sensor, which prompts the GSM shield if necessary. Our system uses a GSM shield to connect to the internet and communicate with the administrator through SMS service. It has a SIM card slot and through SIM it uses mobile operator’s GSM and GPRS service. The GSM shield uses GPRS to connect to the internet and find weather forecast. The weather forecast information helps to take precaution in determining the proper quantity of water. With all the received data, the raspberry pi computer makes the decision whether to supply water or not. If the conditions are met, the raspberry pi commands the relay module to activate the water pump for a specified duration after which the computer commands the relay module to stop the pump. Water is pumped to specific area, not the whole land area. The sensors provide all the data from which quantity of water and which pump to activate can be inferred.

564

ISBN 978-1-5090-4089-6

19th International Conference on Computer and Information Technology, December 18-20, 2016, North South University, Dhaka, Bangladesh

Fig. 2. Water Supply to the specific portion in the farmland.

The water level sensor located at the water tank provides data from which the remaining amount of water in the tank can be calculated. If remaining water is not sufficient for proper water supply then the computer commands the GSM shield to notify the administrator through SMS about water shortage. Also, several water level sensors are placed on the land to keep track of accumulated water. As some plants are prone to harm if water accumulates around their roots. The whole system will be communicating with each other by a wireless router.

the relay module that has been set in GPIO 18 pin of Raspberry Pi. Another Arduino has been positioned near the water tank attached with a water level sensor in the analog pin 0 on it. Whenever, the water level is low enough from the threshold value which has been set to 600, the Arduino prompts the GSM module to send a notification to the administrator.

B. Logic Design There are three different logics acts in three different sectors. For the Arduinos in the field, at first, we have selected specific pins for the three sensors, servo motor, LEDs and serial monitor port. After that, we have initialized soil moisture sensor, photo sensor, water level sensor as analog input and servo motor, greenLED and redLED as digital output. Two digital pins has been initialized to transfer and receive acknowledgement from ESP-1 wifi module. The system accepts values from sensors at regular interval and throws them over IP via ESP-1 wifi module. The controller processes the values and compares the with threshold value. We have taken the threshold value of soil moisture sensor, photocell sensor and water level sensor as 950, 500 and 200 respectively.

Fig. 3. Logic diagram of operation of Arduino.

The power on of the red LED indicates that the plant needs water at the moment and the relay will be turned into active high. The power on of the green LED indicates that the plant does not need water and the relay will be turned into active low. When the value meets with the threshold values the Arduino opens or closes the watering gate. On the other end, the Raspberry pi keeps traversing each Arduino by their IP that has been listed in the Raspberry pi. Whenever it gets to an Arduino, it asks for sensor data. Raspberry gets the sensor data and compares them to threshold values given in it which is as same as the Arduino and takes decisions whether to active HIGH or active LOW

978-1-5090-4090-2/16/$31.00 ©2016 IEEE

Fig. 4. Logic diagram of controlling of Raspberry Pi.

565

ISBN 978-1-5090-4089-6

19th International Conference on Computer and Information Technology, December 18-20, 2016, North South University, Dhaka, Bangladesh

A. Steps of Implementation: Step 1 (Configuring the Programmable Devices): Setup the programmable devices- Raspberry Pi 3, Arduino Uno, ESP-1 Serial to Wi-Fi Module and Arduino GSM Module SIM 808, Wireless Router according to their documentation. Configure the SIM 808 GSM Module in GSM mode ESP-1 with Wi-Fi SSID and password in wireless router.

Fig. 5. Logic diagram of notification system.

IV.

SYSTEM IMPLEMENTATION

In this propounded system, we used two types of microcontrollers- Raspberry Pi 3 and Arduino Uno. Code written for the Arduino imported in every Arduino-Uno with specific IPaddresses. The analog reading of the sensors are passed to their respective Arduinos and then the analog data is converted to digital data for the further data transmission to the Raspberry pi. Python programming language has been used for processing the commands at Raspberry pi that retrieves the sensor reading from Arduinos. By analyzing these values, Raspberry pi 3 will turn the relay module on or off. The Arduino-Uno Rev3 is the micro-controller that will be acting as Server in the proposed system. The Raspberry Pi 3, which is the main controller client in the proposed system has 1.2Ghz 64-bit quad-core ARMv8 CPU, 1GB ram, 4 USB ports, a built in Ethernet port and 40 GPIO pins which can read and write digital data. We have used Raspberry Pi 3, because it has built in wireless module which has 802.11n wireless LAN and Bluetooth 4.1 with BLE feature by which we can transmit the data through the WiFi module. For implementing the system, FC-28 soil moisture sensor module has been used that senses moisture in soil and writes an analog data on the Arduino. It has two output ports named A0 and D0. A0 gives an analog output which alters according to the moisture of soil. D0 supplies a digital output which is 1 if there is moisture in the soil or otherwise shows an output 0. A Water Level Sensor manufactured by Funduino has been used to measure the water level in the field and in the water tank that will be connected to the Arduino. It possesses 3 pins which are- VCC, GND and Signal. The signal pin transmits analog signals whenever it is powered up. The sensor acts when the level of water level rises or decreases. Only 5v and less than 20mA are needed to operate this sensor. For detecting daylight, Photo Cell has been used that reacts to light. It is capable of sending analog data to Arduino according to the intensity of light falls on it. ESP01 Serial to Wi-Fi Module can be used in each Arduino-UNO to send sensor data from Arduino to Raspberry Pi 3 wirelessly. The Arduino GSM Module has SIM 808 chip in it, which can send notification via SMS to cell phones during the shortage of water in water storage. A single channel relay is needed to make a connection with the Raspberry Pi 3, which will trigger the water pump during the shortage of water in the field. Several servo motors will be used to serve water in the right path when there is a shortage of water. A Wireless Router is used to let Raspberry Pi 3 to communicate with Arduinos.

978-1-5090-4090-2/16/$31.00 ©2016 IEEE

Step 2 (Burning Code in the Sketch of Arduino and Setting up code in Raspberry Pi 3): The code written for Arduino needed to be burned in the sketch of each Arduino with unique MAC and IP address. The Python program written for asking Arduino for sensor data should be kept in the user space of Raspberry Pi. All the IPs of the Arduinos should add in the list named ‘ip’ in the program. Step 3 (Plugging the Sensors): Hook up each Arduino with a Soil Moisture Sensor, Photo Resister and Water Level Sensor in the A1, A2, A3 pin of Arduino. Power up the sensors from Arduino’s VCC and GND Pin. Step 4 (Setting up water sufficiency system): A GSM SIM should be inserted in the GSM Module. An Arduino should be imported with the code written for notifying water insufficiency to a predefined number. The Tx and Rx dedicated for GSM Module need be connect to the Rx and Tx of GSM Module. A Water level sensor need to place in A0 pin of Arduino to measure the water level in the water storage. Step 5 (Connecting Single Channel Relay): A single channel relay should be connected at GPIO 17 pin of Raspberry Pi. The relay can be powered up from the 3.3v and GND pin of Raspberry Pi 3 B+. Step 6 (Connecting Water Pump): The negative end of the Water pump should be directly connected to the power source. The positive end of the water pump should be connected to the port that’s triggered for 1 in signal pin. Another copper wire connection should be established between positive end of power source and middle port of the Relay. Step 7 (Constructing the water path and Positioning the wireless router): The water should be passed through the whole farm field till the edge with a pipeline. The pipe will have holes in it, which will be closed with gates. The gates will be controlled by servo motors. Each motor will be connected to the Arduino assign in that part at D13 pin. A wireless router should set at the point where it can reach all the Arduinos within its range including the Raspberry Pi 3. Step 8 (Powering up all the devices): The main devices that should be powered to run the project are Raspberry Pi 3, Arduinos, GSM Module, the wireless router and the water pump. As it’s an outdoor field system and none of the devices without water pump needs more than 12 v and 2.5 A, the power could be easily generated via solar panel. A 21.5 x 17.25 x 1.125 inch solar panel of 30W will generate enough power to charge a 12v 2.5A DC battery and later it can power up all the devices. The Arduinos in distance could be powered up with batteries that can generate 5v and 500mA current and can be charged small solar panels of 130mm*150mm size with 2.5W.

566

ISBN 978-1-5090-4089-6

19th International Conference on Computer and Information Technology, December 18-20, 2016, North South University, Dhaka, Bangladesh

V.

EXPERIMENTED RESULT

After assembling our system, the reading of the sensors has been checked. We have tested the system response in different situations. The interfacing of Raspberry Pi with Arduino, sensors, relay and motor pump is shown in fig. 9 and readings of sensor values and water pump status in different situations are displayed in fig. 10.

Fig. 6. Circuit diagram of Arduinos in the field.

Fig. 9. Interfacing Raspberry Pi with Arduino, sensors, relay and motor pump.

Fig. 10. Sensor values and water Pump status displaying in LED. Fig. 7. Circuit diagram of Raspberry Pi for controlling Water Pump.

TABLE I.

IF-THEN FUZZY RULES TO FIND OUT RELAY STATE

Daylight (>500)

Water Level (>200)

Moisture (>950)

Signal to Relay

Yes

Yes

Yes

Active Low

Yes

Yes

No

Active Low

Yes

No

Yes

Active High Active Low

IF

Fig. 8. Circuit diagram of the alarming system during water lacking.

978-1-5090-4090-2/16/$31.00 ©2016 IEEE

THEN

Yes

No

No

No

Yes

Yes

Active Low

No

Yes

No

Active Low

No

No

Yes

Active Low

No

No

No

Active Low

Here, (Daylight > 500), (Water level > 200) and (Moisture > 950), considered as 1. Therefore, IF sensor reading is YNY (101), THEN the state of the relay is active high. Otherwise for the remaining seven combinations, the relay state is active low.

567

ISBN 978-1-5090-4089-6

19th International Conference on Computer and Information Technology, December 18-20, 2016, North South University, Dhaka, Bangladesh

We have plotted our data considering different moisture values and photo sensor values during high photocell value which is shown in fig. 11. In the figure, X-axis resembles relay state and y-axis pointed the value of the moisture and photo sensor. Again, we have blocked in our data considering different water level values and previous relay state in fig. 12. We have taken relay state in X-axis and y-axis indicated the value of the water level and previous relay state. Here, we have considered the on state of the relay as 100 for better understanding of the graph. 1200 1000 800 Moisture Level PhotoCell

600 400 200 0

RBAIS [12]

300 250 200 150 Water Level Relay Prev.

0

Off On On On Off On On On Off Off

Relay Fig. 12. Change of relay state considering water level and previous relay state. TABLE II.

COMPARISON WITH OTHER RELATED WORKS

Related Works ADIS [8]

Limitations

Overcomes by our system



Not capable of supplying water to a particular area.



APWC [9]



Used FPGA for deployment of the system. The system is not capable for large farmland as there is no core controller.



The system is not designed for instant startup and shut down of waterpump. The system is not suitable for large farmland and uses a PIC controller.



TEG has been used for sensing soil moisture which is costlier. Separate amplifier needed.





ACIS [10]





AISTG [11]

• •

978-1-5090-4090-2/16/$31.00 ©2016 IEEE



Has a water lacking alert system.

The automatic water enduing method described in this paper can ensure a systematic and scientific approach in taking care of plants which can dramatically improve productivity. Such a system can easily be made and it is not very costly. With the improvement of sensor technology, the system will become more efficient and useful. For instance, a more accurate weather forecast can help better decision making in supplying water and reducing water wastage. If soil nutrition measuring instrument can be installed, then the system can be re-engineered to make it able to supply fertilizer to the land precisely. To conclude, the system will help utilizing water resource wisely and reducing the human effort in maintaining crops which will consequently decrease damage from human errors. REFERENCES

Fig. 11. Change of relay state envisaging soil moisture and photo sensor values in case of photocell value is high.

50

No water shortage notification system.

CONCLUSION

On Off Off Off On On Off Off Off On Relay

100



The whole system is controlled by Raspberry pi 3, which will take action, particularly where water is needed. The system uses Arduino Uno and Raspberry Pi 3 which are the latest microcontroller board and Raspberry pi 3 acts as the core controller in our system. The system is designed for instant supply of water, turning on and off the motor without delay and the system is designed for any size of farmland as it uses Raspberry Pi controller. FC-28 is used for sensing soil moisture, which is less costly,more efficient and no external amplifier needed.

[1]

N.B. Bhawarkar, D.P. Pande, R.S. Sonone, Mohd. Aaquib , P.A. Pandit, and P. D. Patil, “Literature Review for Automated Water Supply with Monitoring the Performance System”, International Journal of Current Engineering and Technology, Vol. 4, No. 5, Oct 2014. [2] Suraj S.Avatade, Prof.S. P. Dhanure, “Irrigation System Using a Wireless Sensor Network and GPRS”, International Journal of Advanced Research in Computer and Communication Engineering, Vol. 4, Issue 5, May 2015. [3] Gutiérrez, Joaquín, et al. "Automated irrigation system using a wireless sensor network and GPRS module." IEEE transactions on instrumentation and measurement 63.1 (2014): 166-176. [4] Kim, Yunseop, Robert G. Evans, and William M. Iversen. "Remote sensing and control of an irrigation system using a distributed wireless sensor network." IEEE Transactions on Instrumentation and Measurement 57.7 (2008): 1379-1387. [5] Dhanoa, Ravinder Singh, and Ravinder Singh. "INTERNATIONAL JOURNAL OF ENGINEERING SCIENCES & RESEARCH TECHNOLOGY Automatic Irrigation System using WSNs." [6] Rane, Ms Deweshvree, P. G. Scholar-VLSI, and Sevagram BDCE. "REVIEW PAPER BASED ON AUTOMATIC IRRIGATION SYSTEM BASED ON RF MODULE." (2014). [7] Kansara, Karan, Vishal Zaveri, Shreyans Shah, Sandip Delwadkar, and Kaushal Jani. "Sensor based Automated Irrigation System with IOT: A Technical Review." [8] Anand, Koushik, et al. "Automatic drip irrigation system using fuzzy logic and mobile technology." Technological Innovation in ICT for Agriculture and Rural Development (TIAR), 2015 IEEE. IEEE, 2015. [9] Primisima, Ima, Sunny Arief Sudiro, and Bheta Agus Wardijono. "Automatic plant watering controller component using FPGA device." 2015 International Conference on Advanced Computer Science and Information Systems (ICACSIS). IEEE, 2015. [10] Bhaskar, Lala, et al. "Automatic crop irrigation system." Reliability, Infocom Technologies and Optimization (ICRITO)(Trends and Future Directions), 2015 4th International Conference on. IEEE, 2015. [11] Bathan, Jazelle Paula M., Ma Carla Angelica R. Belen, Paula Jianelli M. Lao, Jasper C. Tiu, and Enrique M. Manzano. "AUTOMATED IRRIGATION SYSTEM USING THERMOELECTRIC GENERATOR AS SOIL MOISTURE DETECTOR." (2013). [12] Rane, Ms Deweshvree, P. G. Scholar-VLSI, and Sevagram BDCE. "REVIEW PAPER BASED ON AUTOMATIC IRRIGATION SYSTEM BASED ON RF MODULE." (2014).

568

ISBN 978-1-5090-4089-6

Suggest Documents