Iot Backyard: Smart Watering Control System: Abstract - Nowadays, Cropping Own Organic Homegrown

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

2018 Seventh ICT International Student Project Conference (ICT-ISPC)

IoT Backyard: Smart Watering Control System


Pareena Jariyayothin1, Kachaporn Jeravong-aram2, Nattakarn Ratanachaijaroen3,
Thitinan Tantidham4, Puwadech Intakot5
Faculty of Information and Communication Technology, Mahidol University
Nakhonpathom, Thailand
{pareena.jar, kjeravongaram, nattakarn.rata}1,2,3@gmail.com, {thitinan.tan, puwadech.int}4,5@mahidol.ac.th

Abstract— Nowadays, cropping own organic homegrown II. LITERATURE REVIEW


plants for health and safety are becoming increasingly demands
for many people. However, some of them do not have time to take A. Related Work
care the plants. Therefore, this project introduces an IoT M. S. Gavali et. al. [2] proposed an automated irrigation
Backyard system as a gardening tool to monitor and control system to ensure proper use of water. The microcontroller is
watering for homegrown plants. We apply the Internet of things based on PIC16F877A equipped with an RTC DS1307, a
(IoT) and affordable technology and focus on soil-based plant with
ZigBee radio modem and a GSM module. It receives data from
a water tank and tap. The system is divided into 3 parts: (1)
microcontroller system composites of NodeMCU V3 for sending
sensors of YL-69 for soil-moisture and DS18B20 for
and receiving sensoring data to and from the Firebase and transfer temperature sensor via ZigBee and shows these data on LCD
data to Arduino UNO to control watering sensors, (2) the Firebase display. They used the temperature and soil-moisture thresholds
system performs as a NoSQL database system to collect and store to switch on and off water pump. Users could monitor the values
monitoring sensor data as well as plant profiles set by users, and of sensors via Android application.
(3) IoT Backyard mobile application, users can choose or add H. Gupta et. al. [3] deployed IoT for an automated precision
plant profiles to crop, monitor water sensoring data, and switch on farming system based on Arduino UNO attached with the
or off the automated watering plant. The results show our design
sensors of pH and YL-69 soil moisture. The IoT server receives
prototype, water control testings, power consumption and cost
estimation.
these two sensors data and forwarded them as a message to the
farmers. The farmers can set the maximum and minimum
Keywords—Internet of Things; Homegrown Plant, Irrigation threshold values to water the plants. If the soil moisture goes
System; NodeMCU V3; Arduino UNO; Firebase below the minimum threshold, the system will the motor to start
the irrigation system.
I. INTRODUCTION
Nowadays, Thailand government promotes the policy of H. Kuruva et. al. [4] applied Dynamo database through
Thailand 4.0 to drive Internet of things (IoT) through smart AWS IoT platform for remote plant watering and monitoring
device and system development for every sector of industry and system. They deployed Arduino UNO to read sensors of the
business in everyday life, especially to improve the agriculture water level and soil moisture and to forward the sensor data to
sector. Additionally, His Majesty King Bhumibol Adulyadej Raspberry Pi running a nodejs application with the Johnny-Fibe
philosophy of sufficiency economy and sustainable library and AWS IoT SDK for javascript in order to
development advocates Thai society to grow vegetables, fruits, communicate to AWS. The Raspberry Pi is also used for
and herbal plants for household consumption. Many people showing sensor data on LCD screen and controlling the water
demand increasingly to crop own organic homegrown plants for pump motor. Furthermore, they designed the web application to
health and safety [1]. However, some of them do not have time visualize the data from Dynamo database and to allow users to
to take care the plants. Therefore, IoT Backyard is developed switch on and off the water pump.
for monitoring and controlling water for soil-based plant. Users M. Santra et. al. [5] proposed water monitoring and pump
can setup plant’s profile via the IoT Backyard mobile controlling system based on Arduino Uno equipped with
application. ultrasonic HC-SR04. This ultrasonic sensor detects the level of
water and sends a command to the Arduino via ASK RF
The remainder of the paper is organized as follows. Section transmitter to the water pump for starting or stopping the water
2 reviews related work. Section 3 and 4 describes the IoT pump.
Backyard system architecture and the watering control system. For our project, IoT Backyard system is designed based on
Section 5 provides implmentation setup and results. Finally, Arduino UNO and NodeMCU V3 and applies the soil moisture
Section 6 concludes our work and provides the future work. and temperature sensors similar to the related work. But we
deploy the Firebase as a NoSQL database to save the real-time
soil moisture and temperature values for each plant. We use
ionic framework to develop user interface for IoT Backyard
mobile application to allow the users to choose plant to crop and
to setup each plant’s profile. Therefore, our system can support
watering control for multiple plants. Moreover, the overall
investment cost of this project is applicable.

978-1-5386-7805-3/18/$31.00 ©2018 IEEE


2018 Seventh ICT International Student Project Conference (ICT-ISPC)

III. SYSTEM ARCHITECTURE B. Firebase system


Figure 1 illustrates the IoT Backyard architecture. It is Firebase [6] system acts as a NoSQL Database for collecting
divided into three parts: Microcontroller system, Firebase data from IoT Backyard sensors as a record of timestamp
system, and IoT Backyard application. from RTC, temperature, soil moisture, and water tank level
and report them to the users via IoT Backyard mobile
A. Microcontroller System application. It also maintains plant profiles setup by each
We deploy 2 microcontrollers: Arduino UNO and user to control watering for each plant.
NodeMCU V3. Arduino UNO is equipped with the sensors of
temperature (DS18B20), soil moisture (YL-69), ultrasonic C. IoT Backyard Mobile Application
sensor (HC-SR04), and real-time clock (DS3231). The Arduino IoT Backyard Application is developed by Ionic framework
UNO is attached to NodeMCU V3 via RX/TX interface in order [7] with libraries of AngularFire2 for mobile and Firebase
to send data from these sensors to NodeMCU V3. NodeMCU system communication, Cordova-plugin camera for taking a
V3 has a Wi-Fi interface to connect an access point coupling plant’s picture and record it user note and plant’s profile, and
with the Internet to forward data from sensors the Firebase ng2-charts for visualization.
system as well as to receive the watering thresholds from the
Firebase and forward them to Arduino UNO.

FigFig. 1. System
1. System Architecture
Architecture of IoT
of IoT Backyard
Backyard

஺஽஼
IV. WATER CONTROL SYSEM Ψܵ‫ ݁ݎݑݐݏ݅݋ܯ݈݅݋‬ൌ ͳͲͲ െ ൈ ͳͲͲ.
ଵ଴ଶଷ

In our project, homegrown plants generally can be


classified for the water needs into three levels as described in
A. Soil Moisture (YL-69) Table I. We will let the user to choose one of three levels and
As mentioned in Section II, we use two sensors of (1) soil define the threshold in the percentage of soil moisture via the
moisture or the hygrometer YL-69 [8] to detect the soil IoT Backyard application, denoted by Th*Sm in the flowchart
humidity and (2) ultrasonic HC-SR04 to detect the water to control the output solenoid valve [9] for watering plant.
level in the tank by using the distance between the water and
the ultrasonic.
TABLE I. THREE LEVELS OF SOIL MOISTURE IN ADC AND THE
YL-69 is set up by two pieces, one the electronic board PERCENTAGE VALUES FOR YL-69 SENSOR
and another one the probe with two pads for detecting the
water content. It is an analog sensor. Arduino UNO uses ADC Percentage Soil Condition
Analog to Digital Converter (ADC) from 0 to 1023. The 701 ~ 1023 31.5 ~ 0 Low
higher value of ADC is the lower humidity of the soil. We
report the value of soil moisture in the percentage as in 401 ~ 700 60.8 ~ 31.6 Medium
0 ~ 400 100 ~ 60.9 High
2018 Seventh ICT International Student Project Conference (ICT-ISPC)

respectively. In our system, we set a and b to 5 and 30 cm. It


B. Ultrasonic (HC-SR04) will use to control the input solenoid valve for pumping water
into the tank. However, the condition of the distance 30 can
be changed upon the tank.

Fig. 2. HC-SR04 installation and distance computation

HC-SR04 [10] is designed to measure a distance between


the source and target by using ultrasonic wave. In this project,
the HC-SR04 was attached on top of the tank to measure the Fig. 4. IoT Backyard system
distance between the top of the tank to the water in the tank. Figure 4 shows the overall of the IoT Backyard system
The more distance from sensor is the less water in the tank. prototype. Users need to attach a water tap to the water tank,
Figure 2. shows the HC-SR04 installation and the equation to the microcontroller box, and the plant pot with soil moisture
compute the distance in centimeter by using the duration of and water dripper.
ultrasonic wave from the time at transmitter and the time when
its return. V. IMPLEMENTATION SETUP AND RESULTS
TABLE II. HC-SR04 PERCENTAGE RELATIVE ERROR RESULTS A. Create JSON object and send to Firebase

Actual Result for Absolute Percentage


distance HC-SR04 Error Relative Error
10 cm 8 cm 2 cm 27
20 cm 17 cm 3 cm 17.65
30 cm 32 cm 2 cm 6.25

Table II presents the experiments to compare the actual


distances and the results computed from HC-SR04. For our
project condition, we use 20cm as the criteria for pumping
water to the tank. Percentage relative error is acceptable.
Fig. 5. JSON object at the Firebase system

Figure 5 (1) shows the JSON object at the Firebase system


to receive the sensor values from our microcontroller. Figure
5 (2) shows the program code at NodeMCU V3 to send the
sensor values to the Firebase system.

B. Monitoring Display on IoT Backyard Mobile


Application

Fig. 3. Flow chart of water controlling system

Figure 3 describes the watering control flowchart. Sm is


the current value of soil moisture reading from the soil
moisture YL-69 sensor and it is used to compare with the soil
moisture threshold (Th*Sm) to control the output solenoid Fig. 6. Monitoring Display Program
valve for watering plant control. dT is the current value of the
distance between the top and the water. a and b are the water
level near to the ultrasonic and the button of the tank
2018 Seventh ICT International Student Project Conference (ICT-ISPC)

Figure 6 shows the program written in Typescript. It • Figure 10 shows the monitoring page. Users can
describes the way to query all monitored values of soil monitor the current sensor values for soil moisture,
moisture (SoilMoisture) and water level in the tank temperature, and water level in the tank. Users can
(DistancePer) from the Firebase system and displays them in also choose the watering mode. If the mode is
a bar chart and a pie chart on IoT Backyard mobile switched to on, the watering will be automatic
application respectively. otherwise off will be for manual. This function will
be safe. If there are any problems with hardware or
water level in the tank.

Fig. 7. Wi-Fi and Firebase configuration at NodeMCU

C. Initial Setup
• As shown in Figure 7, users need to set up Wi-Fi
and Firebase authentication at the NodeMCU.
• On IoT Backyard mobile application, users have to
create an account by registering with their E-mail Fig. 10. Monitoring page
address and setting password as shown in Figure
8.
D. Water Control Testing Results
The application allows users to select the level of soil
moisture condition which is suitable for each plant. In our
experiment, we choose the basil. It needs to water regularly
but not to overwater. In this case, we choose medium level of
humid soil or around 31.6% - 60.8% of soil moisture. We set
the threshold 50%. Thus, the system starts to water the plant
if the soil moisture below or equal 50% and stop if it is over
50%.
E. Energy Consumption
For this project, we use two solenoid valves with 12V DC,
one Arduino UNO, and one NodeMCU. The total power
Fig. 8. Register and Log-in page consumption for our system is around 8.08 watts. If the system
is switched on for 24 hours in 1 month. Then we convert
• Figure 9 presents the plant’s profile interface. It wattage into electrical energy, we will get 5.8177 units. If the
contains a list of plants with a basic information and first 5 units is 4.96 Baht and the next 6 to 15 units is 0.7124
suggestion of how to grow each plant. These baht, thus the estimation of the total electricity charge per
suggestions include optimum temperature, soil month is around 26 Baht.
moisture content and types of fertilizer for the plant.
Users can press “PLANT IT” button to start to grow F. Cost Estimation
the selected plant. It also allows users to create a new For cost estimation, we used in this project consists of 11
plant profile. Each plant profile, users can take a tools; ESP8266, Arduino UNO, real-time clock (DS3231),
photo and note as well as the starting date of planting. temperature sensor (DS18B20), soil moisture sensor (YL-
Users can choose the level of soil conditions; Low, 69), ultrasonic (HC-SR04), 2 solenoid valves, 2 relay 12V
Medium, or High and define and at the threshold of DC, power supply, a prototype box, and stepdown. Thus, the
the chosen level for watering control.
total cost of IoT Backyard is estimated around 1800 Baht.

VI. CONCLUSION AND FUTURE WORK


This paper presented the IoT Backyard system for
watering control relied on soil moisture sensor and water level
in the tank. The IoT Backyard mobile application enables
users to setup the plant to grow and define the plant profile to
control the soil moisture condition and to monitor the current
Fig. 9. Plant’s profile page values of soil moisture and the water level in the tank. We
2018 Seventh ICT International Student Project Conference (ICT-ISPC)

believe that our prototype can be applied for any homegrown ACKNOWLEDGEMENT
plants. In the future work, we plan to add more sensors for N- The authors would like to thank National Software Contest
P-K, pH, and fertilizer controller, as well as to add a number
(NSC2018) for reward funding this project number
of soil moisture sensors according to the plant bucket size.
Furthermore, data in the Firebase system will be further 20p33w0037.
analyzed to predict plant growth rates and find appropriate
water level according to each plant type and age.

REFERENCES

[1] D. Pramudwinai, “Sufficiency economy philosophy: Thailand’s path [6] Google Developer. (2018, June. 6). Adding Firebase to your C++
towards sustainable development goals,” The ministry of Foreign Project [Online]. Available:
affairs of Thailand, June 2017. https://firebase.google.com/docs/cpp/setup
[2] M. S. Gavali, B. J. Dhus, and A. B. Vitekar, “A smart irrigation system [7] Ionic Framework. (2018, June. 15) ionic framework docs [Online].
for agriculture based on wireless sensors,” International Journal of Available: https://ionicframework.com/docs/
Innovative Research in Science, Engineering and Technology, Volume [8] Rui. Santos. (2016, July. 14). Guide for Soil Moisture Sensor YL-69 or
6, Issue 5, May 2016. HL-69 with Arduino [Online]. Available:
[3] H.Gupta, V.Pareek, R.Mishra, and K. Lavanya, “Automated precision https://randomnerdtutorials.com/guide-for-soil-moisture-sensor-yl-
farming using internet of things,” International Research Journal of 69-or-hl-69-with-the-arduino/
Advanced Research in Computer Engineering and Technology, [9] Adafruit. (2017, Dec. 20) Plastic Water Solenoid Valve - 12V - 1/2"
Volume 6, Issue 5, May 2017. Nominal [Online]. Available: https://www.adafruit.com/product/997
[4] H.Kuruva and B.Sravani, “Remote plant watering and monitoring [10] Elecfreaks, “Ultrasonic Ranging Module HC-SR04,” Sept. 2017.
system based on IoT, ” International Journal For Technological [11] DFRobot, “Waterproof DS18B20 Digital Temperature Sensor,” Aug.
Research In Engineering, Volume 4, Issue 4, December 2016. 2017.
[5] M. Santra, S. Biswas, S. Bandhapadhyay, and K. Palit, “Smart wireless [12] Robotshop, “4-Channel 5V Relay Module,” Nov. 2014.
water level monitoring & pump controlling system,” International [13] Maxi, Integrated, “DS3231 Extremely Accurate,” Nov. 2015.
Journal of Advances in Scientific Research and Engineering (IJASRE),
Vol. 03(4), May 2017.

[Ref number] Author’s initials. Authors Surname, “Title of Datasheet,” Part datasheet, Publication date [Latest revision date].

[Ref number] Author’s initials. Authors Surname. (Year, Month. Day). Title of web page [Online]. Available: UR
2018 Seventh ICT International Student Project Conference (ICT-ISPC)

You might also like