Professional Documents
Culture Documents
GSM Based Automatic Irrigation System
GSM Based Automatic Irrigation System
Introduction
1.1 Background
Agriculture is the backbone of Nepalese Economy. In today’s world, as we see the rapid
growth in global population, agriculture becomes more important to meet the needs of the
human race. However, agriculture requires irrigation, and with every year we have more
water consumption than rainfall, it becomes critical for growers to find ways to conserve
water while still achieving the highest yield .But at the present era, the farmers have been
using irrigation technique through the manual control in which they irrigate the land at
the regular intervals. This process sometimes consumes more water or sometimes the
water reaches late due to which the crops get dried. Over the past 200 years, farmers in
both hill areas and the Terai of Nepal have developed simple irrigation systems based on
diversion of water from seasonal or permanent streams and rivers. The systems were
referred to as farmer-managed irrigation systems (FMIS). This sort of manual irrigation
system provide variable amount of water that is sometimes excess or sometimes
insufficient than that required for the suitable growth of crops .Thus, the farmer has to toil
himself all day and night to monitor the moisture content in the soil.
The advances in the technologies related to wireless communication has led to the
emergence of several engineering designs to aid the human requirements. As we all know
Agriculture play a significant role in developing country like Nepal and implementing
mobile communication for facilitating farmers is the basic idea of our project. GSM
BASED AUTOMATIC IRRIGATION SYSTEM is a simpler, multipurpose, cost-
effective design to control the on-off mechanism of an electric motor for irrigation in the
field via Short Message Service (SMS). This tends to utilize the availability of GSM
network, mobile phones and electronic circuits to achieve an automated system which is
programmed to work as a thinking device to accomplish this purpose. Besides self-
monitoring the moisture content of the soil, this system will also give auxiliary control to
the user to enable him/her to irrigate the field from a remote place In this system, the
motor work on its own with the help of inputs received from the sensors which is
measuring the moisture content of agricultural land and farmer can monitor whether
everything is going normal or some action is needed to be taken. The entire process is
controlled and monitored. Automating farm or nursery irrigation allows farmers to apply
the right amount of water at the right time, regardless of the availability of labor to turn
motors on and off. In addition, farmers using automation equipment are able to reduce
runoff from over watering saturated soils, avoid irrigating at the wrong time of day,
which will improve crop performance by ensuring adequate water and nutrients when
needed. Automatic Irrigation is a valuable tool for accurate soil moisture control in highly
specialized greenhouse vegetable production and it is a simple, precise method for
irrigation. In this project there are soil moisture sensors for monitoring the moisture
content of soil which continuously inform about the moisture present in the soil. There is
provision of selecting the amount of moisture content required for different crops.
Whether we have to irrigate the rice field that requires more water or some other crops
that require less amount of moisture content, this system provides suitable moisture for
various types of crops. Use of GSM network can work out irrigation system with low
cost. This system monitors land owner's soil moisture, and send message to the land
owner about the status of field and irrigates the field if there is need of irrigation and the
motor is switched off automatically after the necessary condition of moisture is met.
1
1.2 Objectives
The main the objective of the project will be concentrated towards the development of the
system that works on SMS feature of the mobile phone. The objectives of our system can
be divided into two categories which are as follows.
2
Chapter 2
Literature Review
Many research have been done in the agriculture field, most of them are concentrating on
sensors parameters and automatic switching mechanisms of pumps based on sensor’s
signals. The literature review shows that, with the wide spread use of cellular networks,
automatic irrigation systems have been applied through wireless technology at the farm
area incorporating GSM technology with mobile phone through the mobile network. The
technology is one of the factors which limit the implementation of some of the automated
irrigation system in developing countries.
GSM is the most popular and widely used digital mobile telephony system in the world.
According to GSM world, it is now used by over 1.5 billion people all over the world. Hence
the Ubiquity of GSM enables international roaming arrangements between mobile phone
operators and provides their subscribers the use of the phone in many parts of the world.
Besides that, GSM is considered a second generation (2G) cell phone system as both the
signaling and speech channels are digital which differs from the previous technology.
3
Year GSM Development
1982 European Conference of Postal and
Telecommunications Administrations (CEPT)
created the Group Special Mobile (GSM) to
develop a standard for mobile telephone system in
Europe.
GSM also found a low-cost implementation of the SMS, short message service, which
has since been supported on other cellular phone standards as well. For example, the
worldwide emergency telephone number feature (112) is included. GSM uses
narrowband Time Division Multiple Access (TDMA) for voice and Short Messaging
Service (SMS). TDMA is a technology used in digital mobile phone communication that
divides each cellular channel into 3 time slots to increase the amount of data that can be
carried. GSM digitizes and compresses data, then sends it down a channel with 2 other
user data in its own time slot.
4
2.2 SHORT MESSAGE SERVICE (SMS)
SMS stands for Short Message Service. It is a technology that enables the sending and receiving
of message between mobile phones. SMS first appeared in Europe in 1992. It was included in
the GSM (Global System for Mobile Communication) standards right at the beginning. Later it
was ported to wireless technologies like CDMA and TDMA. The GSM and SMS standards were
originally developed by ETSI. ETSI is the abbreviation for European Telecommunication Standard
Institute. Now the 3GPP (Third Generation Partnership Project) is responsible for the
development and maintenance of the GSM and SMS standards. One SMS message can contain
at most 140 bytes (1120 bits) of data, so one SMS message can contain up to:
Once the message is sent the message is received by SMSC, which must then get it to the
appropriate mobile device. To do this the SMSC sends a SMS request to Home Location
Register (HLR) to find the roaming customer. Once HLR receives the request, it responds
to the SMSC with the subscriber’s status i.e. Inactive or active subscriber is roaming.
If the response is “inactive“, then the SMSC will hold onto the message for a period of
time. When the subscriber access his device, the HLR sends a SMS notification to the
SMSC and the SMSC will attempt delivery.
The SMSC transfer the message in a Short Message Delivery Point to Point format to the
serving system. The system pages the device, and if it responds, the message gets
delivered. The SMSC receives verification that the message was received by the end user
then categorizes the message a “sent” and will not attempt to send again. SMS provides a
mechanism for transmitting short message to and from wireless devices. The service
makes a use of a SMSC, which acts as a store and forward system for short messages.
5
2.3 COMPONENTS DESCRIPTION
ATmega16
ATmega16 is an 8-bit high performance microcontroller of Atmel’s Mega AVR family
with low power consumption. Atmega16 is based on enhanced RISC (Reduced
Instruction Set Computing, Know more about RISC and CISC Architecture) architecture
with 131 powerful instructions. Most of the instructions execute in one machine cycle.
Atmega16 can work on a maximum frequency of 16MHz. The operating voltage for
ATmega16 is 2.7V to 5.5V at the extended operating temperature of 233K to 153K.
ATmega16 has 16 KB programmable flash memory, static RAM of 1 KB and EEPROM
of 512 Bytes. The endurance cycle of flash memory and EEPROM is 10,000 and
100,000, respectively. IT also consists of 32*8 general purpose working resistors.
ATmega16 is a 40 pin microcontroller. There are 32 I/O (input/output) lines which are
divided into four 8-bit ports designated as PORTA, PORTB, PORTC and PORTD.
ATmega16 has various in-built peripherals like USART, ADC, Analog Comparator, SPI,
JTAG etc. Each I/O pin has an alternative task related to in-built peripherals. It consists
of 10-bit ADC. IT also consists of one 8 bit and one 16 bit General Purpose
Timer/counter with prescaler, compare mode and capture.
6
Pin configuration description:
Pin Pin name Description Alternate Function
No.
1 (XCK/T0) PB0 I/O PORTB, Pin T0: Timer0 External Counter Input.
0 XCK : USART External Clock I/O
2 (T1) PB1 I/O PORTB, Pin T1:Timer1 External Counter Input
1
3 (INT2/AIN0) PB2 I/O PORTB, Pin AIN0: Analog Comparator Positive
2 INT2: External Interrupt 2 Input
I/P
4 (OC0/AIN1) PB3 I/O PORTB, Pin AIN1: Analog Comparator
3 Negative I/P
OC0 : Timer0 Output Compare
Match Output
5 (SS) PB4 I/O PORTB, Pin In System Programmer (ISP)
4 Serial Peripheral Interface (SPI)
6 (MOSI) PB5 I/O PORTB, Pin 5
11 GND GROUND
7
4 Outputs
31 GND GROUND
8
Figure 2.3.2: Pin descriptions and Architecture of ATmega16
The AVR core combines a rich set with 32 general purpose working resisters which are
connected to the Arithmetic Logic Unit (ALU), allowing two independent registers to be
accessed in one single instruction executed in one clock cycle. The resulting architecture
is more code efficient while achieving throughputs up to ten times faster than
conventional CISC microcontroller.
Features of ATmega16:
1. 16 KB of in system programmable flash with Read-Write capabilities
2. 512 bytes of EEPROM
3. 27 general purpose I/O lines
4. 32 general purpose working resistors
5. One UART HW LIN
6. 11 channel 10-bit ADC
7. 10-bit DAC
9
GSM Modem
Modem stands for modulator-demodulator. It is a communication device that can
modulate an analog carrier signal with digital data and transmit, while it also demodulates
the incoming modulated signal to extract the analog information. There can be wired as
well as wireless modems. We are using the later one where in the modem captures the
modulated carrier signal with an antenna connected to it. A GSM Modem is a wireless
modem that works with a GSM wireless network. Like a GSM Mobile Phone, a GSM
Modem requires a SIM card from a wireless carrier in order to operate. Once a GSM
Modem is placed and powered it is ready to function as a receiver and transmitter GSM
Modem supports a set of AT commands. Our project focuses on reading, writing,
sending, receiving and deleting SMS messages via AT commands. The GSM we used is
SIM 900 and its works on 9600 bps.
10
Moisture sensor (Model: SEN92355P)
This Moisture Sensor can be used to detect the moisture of soil or judge if there is water
around the sensor, let the plants in your garden reach out for human help. They can be
very easy to use, just insert it into the soil and then read it. With the help of this sensor, it
will be realizable to make the plant remind you hey I am thirsty now, please give me
some water. The moisture sensor which can be used to detect the moisture of the soil.
When the soil moisture deficits, the sensor output value will decrease. You can know
whether a plant needs water or not by observing the results that the sensor outputs. Soil
moisture sensor based on soil resistivity measurement. It is a transducer which measures
the moisture contains in the soil and convert it into electrical form. Thus observed value
is in analog form and further more processing it is converted into digital form. This
moisture sensor is easily available in the local market and easy to use. In this sensor there
are three pins one for ground, next for supply and next for signal.
11
GSM Mobile Set
LCD
LCD (Liquid Crystal Display) is an electronic display module commonly used in various
devices and circuits. LCDs are economical, easily programmable, have no limitation of
displaying special and even custom characters and so on. This LCD has two registers
namely Command and Data. The command register stores the command instructions
given to the LCD. A command is an instruction given to LCD to do a predefined task like
initializing it, clearing its screen, setting the cursor position, controlling display etc. The
data register stores the data to be displayed on the LCD. The data is the ASCII value of
the character to be displayed on the LCD.
12
Table 2.3.4.1: Pin Function
13
Regulator IC (LM 7805)
The LM7805 monolithic 3-terminal positive voltage regulators employ internal current-
limiting, thermal shutdown and safe-area compensation, making them essentially
indestructible. If adequate heat sinking is provided, they can deliver over 1.0A output
current. They are intended as fixed voltage regulators in a wide range of applications
including local (on-card) regulation for elimination of noise and distribution problems
associated with single-point regulation. In addition to use as fixed voltage regulators,
these devices can be used with external components to obtain adjustable output voltages
and currents. Considerable effort was expended to make the entire series of regulators
easy to use and minimize the number of external components. It is not necessary to
bypass the output, although this does improve transient response. Input bypassing is
needed only if the regulator is located far from the filter capacitor of the power supply
14
REGISTER
Resistor is a component that resists the flow of direct or alternating electric circuit.
Resistors can limit or divide the current, reduce the voltage, protect an electric circuit,
or provide large amounts of heat or light. They are often color coded by three or four
color bands that indicate the specific value of resistance. Resistors obey ohm’s law,
which states that the current density is directly proportional to the electric field when
the temperature is constant.
LEDS
A light-emitting diode (LED) is a semiconductor light source which is used as
indicator lamps in many devices and is increasingly used for other lighting purposes.
The color of the light (corresponding to the energy of the photon) which is determined
by the energy gap of the semiconductor pattern. LEDs are cheap and faster switching.
15
Figure 2.3.9: LED
Chapter 3
Design and Implementation
Start
Initialise
LCD
And
Motors and
leds
Is Is
miscall Fields
Received? X<<level?
Is
X>level?
stop
16
3.2 Block Diagram
The moisture content of the soil is continuously measured by the sensor. It’s value and
the status of motor i.e. ON or OFF condition of motor is displayed continuously on the
LCD. Now the user is allowed to select the type of field he wants to irrigate. Whether we
have to irrigate a rice field that requires a lot of water or any other field that require
moderate or the less amount of water, we can directly select the field type from the
keypad. If the user is far from the cultivated area, then he can just give miscall in order to
know the moisture content. If there is a enough moisture in the soil i.e. there is no need to
irrigate the field then the motor is not switched on but if the moisture content is very less
i.e. there is a need of irrigation then the motor is switched on automatically and after the
field attains the required moisture content, then the motor is switched off automatically
17
3.3 Circuit diagram
19
Chapter 4
Software Components
It is often not wise to get a programming into an assembly language if you have high
level programming options that is to say if you have flexibility to write a code into a C
language then you are not supposed to jump into an assembly language. Thus, you have
wide varieties of options for a high level programming in 8051 microcontrollers. The
most common of all is the C language. C language, being a high level language, has
many important advantages over assembly language like portability, automatic proper
handling of various data types including data arithmetic, ease of data organization, ease
of expressing program logic, etc. It is much easier to write a program in C than in
assembly language. C language programming is also much less error prone. The software
portion include the programming of the ATmega16 chip for the whole operation of the
designed system. C language was used to code the program and was converted into hex
code to load it into the flash memory of microcontroller. The program includes the
interfacing of sensors and LCD module unit to the microcontroller. Intel hex code is
generated and burnt into the microcontroller chip using suitable programmer. The
software is well commented and easy to understand.
4.3 Proteus
Proteus is software for microprocessor simulation, schematic capture, and printed circuit
board (PCB) design. It is developed by Lab center Electronics. System components
21
Chapter 5
DESIGN VERIFICATION
5.1. Testing Hardware
Microcontroller test
Much of the testing with this project involved debugging the micro controller code and
interfacing the micro controller with the wired and PCB designed hardware. The debugging
entailed positioning various print statements throughout the code to see exactly which code
were executed. Oftentimes, it was difficult to determine if a problem was rooted in the
hardware wiring or in the source code. We used the computer monitor to explicitly output the
code executed and the oscilloscope to diagnose any potential hardware problems.
The biggest hurdle we had to overcome was making sure that each input was sent to the
right port of the micro controller. This was ensured with numerous compare statements
within the micro code. Therefore, if the micro controller read signals different than those
expected, this could be easily detected when the program was stuck in an endless loop
outputting error statements. Only when the micro controller recognized a valid input did
it jump to the next loop.
Making sure that the micro controller output the correct signals was also important. This
was verified using a number of test LEDs placed in appropriate locations within in our
circuit. If an LED was erroneously triggered, we first traced it back to the source code to
see if any of the instructions interpreted the inputs incorrectly. Next, we looked at how
the particular component was wired and determined if it was behaving correctly based on
the signal sent to it by the micro controller. Ultimately, this was how many of our
debugging problems were rectified. As a result, interfacing the microcontroller with the
rest of our circuit proved to be long and iterative trial and error process.
Sensor module test
Testing with moisture sensor module really need continuation effort. The sensor was
placed in different places for checking the proper amount of moisture content in the soil
such that microcontroller can detect the change in resistivity of the soil. In this project
placing the moisture sensor at the centre of the field we checked the state of the fields
through the resistivity.
GSM module test
By using the GSM SIM 900 the test was over using AT commands for receiving, sending
and reading the SMS in the user mobile.
5.2 Software testing
The software was coded in C language. C Language is peculiar to the processor. Due to
this fact we test the assembly code in a simulator for 8051.After the result was achieved
as desired, the code was burned converting into HEX file using AVR assembler. The Hex
file was loaded into microcontroller ATmega16 and was tested using led for output.
22
6. RESULTS
1. With our project we became successful to demonstrate with regarding the objectives of
the project.
2. The moisture content of the three different types of field were measured successfully.
3. Motor automatically turn on or off with the different level of moisture level content in
the soil.
4. Farmer successfully got the status of his fields whether dry or wet by just giving
miscall from his master mobile.
5. We became successful to meet the moisture content of the crops with their specific
level of moisture content.
23
7. LIMITATIONS
Limitations relating to the software as well as hardware are present. Some of the major
limitation may be grouped as follows.
1. Single moisture sensor only cover the small area of fields
3. Some chemical reaction erode the sensitivity and physical structure of sensor
4. Lack of knowledge about the fixed moisture content require for the particular fields
24
8. APPLICATION AND SCOPE
1. Nowadays due to the increase in the different facilities population is increasing day by
day and since food is one of the basic need of human beings , to make it available for the
billions trillions of people in the world the traditional type of agricultural is not sufficient.
The system we have designed is based on Agricultural technology.
2. In the agricultural countries like Nepal, Maldives and other highly developed countries
which produce the particular amount of agriculture product like Brazil and other
European countries this system can enhance their production in the scientific way.
3. Since farmer can know the status of the fields from anywhere through his/her mobile
and it consumes less time.
25
9. FURTURE ENHANCEMENTS
The scope of our project “GSM Based Automatic Irrigation System” is immense. The
future implications of the project are very great considering the amount of time, money
and resources it saves. The project we have undertaken can be used as a reference or as a
base for realizing a scheme to be implemented in other projects of greater level such as
GSM pump controller, weather updates using mobile phones, pest control, control
farming vehicles using mobiles, etc. The project itself can be modified to achieve a
complete Automatic Irrigation system which will then create a platform for the user to
interface between him and the agricultural field.
26
10. CONCLUSION
By using Hardware and software knowledge we built the “GSM Based Automatic
Irrigation System”. We became successful to receive the message about the state of the
field that is whether the land is dry or wet through the GSM interfacing. The result of our
design has met our expectation, in which every components is working well. Our
irrigation system is easy to use, comparatively cheap in that case that by just giving a
miscall we can received the state of the field, Moisture sensor interfacing helps to detect
the moisture content of the fields and comparing the value predefine in the buffer helps to
automatically to turn on/off the motor easily, low power consumption and highly reliable.
The LCD also offer great interface and user can be familiar with the system and know the
state of the field by just reading the message displayed on the LCD. The three push to on
switch are corresponding used for three different crops so that this somewhat meet the
requirement of farmer and farmer are free from the fact of irrigation overflow or
underflow problems for growing the crop.
The system we had design is also secure because the master SIM only can only receive
the message of the state of the field. This system saves the valuable time of the farmers
and free from worrying about the field and helps to increase the production of the crops
because this system provides the defined amount of water to the particular fields.
If we are given the chance to build it again the number of moisture sensor that should cover
the large field will be under the considerations.
27
10. References
1. M. A. Mazidi, J. G. Mazidi & R. D. Mckinlay, “The 8051 microcontroller and
Embedded System”,prentice hall.(c) 3,No. 2(2006)
2. www.engineersgarage.com
3. http://www.way2project.com
4. www.atmegaavr.com
28
APPENDIX 1.1
COST ESTIMATION
Components Quantity Price (in Rs)
ATmega16 1 350
Push to On switch 4 60
LCD 1 350
DC motor 1 300
Relay 1 35
Documentation 6 6500
29
APPENDIX 1.2
Some of the AT commands used in GSM SIM 900 communication
30
– Extracted from www.Engineersgarrage.com
31
Successful demonstration with some shot during presentation
32
33