The Internet of things (IOT) is the network of physical devices vehicles home appliances and other items embedded with electronics, software, sensors ,actuators, and network connectivity which enable these objects to connect and exchange data.
Smart farming is a concept quickly catching on in the agricultural business. Offering high-precision crop control, useful data collection, and automated farming techniques, there are clearly many advantages a networked farm has to offer.
PE 459 LECTURE 2- natural gas basic concepts and properties
Iot based smart farming
1. IOT BASED SMART FARMING
A MAJOR PROJECT REPORT
Submitted by
Mohammad Azhar 2014-333-031
In partial fulfillment for the requirement of the award of the degree
BACHELOR OF TECHNOLOGY
IN
ELECTRONICS AND COMMUNICATION ENGINEERING
Under the supervision of
Dr. Syed Imtiyaz Hassan
Department of Computer Science
JAMIA HAMDARD
(HAMDARD UNIVERSITY)
New Delhi-110062
(2017)
2. DECLARATION
I,Mohammad Azhara studentof Btech(ECE), Enrollmentno. 2014-333-031hereby
declare that the dissertation entitled “IOT BASED SMARTFARMING”which is being
submitted by me to the Department of Computer Science, Jamia Hamdard, New
Delhi in partial fulfillment of the requirement for the award of the degree of
Btech(ECE)is my original work and has not been submitted anywhere else for the
award of any Degree, Diploma, Associateship, Fellowship or other similar title or
recognition.
(Signature and Name of the Applicant)
Date:
Place:
3. ACKNOWLEDGEMENT
The satisfaction that accompanies the successful completion of the task
would be put incomplete without the mention of the people who made it possible,
whose constant guidance and encouragement crown all the efforts with success.
I wish to express my deep sense of gratitude to Dr. Syed Imtiyaz Hassan,
Projectcoordinator for her able guidanceand usefulsuggestions, which helped me
in completing the project work, in time.
I express my heartfelt thanksto, Prof. Md. TabrezNafis,project/dissertation
evaluation committee Jamia Hamdard (hamdard university) for her valuable
guidance, and encouragement during my project.
I am particularly thankful to Prof. Afsar Alam, Head, Department of
Electronics and Communication Engineering for his guidance, intense supportand
encouragement, which helped me to complete my project a successfully.
I show gratitude to my honorable Dean Prof. Ranjit Biswas, for having
provided all the facilities and support.
Finally sincere thanks to all my friends and specially Zain sir for their
continuous support and enthusiastic help.
4. i
Abstract
The Internet of things (IOT) is the network of physical devices vehicles home
appliances and other items embedded with electronics, software, sensors, actuators
and network connectivity which enable these objects to connect and exchange data.
The IOT allows objects to be sensed or controlled remotely across existing network
infrastructure, creating opportunities for more direct integration of the physical
world into computer-based systems, and resulting in improved efficiency, accuracy
and economic benefit in addition to reduced human intervention.
Smart farming is a conceptquickly catching on in the agricultural business. Offering
high-precision crop control, useful data collection, and automated farming
techniques, there are clearly many advantages a networked farm has to offer.
Experts estimate that the IOT will consist of about 30 billion objects by 2020.
5. ii
Contents
Abstract i
Contents ii
List of Figures iii
1. Introduction 01
1.1 Objective 02
1.2 Necessity 01
2. Hardware Description 03
2.1 Circuit diagram 03
2.2 Components description 04
2.2.1 Arduino Uno 04
2.2.2 Ethernet Shield 06
2.2.3 Moisture Sensor 08
2.2.4 Breadboard 12
2.2.5 Nokia 5110 LCD 13
2.2.6 Gas sensor 14
2.2.7 Pump 16
2.2.8 Relay 17
2.2.9 DHT11 19
3. Software used 21
3.1 Arduino IDE 21
3.2 Library 22
3.3 Embedded c 23
3.4 Ubidot .com(Hosting web) 24
4. Hardware Implementation 25
3.1 Basic concept and working of Smart Farming 26
3.2 Application 29
5. Results 30
6. Conclusion and Future scope 33
References 34
6. iii
List of Figures
2.1 Circuit diagram 03
2.2.1 Arduino Uno 04
2.2.2 Ethernet Shield 06
2.2.3 Moisture sensor 08
2.2.4 Breadboard 12
2.2.4 Nokia 5110 LCD 13
2.2.5 Gas sensor 15
2.2.6 Pump 16
2.2.7 Relay 17
2.2.8 DHT11(Temperature + humidity) 19
4.1.1 Smart Farming System block 25
4.1.2 Block diagram of Smart Farming 27
5 Result:
5.1 when moisture sensor dipped in moist soil 30
5.2 when soil is dipped in dry soil 31
7. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 1
CHAPTER – 1
Introduction
1.1 Overview
Plants have had and still have a key role in the history of life on earth. They are
responsible for presence of oxygen needed for human survival on this planet. At the same time
agriculture is also important to human beings because it forms the basis for food security. It helps
human beings grow the most ideal food crops and raise the right animals with accordance to
environmental factors. Agriculture plays a vital role in India's economy. Over 58% of the rural
households depend on agriculture as their principal means of livelihood. Agricultural export
constitutes 10% of the country's exports. So the farmer's and even the nation's economy will be
ruined if there are no proper yields due to lack of knowledge of the soil nature, timely
unavailability of water. Thus the government should take steps for a better and profitable
irrigation.
It is a smart farming stick based on IOT (Internet of things) technology which has brought
revolution to each and every field of common man’s life by making everything smart and
intelligent. Aim of this project is to propose a novel smart IOT based agriculture stick assisting
farmers in getting live data (Temperature, soil moisture, smoke detection) for efficient
environment monitoring which will enable them to do smart farming and increase their overall
yield and quality of products. The agriculture stick being proposed via this project is integrated
with Arduino technology, breadboard mixed with various sensors and live data feed can be
obtained online from Ubido.com.
8. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 2
Necessity
Have we ever wanted our plants to tell you when they need watered? Or know how
saturated the soil in your garden is? The present project proposes an IOT enabled smart soil
moisture monitoring system that helps the government authorities to know the information about
dry soil areas in the agricultural lands within a village, town or even a state so that the necessary
precautionary steps can be taken to make such lands fertile. Besides, the project is also very much
useful for the farmers, organizations or individuals running plant nurseries to automatically turn
the pumping motor ON and OFF on sensing the moisture content of the soil. The advantage of
using this method is to reduce human intervention and still ensure proper irrigation.
This project is a very low cost and an innovative system to know the moisture level of the soil
from a remote place. For this, the system uses Ethernet Shield +Arduino Uno modem is used for
sending data to the cloud and the user.. The system makes use of Arduino UNO, soil moisture
sensor. It is programmed to receive the input signal of varying moisture condition of the soil. The
system is powered by a dc 5V.
10. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 4
2.2 HARDWARE USED
1. ARDUINO UNO
2. ETHERNET SHIELD
3. SOIL MOISTURE SENSOR
4. BREAD BOARD
5. NOKIA 5110 LCD
6. GAS SENSOR
7. PUMP
8. RELAY
9. TEMPERATURE HUMIDITY SENSOR (DHT11)
10. POWER SUPPLY
2.2.1 ARDUINO UNO
Figure 2.2.1 Arduino Uno
11. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 5
Input and Output
Each of the 14 digital pins on the Arduino Uno can be used as an input or output, using pinMode(),
digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each pin can provide or receive
a maximum of 40 mA and has an internal pull-up resistor (disconnected by default) of 20-50
kOhms.
In addition, some pins have specialized functions:
Serial: pins 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data. These
pins are connected to the corresponding pins of the ATmega8U2 USB-to-TTL Serial chip.
External interrupt: pins 2 and 3. These pins can be configured to trigger an interrupt on a low
value, a rising or falling edge, or a change in value. See the attach Interrupt() function for details.
PWM: 3 , 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite() function.
SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication using
the SPI library.
LED: 13. There is a built-in LED connected to digital pin 13. When the pin is HIGH value, the
LED is on, when the pin is LOW, it’s off.
The Uno has 6 analog inputs, labelled A0 through A5, each of which provide 10 bits of resolution
(i.e. 1024 different values). By default they measure from ground to 5 volts, though is it possible
to change the upper end of their range using the AREF pin and the analogReference() function.
Additionally, some pins have specialized functionality:
TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the Wire library.
There are a couple of other pins on the board:
AREF. Reference voltage for the analog inputs. Used with analogReference().
Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset button to
shields which block the one on the board.
12. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 6
2.2.2 ETHERNET SHIELD
Figure 2.2.2 Arduino Ethernet Shield
The Arduino Ethernet Shield connects your Arduino to the internet in mere minutes. Just
plug this module onto your Arduino Board, connect it to your network with an RJ45 cable (not
included) and follow a few simple steps to start controlling your world through the internet. As
always with Arduino, every element of the platform – hardware, software and documentation – is
freely available and open-source. This means you can learn exactly how it's made and use its design
as the starting point for your own circuits. Hundreds of thousands of Arduino Boards are already
fueling people’s creativity all over the world, everyday .The transistor is the fundamental building
block of modern electronic devices, and its presence is ubiquitous in modern electronic systems.
Working
The shield must be assigned a MAC address and a fixed IP address using the
Ethernet.begin() function. A MAC address is a globally unique identifier for a particular device.
Current Ethernet shields come with a sticker indicating the MAC address you should use with
them. For older shields without a dedicated MAC address, inventing a random one should work,
but don't use the same one for multiple boards. Valid IP addresses depend on the configuration of
your network. It is possible to use DHCP to dynamically assign an IP to the shield. Optionally,
13. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 7
you can also specify a network gateway and subnet modern clocked analog circuits, voltage
regulators, amplifiers, power transmitters, motor drivers, etc.
In order for any device to connect to the Internet, the device must acquire a unique identity on the
network: the IP address. The IP address (IP stands for Internet Protocol) of a device is a unique
identifier composed, in the IPv4 version of the standard, the most commonly used, of four bytes,
each of which can have a value between 0 and 255. Few of them are reserved internationally and,
in particular, subnetworks whose first two bytes are 192 and 168 are non-routable, i.e. packets sent
over such a network cannot go beyond an Internet switch. In other words they can only reach those
devices on the same physical network. That’s why devices in a home network usually have IP
addresses like 192.168.x.y. The IP address of a device can be statically or dynamically assigned to
it. In the first case, the device administrator tells the device its IP address: in this case the address
is going to remains the same with time forever. A device not having a static IP address can ask for
an IP address to any computer on the same network running as a DHCP server (Dynamic Host
Configuration Protocol). Depending on the configuration of the server, available IP addresses can
be assigned to the device randomly or based on the device identity.
When Arduino Uno and Ethernet shield is combined it is used to find ip address and connect to
the internet by using the following excerpt of Arduino sketch:
#include <Ethernet.h>
#include <SPI.h>
void setup() {
Ethernet.begin(mac, arduinoIP, dnsIP, gatewayIP, subnetIP);
}
14. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 8
Explanation of above Arduino sketch:
Including Ethernet.h and SPI.his mandatory: the files contain the definition of the classes used
in the sketch. The MAC address is defined as an array of bytes, each of which is represented as a
pair of hexadecimal digits (thanks to the 0x preceding each number). The IP addresses of the shield,
the DNS and the gateway is given as an object of class IPAddress, as well as the subnet mask. The
object constructor takes four arguments that represent the four bytes of the address. Our Arduino
will acquire the IP address 192.168.1.67, in a network whose gateway’s address is 192.168.1.254;
the gateway works also as the DNS in this case, while the subnetwork is restricted to those devices
having an IP address like 192.168.1.x.
The Ethernet.begin(mac, arduinoIP, dnsIP, gatewayIP, subnetIP) call does the job: it configures
the Ethernet shield as above (and, of course, it does that in the setup() method).
2.2.3 SOIL MOISTURE SENSOR
Figure 2.2.3 Soil Moisture Sensor
15. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 9
Soil Moisture Sensors measure the volumetric water content in soil. Since the direct
gravimetric measurement of free soil moisture requires removing, drying, and weighting of a
sample, soil moisture sensors measure the volumetric water content indirectly by using some other
property of the soil, such as electrical resistance, dielectric constant, or interaction with neutrons,
as a proxy for the moisture content. The relation between the measured property and soil moisture
must be calibrated and may vary depending on environmental factors such as soil type,
temperature, or electric conductivity. Reflected microwave radiation is affected by the soil
moisture and is used for remote sensing in hydrology and agriculture. Portable probe instruments
can be used by farmers or gardeners.
Working of Sensor
The soil moisture sensor consists of two probes which are used to measure the volumetric content
of water. The two probes allow the current to pass through the soil and then it gets the resistance
value to measure the moisture value.
When there is more water, the soil will conduct more electricity which means that there will be
less resistance. Therefore, the moisture level will be higher. Dry soil conducts electricity poorly,
so when there will be less water, then the soil will conduct less electricity which means that there
will be more resistance. Therefore, the moisture level will be lower.
This sensor can be connected in two modes; Analog mode and digital mode. First, we will connect
it in Analog mode and then we will use it in Digital mode.
16. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 10
Specifications
The specifications of the soil moisture sensor are as follows:
Input Voltage 3.3-5V
Output Voltage 0-4.2V
Input Current 35mA
Output Signal Both Analog and Digital
Pin Out – Soil Moisture Sensor
The soil Moisture sensor has four pins
VCC: For power
A0: Analog output
D0: Digital output
GND: Ground
The Module also contains a potentiometer which will set the threshold value and then this threshold
value will be compared by the LM393 comparator. The output LED will light up and down
according to this threshold value.
17. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 11
Analog Mode – Interfacing Soil Moisture Sensor and Arduino
To connect the sensor in the analog mode, we will need to use the analog output of the sensor.
When taking the analog output from the soil moisture sensor FC-28, the sensor gives us the value
from 0-1023. The moisture is measured in percentage, so we will map these values from 0 -100
and then we will show these values on the serial monitor.
The connections for connecting the soil moisture sensor to the Arduino are as follows:
VCC of FC-28 to 5V of Arduino
GND of FC-28 to GND of Arduino
A0 of FC-28 to A0 of Arduino
Digital Mode – Interfacing Arduino and Soil Moisture Sensor
To connect the soil moisture sensor in the digital mode, we will connect the digital output of the
sensor to the digital pin of the Arduino. The Sensor module contains a potentiometer with it, which
is used to set the threshold value. This threshold value is then compared with the sensor output
value using the LM393 comparator which is placed on the sensor module.
The LM393 comparator will compare the sensor output value and the threshold value and then
gives us the output through the digital pin. When the sensor value will be greater than the threshold
value, then the digital pin will give us 5V and the LED on the sensor will light up and when the
sensor value will be less than this threshold value, then the digital pin will give us 0V and the light
will go down.
The connections for connecting the soil moisture sensor to the Arduino in digital mode are as
follows:
VCC of FC-28 to 5V of Arduino
GND of FC-28 to GND of Arduino
D0 of FC-28 to pin 12 of Arduino
LED positive to pin 13 of Arduino
LED negative to GND of Arduino
18. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 12
2.2.4 BREADBOARD
Figure 2.2.4 Breadboard
A breadboard is a solderless device for temporary prototype with electronics and test circuit
designs. Most electronic components in electronic circuits can be interconnected by inserting their
leads or terminals into the holes and then making connections through wires where appropriate.
Connection Concept
The top and bottom rows (the rows indicated by the blue) and are usually the (+) and (-) power
supply holes and these move horizontally across the breadboard, while the holes for the
components move vertically Each hole is connected to the many metal strips that are running
underneath. Each wire forms a node.
19. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 13
2.2.5 NOKIA 5110 LCD
Figure 2.2.5 Nokia 5110 LCD Module
These displays are small, only about 1.5" diameter, but very readable due and comes with a
backlight. This display is made of 84x48 individual pixels, so we can use it for graphics, text or
bitmaps. These displays are inexpensive, easy to use, require only a few digital I/O pins and are
fairly low power as well.
To drive the display, you will need 3 to 5 digital output pins (depending on whether you want to
manually control the chip select and reset lines). Another pin can be used to control (via on/off or
PWM) the backlight. To make things easy there are nice graphics library that can print text, pixels,
rectangles, circles and lines. The library is written for the Arduino but can easily be ported to
microcontroller.
20. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 14
Special Features:
Single chip LCD controller/driver
48 row, 84 column outputs
Display data RAM 48 × 84 bits
Serial interface maximum 4.0Mbits/s
Logic supply voltage range VDD to VSS 2.7V to 3.3V
Limiting values: supply voltage VDD: 7V
Limiting values: all input voltages: VDD + 0.5V
Low power consumption, suitable for battery operated
Pin Out:
RST – RESET
CE – CHIP ENABLE
D/C- DATA/COMMAND SELECTION
DIN-SERIAL INPUT
CLK-CLOCK INPUT
VCC- 3.3V
LIGHT-BACKL CONTROL
GND-GROUND
21. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 15
2.2.6 GAS SENSOR (MQ-6)
Figure 2.2.6 Gas Sensor(MQ-6)
MQ-6 gas sensor modules are used in gas leakage detecting equipments in family and industry,
are suitable for detecting of LPG, iso-butane, propane, LNG, avoid the noise of alcohol and
cooking fumes and cigarette smoke .It also help in detecting gas around the field , wich may be
harmful to the crops.
Special Features:
High sensitivity to CH4,Natural gas
Small sensitivity to alcohol, smoke
Fast response
Stable and long life
Simple drive circuit
22. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 16
2.2.7 PUMP
Figure 2.2.7 PumpMini waterPump
A pump is a device that moves fluids (liquids or gases), or sometimes slurries, by mechanical
action. Pumps can be classified into three major groups according to the method they use to move
the fluid: direct lift, displacement, and gravity pumps.
Pumps operate by some mechanism (typically reciprocating or rotary), and consume energy to
perform mechanical work by moving the fluid. Pumps operate via many energy sources, including
manual operation, electricity, engines, or wind power, come in many sizes, from microscopic for
use in medical applications to large industrial pumps.
23. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 17
2.2.8 RELAY
Figure 2.2.8 Relay
A relay is an electrically operated device. It has a control system and (also called input circuit or
input contactor) and controlled system (also called output circuit or output cont actor). It is
frequently used in automatic control circuit. To put it simply, it is an automatic switch to
controlling a high-current circuit with a low-current signal.
The advantages of a relay lie in its lower inertia of the moving, stability, long-term reliability and
small volume. It is widely adopted in devices of power protection, automation technology,sport,
remote control, reconnaissance and communication, as well as in devices of electromechanics and
power electronics. Generally speaking, a relay contains an induction part which can reflect input
variable like current, voltage, power, resistance, frequency, temperature, pressure, speed and light
etc. It also contains an actuator module (output) which can energize or de-energize the connection
of controlled circuit. There is an intermediary part between input part and output part that is used
to coupling and isolate input current, as well as actuate the output. When the rated value of input
(voltage, current and temperature etc.) is above the critical value, the controlled output circuit of
relay will be energized or de-energized.
24. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 18
Special Feature
Good in safety. In power system and high voltage system, the lower current can control the
higher one.
1-channel high voltage system output, meeting the needs of single channel control
Wide range of controllable voltage.
Being able to control high load current, which can reach 240V, 10A
With a normally-open (NO) contact and a normally-closed (NC) contacts
Interface Specification
The output contacts of a relay (including NO, NC, and the common port) works as a SPDT –
Single Pole Double Throw switch.
Its operating principle is as follow:
VC-5V
GND-FOR GROUND
IN 1 – Connect to the control valve with output 3-5V
OUTPUT CONTACTS-Connect to application
25. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 19
2.2.9 TEMPERATUREHUMIDITY SENSOR
Figure2.2.9 DHT11
DHT11 is a Humidity and Temperature Sensor, which generates calibrated digital output. DHT11
can be interface with any microcontroller like Arduino, Raspberry Pi, etc. and get instantaneous
results. DHT11 is a low cost humidity and temperature sensor which provides high reliability and
long term stability.
It is digital temperature and humidity sensor is a composite Sensor contains a calibrated digital
signal output of the temperature and humidity. Application of a dedicated digital modules
collection technology and the temperature and humidity sensing technology, to ensure that the
product has high reliability and excellent long-term stability. The sensor includes a resistive sense
of wet components and an NTC temperature measurement devices.
Working Principle
Most humidity sensors are relative humidity sensors and use different sensing principles.
Sensing principle
Humidity measurement can be done using dry and wet bulb hygrometers, dew point hygrometers,
and electronic hygrometers. There has been a surge in the demand of electronic hygrometers,
often called humidity sensors. Electronic type hygrometers or humidity sensors can be broadly
divided into two categories: one employs capacitive sensing principle, while other use resistive
effects.
26. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 20
Pin out
in Name Description
1 VDD Power supply 3 - 5.5 V DC
2 DATA Serial data output
3 NC Not connected
4 GND Ground
Application
HVAC, dehumidifier, testing and inspection equipment, consumer goods, automotive, automatic
control, data loggers, weather stations, home appliances, humidity regulator, medical and other
humidity measurement and control.
Special Features:
Low cost
Long term-Stability
Fast response
Precision calibration
Long distance transmission
Digital signal output
27. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 21
CHAPTER 3
SOFTWAREUSED
1.ARDUINO IDE
2.LIBRARIES
3.EMBEDDED C
4.HOSTING WEBSITE –Ubidot.com
3.1 ARDUINO IDE
Arduino consists of both a physical programmable circuit board (often referred to as a
microcontroller) and a piece of software, or IDE (Integrated Development Environment) that runs
on your computer, used to write and upload computer code to the physical board.
Arduino is an open source computer hardware and software company, project, and user community
that designs and manufactures single-board microcontrollers and microcontroller kits for building
digital devices and interactive objects that can sense and control objects in the physical world. The
project's products are distributed as open-source hardware and software, which are licensed under
the GNU Lesser General Public License (LGPL) or the GNU General Public License (GPL)
permitting the manufacture of Arduino boards and software distribution by anyone. Arduino
boards are available commercially in preassembled form, or as do-it-yourself (DIY) kits.
Arduino board designs use a variety of microprocessors and controllers. The boards are equipped
with sets of digital and analog input/output (I/O) pins that may be interfaced to various expansion
boards (shields) and other circuits. The boards feature serial communications interfaces, including
Universal Serial Bus (USB) on some models, which are also used for loading programs from
personal computers. The microcontrollers are typically programmed using a dialect of features
from the programming languages C and C++. In addition to using traditional compiler toolchains,
28. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 22
the Arduino project provides an integrated development environment (IDE) based on the
Processing language project.
3.2 LIBRARIES
The Arduino environment can be extended through the use of libraries, just like most programming
platforms. Libraries provide extra functionality for use in sketches, e.g. working with hardware or
manipulating data. To use a library in a sketch, select it from Sketch > Import Library.
A number of libraries come installed with the IDE, but you can also download or create your
own. See these instructions for details on installing libraries.
Standard Libraries Used
Ethernet-for connecting to the internet using the Arduino Ethernet Shield, Arduino
Ethernet Shield 2 and Arduino Leonardo ETH.
PCD8544 - for controlling or to communicate with Nokia 5110 lcd.
Wifi - for connecting to the internet using the Arduino WiFi shield.
Ubidot Library- to connect with ubidot.com.
29. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 23
3.3 EMBEDDED C
Embedded C is a set of language extensions for the C programming language by the C Standards
Committee to address commonality issues that exist between C extensions for different embedded
systems. Historically, embedded C programming requires nonstandard extensions to the C
language in order to support exotic features such as fixed-point arithmetic, multiple distinct
memory banks, and basic I/O operations.
Embedded Programming
Embedded refers to the combination of hardware and software. Embedded systems programming
is the programming of an embedded system in some device using the permitted programming
interfaces provided by that system. EmbeddedJava is an example of a development environment
for programming embedded systems that will execute Java programs.
Arduino is a very minute part of embedded systems, in fact we can call it as an application product
of embedded system. Arduino is just any other microcontroller board, with a specifically designed
API and software which makes programming it very easy. Arduino is just a drop of water in
Embedded System Ocean.
30. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 24
3.4 UBIDOTS.COM(HOSTING WEBSITE)
Ubidots was first born as an engineering services firm, specializing in hardware and software
development for IoT projects in Latin America.
Between 2012 and 2014, we accomplished hundreds of Internet of Things projects across
industries like Healthcare, Oil & Gas, Energy, Manufacturing, Transportation and Retail,
learning the nuts and bolts of IOT.
After going through the Boston Mass Challenge Accelerator -with a purpose of turning ourselves
into a global product-based startup- the idea of an IOT cloud was born; specially one that
understood the real needs of hardware engineer.
Since its launch in 2014, the ubidots Cloud has grown into one of the top IoT Platforms in the
market, supporting thousands of IOT initiatives in more than 40 countries.
31. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 25
CHAPTER – 4
HARDWARE EMPLEMENTTION
4.1 Basic concept and working of SMART FARMING using IOT
Figure 4.1.1
32. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 26
4.1 Purpose of the Project
The purpose of “Smart Farming” is to increase the quality and quantity of agricultural
production by using sensing technology to make farmers more intelligent and more connected. ...
Experiences and challenges in using technology as a tool in farming.
Today farmers are doing many hard work to grow crops and to earn their livelihood beside of their
hardwork neither the quantity nor quality of crops are becoming better and this lead to their losses
and this losses are occurring due to natural calamity as well as lack of technology availability and
due to this farmers are dying day by day.
By using SMART FARMING we can solving all their issues of farmers together with enhancing
their minimum earnings .This can be easily achieved by the todays advance technology so that
they can be able to know the presence of moisture in the soil ,able to detect when to water the plat
or farms .Thus, we can easily solve huge economical & social problems of farmers.
4.2 Concept
Smart Farming is a farming management concept using modern technology to increase
the quantity and quality of agricultural products. Farmers in the 21st century have
access to GPS, soil scanning, data management, and Internet of Things technologies.
By precisely measuring variations within a field and adapting the strategy accordingly,
farmers can greatly increase the effectiveness of pesticides and fertilizers, and use them
more selectively. Similarly, using Smart Farming techniques, farmers can better
monitor the needs of individual animals and adjust their nutrition correspondingly,
thereby preventing disease and enhancing herd health.
33. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 27
4.3 Working
Figure 4.1.2 Block Diagram
Arduino Uno
+
Ethernet shield
Nokia 5110
DHT11 sensor
Temperature+Humidity
Moisture sensor
Gas sensor
cellphone Pump(motor)
Relay
34. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 28
Its working is explained as follows:
All the devices shown above is connected the enternet via Arduino Uno .
Soil moisture sensor detect the moisture level of the soil,DHT11 detetect temperature and
humidity of that particular area.
All this data will appear on the dashboard of ubidot.com
A critical value of moisture and temperature level is set on the devices of dashboard of
ubidot.com, when the value of temperature,humidity and moisture go beyond the critical value
it will trigger an event that is it will send this information to our cell phone and accordingly
we can perform the desired action remotely.
4.4 Advantages
Increased Production – Optimized crop treatment such as accurate planting, watering,
pesticide application and harvesting directly affects production rates.
Water Conservation – Weather predictions and soil moisture sensors allow for water use only
when and where needed.
Real-Time Data and Production Insight – Farmers can visualize production levels, soil
moisture, sunlight intensity and more in real time and remotely to accelerate decision making
process.
Lowered Operation Costs – Automating processes in planting, treatment and harvesting can
reduce resource consumption, human error and overall cost.
Increased Quality of Production – Analyzing production quality and results in correlation to
treatment can teach farmers to adjust processes to increase quality of the product.
ccurate Farm and Field Evaluation – Accurately tracking production rates by field over time
allows for detailed predicting of future crop yield and value of a farm.
Improved Livestock Farming – Sensors and machines can be used to detect reproduction and
health events earlier in animals. Geofencing location tracking can also improve livestock
monitoring and management.
35. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 29
Reduced Environmental Footprint – All conservation efforts such as water usage and
increased production per land unit directly affect the environmental footprint positively.
Remote Monitoring – Local and commercial farmers can monitor multiple fields in multiple
locations around the globe from an internet connection. Decisions can be made in real-time
and from anywhere.
Equipment Monitoring – Farming equipment can be monitored and maintained according to
production rates, labor effectiveness and failure prediction
4.5 APPLICATION
Smart Farming has a real potential to deliver a more productive and sustainable agricultural
production, based on a more precise and resource-efficient approach. ... Precision Agriculture:
Management of spatial and temporal variability to improve economic returns following the use of
inputs and reduce environmental impact.
36. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 30
CHAPTER – 5
Result
When moisture sensor is dipped in moist soil the reading appearing on ubidot.com dashboard is
shown below:
Figure 5.1 when moisture sensor is dipped in moist soil
37. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 31
When moisture sensor is dipped in desert soil:
Figure 5.2 when moisture sensor is dipped in desert soil and gas value is constant
39. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 33
CHAPTER – 6
CONCLUSION and FUTURE SCOPE
6.1 CONCLUSION
Thus the smart farming will revolutionized the world of farming and it will increase the
productivity as well as improve the quality and can save lives of farmer.
There is an urgent need for a system that makes the agricultural process easier and burden free
from the farmer’s side. With the recent advancement of technology it has become necessary to
increase the annual crop production output of our country India, an entirely agro centric economy.
The ability to conserve the natural resources as well as giving a splendid boost to the production
of the crops is one of the main aims of incorporating such technology into the agricultural domain
of the country. To save farmer’s effort, water and time has been the most important consideration
6.2 FUTURE SCOPE
This project has enormous potential and may be used in various other ways, due to its cheap and cost
efficient design.
Use it as a home automation controller, by adding a few more 240 volt relays.
Remotely perform jobs.
Use a float switch in a tank, so that the system automatically shuts the pump down, once the reservoir
is full.
Use it in conjunction with a solar panel, so that the entire system is eco-friendly.
40. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 34
References
1. http://www.geeksforgeeks.org
2. www.wikipedia.org
3. eeexplore.ieee.org/document/8081906/
4. www.pdfmachine.com
5. www.github.com
6. www.datasheets4u.com
7. www.electronicshub.com
8. www.ubidot.com
9. The Internet of Things: Key Applications and Protocols
Book by David Boswarthick, Olivier Hersent, and Omar Elloumi
9. Internet of Things: A Hands-on Approach
Book by Arshdeep Bahga and Vijay K. Madisetti
10. https://dzone.com/articles/the-future-of-smart-farming-with-iot-and-open-sour
41. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 35
APPENDIX
DATASHEETS
IC LM293/393
For sensors, there are normally two ways as output, the analog value or digital value output.
Analog value: Most sensors only provide the analog value, so it outputs a voltage value to
indicate the sensing parameters. Arduino read this value on A0 to A9, and from 0 till 1023. In
AVR and Arduino, the analog voltage varies from 0V till 5V. We sign AO (Analog Output)
as a pin name on many sensor boards.
Digital Value: Sometimes we only want the sensors only give feedback when the sensing
value read a threshold that we want, so when it reached the feedback is 1, and 0 vice versa.
Here the LM393/293 IC do the voltage comparing here, a reference voltage (UR) is set by
the adjustable potentiometer, when the analog output value over this value, the LM393/293
will output a digital value to indicate this sensor is triggered by reaching this setup threshold.
Inside the LM293/393
These devices consist of two independent voltage comparators that are designed to operate from
a single power supply over a wide range of voltages. Operation from dual supplies also is
possible as long as the difference between the two supplies is 2 V to 36 V, and VCC is at least
1.5 V more positive than the input common-mode voltage. Current drain is independent of the
supply voltage. The outputs can be connected to other open-collector outputs to achieve wired-
AND relationships. The LM193 device is characterized for operation from −55°C to +125°C.
The LM293 and LM293A devices are characterized for operation from −25°C to +85°C. The
42. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 36
LM393 and LM393A devices are characterized for operation from 0°C to 70°C. The LM2903,
LM2903V, and LM2903AV devices are characterized for operation from −40°C to +125°C.
Figure : showing internal structure of IC LM293/393 with a block diagram
43. IOT BASED SMART FARMING
JAMIA HAMDARD UNIVERSITY Page 37
Figure LM293/393
Key Features
Wide single-supply voltage range or dual supplies: 2 V to 36 V or ±1 V to ±18 V
Very low supply current (0.45 mA) independent of supply voltage (1 mW/comparator at 5 V)
Low input bias current: 20 nA typ.
Low input offset current: ±3 nA typ.
Low input offset voltage: ±1 mV typ.
Input common-mode voltage range includes ground
Low output saturation voltage: 80 mV typ. (Isink = 4 mA)
Differential input voltage range equal to the supply voltage
TTL, DTL, ECL, MOS, CMOS compatible outputs
Available in DFN8 2x2, MiniSO8, TSSOP8, and SO8 packages