IOT Based Soil Moisture, Temperature and Humidity Measurement Using Arduino
IOT Based Soil Moisture, Temperature and Humidity Measurement Using Arduino
By
BACHELOR OF
SCIENCE IN
COMPUTER
SCIENCE
DEPARTMENT OF COMPUTER
SCIENCE
1
Government College University Faisalabad
2021
Table of Contents
Table of Contents............................................................................................2
Revision History..............................................................................................3
1. Introduction.................................................................................................1
1.1 General Information..............................................................................................1
1.2 Purpose .................................................................................................................1
1.3 Project Objective ..................................................................................................2
1.4 Project Scope ........................................................................................................3
2. Overall Description.....................................................................................4
2.1 Product Perspective ..............................................................................................4
2.2 Product Features ...................................................................................................5
2.3 User Classes and Characteristics ..........................................................................6
2.4 Operating Environment .........................................................................................6
2.5 Design and Implementation Constraints................................................................7
2.6 Assumptions and Dependencies ..........................................................................8
3. System Features .........................................................................................8
3.1 Description and priority........................................................................................8
3.2 Functional requirement......................................................... .................................9
4. External Interface Requirements .............................................................9
4.1 User Interfaces......................................................................................................9
4.2 Hardware Interfaces.............................................................................................10
4.3 Software Interfaces .............................................................................................10
4.4 Communications Interfaces ................................................................................10
2
5.2 Safety Requirements ..............................................................................12
5.3 Security Requirements ...........................................................................12
6. WBS Project Management.....................................................................13
7. Tools & Technologies..............................................................................13
7.1 Programming Languages..................................................................................13
7.2 Databases/Data storages ..................................................................................14
7.3 Operating System..............................................................................................13
Appendix A: Analysis Models ...................................................................15
Appendix B: Check List ............................................................................38
Appendix C: Supervisory committee .......................................................39
Revision History
Name Date Reason For Changes Version
3
1. Introduction:
1.1 General Information:
Project Name: IOT Based soil moisture, Starting Date: ___________
Temperature and humidity measurement using
Controlling Agency: Shiblee college FSD Final Date:_____________
1.2 Purpose:
The main purpose for this project was to develop a tool for farmers and cultivators to
check the suitability of environmental conditions in order to facilitate the growth of
crops in an efficient way to get the best yield possible. This project gives quite
accurate readings in comparison to expensive soil testing apparatus. However main
results depend on how the readings are mapped using the code. The model is portable
and can be carried to any location. Once the code is uploaded to the board, it need not
be re programmed each time it is used. Using same technology we can make various
other bigger projects Measuring the values of the temperature, humidity and soil
moisture, we can accordingly vary temperature, and irrigate our soil. Fertilizers and
other compost materials can be used accordingly to make the soil fertile. Chemistry of
plants can be studied using the various parameters.
1.3- Document Convention
Convention for main heading
Font face: Time New Roman
Font size: 16
Font style: Bold
Convention for sub-title
Font Face: Time New Roman
Font size: 14
Font style: Bold
Convention for Body
Font face: Time New Roman
Font size: 12
4
1.4- Project Objectives:
This project is an effective tool for farmers. It is a wholesome involvement of
computer programming and hardware interaction. It shows how computer
programming is expanding in other domains like agriculture, farming etc. How
readymade boards facilitate various components like various sensors and modules.
Arduino projects are like Lego blocks. Creativity and necessity can find unlimited
possibilities in the field of Arduino projects.
Internet of things is on the way of taking over the world. Arduino coding is based on
the c++ programming language. The inheritance property of the language plays an
important role in Arduino programming. Gives another reason to learn programming
languages. This project can be expanded even further to involve sprinklers and air
conditioners to improve environment quality. Fully automated farming systems can be
developed keeping Arduino as a base.
5
2- Overall Description:
2.1- Product Perspective:
Various techniques for measuring temperature, moisture, and humidity levels of soil
to aid farmers in their decision making have been presented. A system that monitors
soil moisture, temperature, and relative humidity and acquires data by means of
sensors connected to a micro-controller with signals transmitted using radio frequency
. This system is however constrained by its inability to detect moisture at different
depts. Radio waves also have a problem with transmitting large volumes of data at the
same time since they are of low frequency. Using a combination of ZigBee
technology, artificial intelligence, and decision support technology, developed an IoT
system for monitoring citrus soil moisture and nutrients in real time. It has a drawback
of being able to only measure soil moisture, other important parameters such as
temperature and humidity cannot be measured. About 70% of India’s population are
reliant on farming culminating in the nation’s one-third capital coming from farming
which is bedeviled with challenges. They thus propose a smart agriculture to
modernize farming utilizing automation and IOT based techniques.
The major feature for the improvement of yields from crops is the monitoring of
environmental factors which has to be driven by evolving smart technology. The
system that monitors humidity and temperature to ensure efficient choice of crops for
planting through sensors using CC3200 single-chip interfaced with a camera and
sends pictures to mobile devices of farmers through Wi-Fi. It measures temperature
and humidity of the air in an agricultural field and so will not be effective in
measuring actual soil temperature and humidity. Data on the humidity and
temperature of the soil and the period of sunshine for the day is gathered by sensors
and transmitted to a base station. The advantage of the proposed system lies in the
optimization of water usage while crop yield is maximized through the
implementation of precision agriculture with cloud computing, however, the system
only ensures the temperature of potatoes inside or outside the soil. The system has a
hybrid machine learning approach for the prediction of soil moisture for future days.
The system’s drawback is that data is gathered through forecasting models which may
6
lack accuracy. There is the need for a more efficient and cost effective system which
will enable farmers to monitor environmental factors such as temperature, relative
humidity, and moisture that is required for the growth of crops. They therefore
presented a system that uses DHT11, capacities soil moisture sensing circuit, and
resistive soil moisture sensing circuit that measures the temperature, relative
humidity, and soil moisture of a land and the data is transmitted to a cloud repository
for analysis. The system did not provide for mechanism for the data to be processed,
also there is no medium for transmitting the data to farmers and interested persons.
IOT Based Smart soil moisture, temperature and humidity System that will ensure the
condition of the potatoes inside or outside the soil. It is made up of a DH11
temperature and humidity sensor and a hygrometer sensor for the measurement of
ambient atmospheric temperature and humidity and has wireless communication
modules for data transmission to a cloud repository. The major drawback of this
system is that it is not automated as the system administrator is provided with the
option of switching to a special mode which enables the change in moisture content
and the soil’s acidity to be managed. In integrated farm management system that
utilizes smartphone application and the Internet of Things (IOT) was presented. This
system provides farmers with the capability of monitoring a farm remotely for soil
moisture, pH level in the soil, humidity and temperature in the environment. The
weather and soil conditions in an area is rapidly analyzed for decision-making. This
system only tests for a single parameter which is not adequate to determine the crop
that is suitable for a particular soil. The adoption of smart farming could help improve
the adverse effects of food production. They thus presented an IOT system for the
accurate control of crops, and capable of collecting useful data and automatic farming
techniques. The system is an intelligent field monitor that monitors soil humidity and
temperature and the data is stored on Thing Speak to be analyzed in the future. An
Arduino board is used to control the high voltage farming equipment automatically,
using soil moisture and temperature values that have been predefined. Changing the
threshold values of the soil moisture and temperature involves updating the
middleware manually which represents a major drawback of the system. To achieve a
good harvest, the farming field has to be monitored periodically. They therefore
7
proposed an IOT based field monitoring system to provide quick information on soil
moisture, humidity, and temperature of the farming field to farmers. Based on the data
received, farmers can take quick action on the crops to be planted. Data gathered by
the sensors are transmitted to a mobile device using Bluetooth and ZigBee
technologies. Both technologies are hampered by low speed of data transmission and
work within a short range with weak security as compared to other wireless data
standards such as WI-FI. In summary, all the research that have been studied confirm
that accurate measurement of soil moisture, humidity, and temperature will boost food
production and ensure food security. Techniques to ensure timely and efficient
gathering of data, its analysis, and transmission requires improvement to enable
farmers make informed decisions on the most suitable crops to plant based on
the available data. There is also agreement among researchers that an inexpensive
IOT based smart device is the best solution for accurately measuring soil parameters.
None of the literature perused proposed a system that stored data on the ideal soil
moisture, humidity, and temperature for planting particular crops. This cost-effective
device should have the capability of being inserted into soil samples to measure the
temperature, humidity and amount of moisture in the soil. The system should have the
capability to allow the input of staple crops and their ideal soil humidity, moisture,
and temperature data. The proposed system should be able to analyze the data
collected by the sensors and recommend to farmers which crops to plant considering
the conditions of the soil after actual measurement of the parameters which represents
a major gap in the systems presented. The IoT system should transmit the collected
data to an online data repository for further analysis. Users should be able to gain
timely access to the data using mobile devices.
Temperature:
The ideal storage temperature for potatoes is 40-45 °F. Warmer temperatures lead to
8
sprouting, and excessive sprouting lowers the quality of potatoes. In addition, warm
storage conditions encourage the growth of disease, creating an ideal environment for
organisms which could detrimentally affect crop establishment and yield. Warm
storage conditions also increase transpiration and respiration which could cause
increased water loss. On the other hand, storing at temperatures that are too low can
cause potatoes to turn Grey or black, and decrease their quality and vigor.
Relative Humidity:
High humidity is essential to maintain proper seed weight and tuber quality. Weight
loss significantly increases at relative humidity below 90%, so be sure to maintain
high relative humidity (90-95%) to preserve the quality and firmness of the potato.
Light:
Tubers will turn green if exposed to light, and the speed at which greening occurs
depends on the exposure of the tuber to light. This green coloration is actually
chlorophyll, and is generally harmless; however, it is an indication that an increased
level of a glycol-alkaloid compound called gasoline may be present. This compound
is potentially toxic if consumed in large amounts. To eliminate gasoline formation,
seed tubers should be kept away from the light and stored in the dark.
10
➢ Operating Voltage: 3.3V or 5V DC
➢ Measurement Range: 20-95% Relative Humidity, 0- 50 C
D. I2C 16X2 LCD display unit
The Liquid crystal display contains a built-in register which stores the commands and
data supplied to the unit. It works in two modes, the first is READ mode and the
second is WRITE mode. In the write mode, instructions to control the display unit is
written in the register example clear display, shift right, cursor set etc. Also the data to
be displayed is supplied in the write mode. Two signals namely SDA and SCL are
present in the BUS which are data and clock signals respectively. Technical
Specifications:
➢ Power supply: the board is supplied power through the Vin and the Vcc pins. Vin
may or may not be used but usage of Vcc is mandatory. The Vin pin should be
operated between 7V TO 12V (20 V IN WORST CASE) ;and that for Vcc pin is
4.5 volt to 5.5 volts (a typical module generally uses 5 volt supply). In case both
the pins are powered, priority will be given to the Vin pin and will power the lcd
module and backlight; else the Vcc powers up the full board. The I2C extender is
pre designed to function on 5 volt supply, utilizing the voltage accessible on the
VCC pins, however, it can likewise be arranged to utilize 3.3V
➢ Maximum current that can be drawn by the lcd module is around 0.2A
3. System Features:
3.1 Description and Priority:
This device measure temperature, humidity and soil moisture using the same
device addressing the portability and cost issues and providing reasonably
accurate value during measurement. Hence, such a device is must have for
every farmer or someone who grows crops
Hobbyists and people who grow crops in their backyard can also use this
device to effectively make their gardening decision
12
3.2 Functional Requirements:
Now a day we used to call the name of students for the purpose of attendance
checking by admin (or Teacher). They verify the identity of student's participation by
human recognition using facial and voice matching. This approach is time-consuming
and in-efficient because the number of students is getting increased. Moreover, they
may have to recheck any of the student’s presence at the end of the period manually.
In this project, we offer a convenient novel attendance checking method to take
advantage of Wi-Fi technology. Our application initiates Wi-Fi service for checking
attendance of users in which a class is generated only by admin. If admin has the
generated classes, the smart application of the member will connect and report to
attendance server. Otherwise, the smart application of the student will report to the
server that the users/students are not present. By this way Admin /Teacher can easily
check the student's attendance. Reduces admin work by integrating the details of the
students of all the three departments into a single database. Manual work for
information retrieval on attendance becomes less as the work becomes digitized. Easy
access for students because they can view their attendance and make up for the
shortage of attendance accordingly. It is also time saving as manual work is less.
There is less chance of error.
15
5.1.1 Static Requirements:
These requirements do not impose any constraints on the execution
characteristics of the System. They are:
5.1.1.1 Number of Terminals
The software makes use of an underlying database that will reside at the server,
while the front end will be available online to the administrative and departmental
computers as well as users.
5.1.1.2 Number of Users:
The number of users may Constant.
5.1.2 Dynamic Requirements
These specify constraints on the execution characteristics of the system. They
typically include response time and throughout of the system. Since these factors are
not applicable to the proposed software, it will suffice if the response tine is high and
the transactions are carried out precisely and quickly.
5.2- Security Requirements
The security requirements deal with the primary security. The software should be
handled only by the administrator and authorized users. Only the administrator has
right to assign permission like creating new accounts and generating password. Only
authorized users can access the system with username and password.
6. WBS Project Management:
16
7. Tools & Technologies:
Android Studio
Visual Studio
Internet/Wi-Fi
17
Appendix B: Analysis Model
Data Flow Diagram
Explanation:
The above diagram represents the flow of data in this application. First of all it sends
a request to sensor. Then wait for its response. After receiving the response, it shows
the soil moisture temperature and humidity.
18
Use-case Diagram for Every Operation:
Admin:
Login
Explain:
First of all admin login in the system by use his username and password
If the password wrong then admin can retry.
Soil Moisture:
Explain:
After the login admin can check quantity of soil-moisture.
Temperature:
19
Explain:
Admin can check the temperature after login.
Air Humidity:
Explain:
After the login admin can check the air humidity.
Soil Humidity:
Explain:
Admin can check the soil humidity.
Light Intensity:
20
Explain:
Admin check the light intensity.
Dashboard:
Explain:
Dash board views only by admin.
Logout:
Explain:
Admin can logout after the check whole data.
21
Explain:
First of all user login in the system by use his username and password
If the password wrong then admin can retry.
Soil Moisture:
Explain:
After the login user can check quantity of soil-moisture.
Temperature:
Explain:
User can check the temperature after login.
Air Humidity:
Explain:
After the login User can check the air humidity.
22
Soil Humidity:
Explain:
User can check the soil humidity.
Light Intensity:
Explain:
User checks the light intensity.
Logout:
Explain:
Users can logout after the check whole data.
23
Class Diagram:
24
In the admin class use entities ID and his type is string Name and his type is string
Password and his type is string Email and his type is string and Phone No and his type
is string. First Admin will logins into system using internet/Wi-Fi. Admin will
generate classes in database. Admin will register teachers and students. Admin will
insertion, updating and deletion teachers and students’ credentials needed for
attendance. Admin will make backup of attendance on daily basis using cloud
technology. Admin will access all data at any anywhere. Admin will convert
attendance file into PDF formats. Admin will share the attendance.
In the teacher class use entities ID and his type is string Name and his type is string
Password and his type is string Email and his type is string and Phone No and his type
is string. The teacher will logins into system only in campus using specific Wi-Fi
router. Teacher will mark himself as well as student’s attendance. Teacher will mark
attendance of offline students too. Teacher will view attendance in three ways first all
Students second Present Students and third on Absent Students. Teacher will trace
students which are connected during class. Teacher will view attendance percentage
of all students. Teacher will verify students by face recognition.
In the student class use entities ID and his type is string Name and his type is string
Father Name and his type is string Semester and his type is string Course and his type
is string Password and his type is string Email and his type is string Phone No and his
type is string. Student will connect our system using specific Wi-Fi router. Students
will logins to system and marks attendance. Student will view details of his teachers
and subjects. Student panel will save students’ picture at attendance time to cloud.
Students will view his attendance percentage for all subjects.
25
ERD (Entity Relationship Diagram):
In the admin class, admin can manage teacher and students. In this diagram we use
decision is the admin manage teacher and student’s details .Admin manage one by
one teacher detail and student’s details .First Admin will logins into system using
internet/Wi-Fi. Admin will generate classes in database. Admin will register teachers
and students. Admin will insertion, updating and deletion teachers and students’
credentials needed for attendance. Admin will make backup of attendance on daily
basis using cloud technology. Admin will access all data at any anywhere. Admin will
convert attendance file into PDF formats. Admin will share the attendance.
In the teacher class, teacher relationship with admin is many to one and teacher also
relationship with teacher is one to many. The teachers will logins into system only in
campus using specific Wi-Fi router. Teacher will mark himself as well as student’s
26
attendance. Teacher will mark attendance of offline students too. Teacher will view
attendance in three ways first all Students second Present Students and third on
Absent Students. Teacher will trace students which are connected during class.
Teacher will view attendance percentage of all students. Teacher will verify students
by face recognition.
In the student class, student relationship with teacher is one to many and student
relationship with admin is one to many, student will connect our system using specific
Wi-Fi router. Students will logins to system and marks attendance. Student will view
details of his teachers and subjects. Student panel will save students’ picture at
attendance time to cloud. Student will view his attendance percentage for all subjects.
Object Diagram:
27
In the admin class use entities Name and his type is string Password and his type is
string Email and his type is string. First Admin will logins into system using
internet/Wi-Fi. Admin will generate classes in database. Admin can view the data on
dashboard. Admin will inserts, updating and deletion data. Admin will make backup
of data on daily basis using cloud technology. Admin will access all data at any
anywhere. Admin will convert data file into PDF formats. Admin will share the data.
In the User class use entities Name and his type is string Password and his type is
string Email and his type is string. The users will logins into system using
Internet/Wi-Fi router. After the login user can view the data like soil moisture,
temperature and humidity.
Sequence Diagram:
28
First Admin will login into system using internet/Wi-Fi. Admin will generate classes
in database. Admin will register Users. Admin will inserts, updating and deletion data.
Admin will make backup of data on daily basis using cloud technology. Admin will
access all data at any anywhere. Admin will convert data file into PDF formats.
Admin will share the data.
The users will logins into system using internet/Wi-Fi. User will watch the data live
stream. Data automatically save if we need after.
Sequence Diagram for any operation:
1- Admin :
1.1 Login operation:
Explanation:
First Admin will logins into system using internet/Wi-Fi. Admin can use internet/Wi-
Fi any place and any time .He can check details any place and any time. Just login
with user name and password.
1.2 Generate Classes Operation:
29
Explanation:
When admin login, if valid his user’s name and password he is login and check every
detail. If his user’s name and password is incorrect, he is invalid. When admin login
details are valid, he is login and generates classes in cloud data base.
1.3 Transmission Operation:
Explanation:
Gate away sensing the data through a sensor.
1.4 Sense the Data:
Explanation:
In this step Arduino sense the data and send it to server.
30
1.5 Back-Up Operation:
Explanation:
Admin can take back up any time and any place. Admin can restore data in case of
data lose. Backup is an essential for a working system.
1.6 Data Storage:
Explanation:
In this step data store in server for live streaming.
31
1.7 Requesting for Data:
Explanation:
In this step Arduino sending request the server to send the data.
1.8 Response:
Explanation:
User can view the quantity of soil moisture,temperature and humidity Online.
32
2.1- Data Transmission:
Explanation:
Admin can view the quantity of soil moisture, temperature and humidity and
dashboard online.
2.2- Login Operation
User
Explanation:
At this stage, User can login in system when his user’s name and password is valid. If
user name and password is invalid, he cannot login in system
33
Explanation:
When User login, if valid his user’s name and password he is login and check every
detail. If his user’s name and password is incorrect, he is invalid. When admin login
details are valid, he is login and generates classes in cloud data base.
Transmission Operation:
Explanation:
Gateaway sensing the data through a sensor.
2.4 Sense the Data:
Explanation:
In this step Arduino sense the data and send it to server.
34
2.5 Back-Up Operation:
Explanation:
Admin can take back up any time and any place. Admin can restore data in case of
data lose. Backup is an essential for a working system.
2.6 Data Storage:
Explanation:
In this step data store in server for live streaming.
2.7 Requesting for Data:
35
Explanation:
In this step Arduino sending request the server to send the data.
2.8 Response:
Explanation:
User can view the quantity of soil moisture, temperature and humidity online.
2.9 Data Transmission:
Explanation:
Admin can view the quantity of soil moisture, temperature and humidity and dash
board online.
36
Activity Diagram:
Activity 1:
Admin:
37
Admin
First Admin will logins into system using internet/Wi-Fi. Admin will generate classes
in database. Admin will register teachers and students. Admin will insertion, updating
and deletion teachers and students’ credentials needed for attendance. Admin will
make backup of attendance on daily basis using cloud technology. Admin will access
all data at any anywhere. Admin will convert attendance file into PDF formats.
Admin will share the attendance.
Activity 2:
USER:
USER
The users will logins into system using internet. User can view the quantity of soil
38
moisture, temperature and humidity after the viewed then user can take some action.
State Diagram:
Admin
First Admin will logins into system using internet/Wi-Fi. Admin will generate classes
in database. Admin will register user. Admin will inserts, updating and deletion data.
Admin will make backup of data on daily basis using cloud technology. Admin will
access all data at any anywhere. Admin will convert data file into PDF formats.
Admin will share the data.
User
39
The users will logins into system using specific internet/Wi-Fi. User can view data
after login operation. User cannot view the data offline. Admin will view data in
two ways first through dashboard and second one is Mobile Application.
V. Interface Requirements
VII. WBS
40
Appendix C: Supervisory Committee
___________________________________ ___________________________________
___________________________________ ___________________________________
___________________________________ ___________________________________
Signature: ________________________
--------------------------------------------------------------------
Date:_____________
➢ Rejected
Remarks;
_______________________________________________________________
41
Project Title (if revised):
______________________________________________________________
42