0% found this document useful (0 votes)
148 views54 pages

A - Team 15 Smart Irrigation

The document describes a smart irrigation system that uses soil moisture sensors, a microcontroller, and IoT technology to remotely monitor soil moisture levels and control sprinklers. The system sends sensor readings to a web page using a GSM modem and ThingSpeak platform. This allows farmers to monitor soil moisture from anywhere and automate irrigation when needed, reducing water waste and increasing agricultural production efficiency. Key components include an Arduino board, soil moisture sensors, motor, motor driver, GSM modem, and online data visualization using ThingSpeak.

Uploaded by

Bindu Netha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
148 views54 pages

A - Team 15 Smart Irrigation

The document describes a smart irrigation system that uses soil moisture sensors, a microcontroller, and IoT technology to remotely monitor soil moisture levels and control sprinklers. The system sends sensor readings to a web page using a GSM modem and ThingSpeak platform. This allows farmers to monitor soil moisture from anywhere and automate irrigation when needed, reducing water waste and increasing agricultural production efficiency. Key components include an Arduino board, soil moisture sensors, motor, motor driver, GSM modem, and online data visualization using ThingSpeak.

Uploaded by

Bindu Netha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 54

SMART IRRIGATION SYSTEM

1.INTRODUCTION AND BACKGROUND OF THE PROJECT


Agriculture is the unquestionably the largest livelihood provider in India. With a rising population,
there is a need for increased agricultural production. In order to support greater production in
farms, the requirement of the amount of freshwater used in irrigation also rises. Currently,
agriculture accounts 83% of the total water consumption in India [1]. Unplanned use of water
inadvertently results in wastage of water. This suggests that there is an urgent need to develop
systems that prevent water wastage without imposing pressure on farmers.Over the past 15 years,
farmers started using computers and software systems to organize their financial data and keep
track of their transactions with third parties and also monitor their crops more effectively [2].
In the Internet era, where information plays a key role in people's lives, agriculture is
rapidly becoming a very data intensive industry where farmers need to collect and evaluate a huge
amount of information from a diverse number of devices (eg., sensors, farming machinery etc.) in
order to become more efficient in production and communicating appropriate information [3].With
the advent of open source Arduino boards along with cheap moisture sensors, it is viable to create
devices that can monitor the soil moisture content and accordingly irrigate the fields or the
landscape as an when needed. The proposed system makes use of microcontroller ATMEGA328P
on arduino uno platform and IOT which enable farmers to remotely monitor the status of
sprinklers installed on the farm by knowing the sensor values thereby, making the farmers' work
much easier as they can concentrate on other farm activities

1.1 PROPOSED SYSTEM


The system is a combination of hardware and software components. The hardware part
consists of embedded system and software is the webpage designed using PHP. The webpage is
hosted online and consists of a database in which readings from sensors are inserted using the
hardware.

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 1


SMART IRRIGATION SYSTEM

Fig 1.1 Overall Engineering Design

1.2 Control Section

Information from the sensors is transmitted to the arduino board. The arduino board
consists of microcontroller ATMEGA328P which is responsible for controlling the switching
on/off of the motor on which water sprinklers can be attached. Sensor values from arduino are
transmitted to the GSM-GPRS SIM900A modem. A sim with 3G data pack is inserted into this
modem which provide IOT features to the system. Values are further transmitted to the IOT
section through the modem.

The GSM modem is a highly flexible plug and play quad bandSIM900A GSM modem for
direct and easy integration to RS232 applications. It Supports features like Voice, SMS, Data/Fax,
GPRS and integrated TCP/IP stack. The tx and rx pins from the arduino are connected to the rx
and tx of GSM modem respectively.

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 2


SMART IRRIGATION SYSTEM

1.3.IOT Section
This section comprises a web page which displays the current water sprinkler status i.e. on
or off and a button which redirects the user to a thing speak page which graphically depicts the
sensor values.

Fig 1.2 sensor values

a) BLOCK DIAGRAM

Fig 1.3 Block diagram

b) Schematic Diagram

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 3


SMART IRRIGATION SYSTEM

Fig 1.4 : Schematic diagram

c) Major Building Blocks of this project

1. Arduino Microcontroller
2. LCD
3. Soil Moisture Sensor
4. Wi-Fi Module
5. Motor
6. Motor Driver
7. Thingspeak.com

2. LITARETURE SURVEY

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 4


SMART IRRIGATION SYSTEM

In A Remote Measurement and Control System for Greenhouse Based on GSM-SMS [4] the
proposed system introduced a GSM-SMS remote measurement and control system for greenhouse
based on PC-based database system connected with base station. Base station is developed by
using a microcontroller, GSM module, sensors and actuators. In practical operation, the central
station receives and sends messages through GSM module. Criterion value of parameters to be
measured in every base station is set by central station, and then in base stations parameters
including the air temperature, the air humidity.Indu et al. (2013) [5] mainly focuses on reviews in
the field of remote monitoring and control, the technology used and their potential advantages.
The paper proposes an innovative GSM/Bluetooth based remote controlled embedded
system for irrigation. The system sets the irrigation time depending on the temperature and
humidity reading from sensors and type of crop and can automatically irrigate the field when
unattended. Information is exchanged between far end and designed system via SMS on GSM
network. A Bluetooth module is also interfaced with the main microcontroller chip which
eliminates the SMS charges when the user is within the limited range of few meters to the
designated system. The system informs users about many conditions like status of electricity, dry
running motor, increased temperature, water content in soil and smoke via SMS on GSM network
or by Bluetooth.
[6], R.Suresh et al. (2014) mentioned about using automatic microcontroller based rain gun
irrigation system in which the irrigation will take place only when there will be intense
requirement of water that save a large quantity of water. These systems bring a change to
management of field resource where they developed a software stack called Android is used for
devices that include an operating system, middleware and key applications. The Android SDK
provides the tools and APIs necessary to begin developing applications on the Android platform
using the Java programming language. Mobile phones have almost become an integral part of us
serving multiple needs of humans. This application makes use of the GPRS feature of mobile
phone as a solution for irrigation control system. These system covered lower range of agriculture
land and not economically affordable. In IOT SMS alarm system based on SIM900A
[7], an IOT alarm system based on SIM900A module of SIMCOM Company was designed
for greenhouse. The system can gather environmental parameters such as air temperature and air
humidity. Meanwhile, with the use of AT command, this system can also realize SMS automatic

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 5


SMART IRRIGATION SYSTEM

sending and receiving, environmental parameters overrun alarm and insufficient balance alarm.
Through the system setting, the alarm message can be sent to the user-specified mobile phone
automatically no matter what the users' location is. This system as a typical application of IOT in
the agriculture has got some satisfactory results in the actual operation.

3.INTRODUCTION

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 6


SMART IRRIGATION SYSTEM

3.1 GENERAL INTRODUCTION


An embedded system is a combination of software and hardware to perform a dedicated task.
Some of the main devices used in embedded products are Microprocessors and Microcontrollers.
Microprocessors are commonly referred to as general purpose processors as they simply accept the
inputs, process it and give the output.
In contrast, a microcontroller not only accepts the data as inputs but also manipulates it,
interfaces the data with various devices, controls the data and thus finally gives the result. In this
project we use RF module as well as the DTMF decoder for communication. Now when we dial
the numbers in the mobile phone from the controlling side then it automatically recognizes which
number has been recorded and it follows with the corresponding next step to be taken i.e.,
movement of the robot in water.
3.1.1 Introduction Of Embedded System
An Embedded System is a combination of computer hardware and software, and perhaps
additional mechanical or other parts, designed to perform a specific function. A good example is
the microwave oven. Almost every household has one, and tens of millions of them are used every
day, but very few people realize that a processor and software are involved in the preparation of
their lunch or dinner.
This is in direct contrast to the personal computer in the family room. It too is comprised of
computer hardware and software and mechanical components (disk drives, for example).
However, a personal computer is not designed to perform a specific function rather; it is able to do
many different things. Many people use the term general-purpose computer to make this
distinction clear. As shipped, a general-purpose computer is a blank slate; the manufacturer does
not know what the customer will do wish it. One customer may use it for a network file server
another may use it exclusively for playing games, and a third may use it to write the next great
American novel.

3.2 Block Diagram Of Embedded System

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 7


SMART IRRIGATION SYSTEM

Now, the details of the various building blocks of the hardware of an embedded system as shown
in fig 3.1 are
 Central processing unit (CPU)
 Memory (Read-only Memory and Random Access Memory)
 Input Devices
 Output Devices
 Communication interfaces
 Applications-specific circuitry

Fig 3.1 Block Diagram of Embedded System


3.2.1Central Processing Unit (CPU)

The Central Processing Unit (processor, in short) can be any of the following
microcontroller, microprocessor or Digital Signal Processor (DSP). A micro-controller is a low-
cost processor. Its main attraction is that on the chip itself, there will be many other components
such as memory, serial communication interface, analog-to digital converter etc. so, for small
applications, a micro-controller is the best choice as the number of external component
required will be very less. On the other hand, microprocessors are more powerful, but you need to
use many external components with them. DSP is used for many applications for signal processing
3.2.2 Memory

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 8


SMART IRRIGATION SYSTEM

The memory is categorized as Random Access Memory (RAM) and Read Only Memory
(ROM). The contents of the RAM Will be erased if power is switched off of to the chip, whereas
ROM retains the contents even if the power is switched off. So, the firmware is stored in the
ROM. When power is switched on, the processor reads the ROM; the program is executed.

3.2.3 Input devices


Unlike the desktops, the input devices to an embedded system have very limited capability.
There will be no keyboard or a mouse, and hence interacting with the embedded system is not an
easy task. Many embedded systems will have a small keyboard-you press one key to give a
specific command. A keypad may be used to input only the digits. Many embedded systems used
in process control do not have any input device for user interaction; they take inputs from sensors
are transducers and produce electrical signals that are in turn fed to other systems.
3.2.4 Output devices
The output devices of the embedded systems also have very limited capability. Some embedded
systems will have a few Light Emitting Diodes (LEDs) to indicate the health status of the system
modules, or for visual indication of alarms. A small Liquid Crystal Display (LCD) may also be
used to display some important parameters
3.2.5 Communication interfaces
The embedded system may need to, interact with other embedded system at they may have to
transmit data to a desktop. To facilitate this, the embedded system are provided with one or a few
communication interfaces such as RS232, RS422,RS485, Universal Serial Bus (USB), and IEEE
1394, Ethernet etc.
3.2.6 Application-specific circuitry
Sensors, transducers, special processing and control circuitry may be required for an embedded
system, depending on its application. The enter hardware has to be given power supply either
through the 230 volts main supply or through a battery. The hardware as to design in such a way
that the power consumption is minimized.
Security is the condition being protected against danger or loss. In the general sense, security
is a concept similar to safety. The nuance between the two is an added emphasis on being
protected from dangers that originate from outside. Individuals or actions that encroach up on the
Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 9
SMART IRRIGATION SYSTEM

condition of protection or responsible for the breach of security. The word “security” in general
usage is synonymous with “safety,” but as a technical “security” means that something not only is
secure but that it has be secured. One of the best options for providing good security is by using a
technology named EMBEDDED SYSTEM.

3.3 OVERVIEW OF EMBEDDED SYSTEMS


An embedded system is a computer system designed to perform one or a few dedicated
functions often with real-time computing constraints. It is embedded as part of a complete device
often including hardware and mechanical parts. By contrast, a general-purpose computer, such as a
personal computer (PC), is designed to be flexible and to meet a wide range of end-user needs.
Embedded systems control many devices in common use today.
Embedded systems are controlled by one or more main processing cores that are typically
either microcontrollers or digital signal processors (DSP). The key characteristic, however, is
being dedicated to handle a particular task, which may require very powerful processors. For
example, air traffic control systems may usefully be viewed as embedded, even though they
involve mainframe computers and dedicated regional and national networks between airports and
radar sites. (Each radar probably includes one or more embedded systems of its own.)
Since the embedded system is dedicated to specific tasks, design engineers can optimize it to
reduce the size and cost of the product and increase the reliability and performance. Some
embedded systems are mass-produced, benefiting from economies of scale.
Physically embedded systems range from portable devices such as digital watches and MP3
players, to large stationary installations like traffic lights, factory controllers, or the systems
controlling nuclear power plants. Complexity varies from low, with a single microcontroller
chip, to very high with multiple units, peripherals and networks mounted inside a large chassis or
enclosure.
In general, "embedded system" is not a strictly definable term, as most systems have some
element of extensibility or programmability. For example, handheld computers share some
elements with embedded systems such as the operating systems and microprocessors which power
them, but they allow different applications to be loaded and peripherals to be connected.
Moreover, even systems which don't expose programmability as a primary feature generally need

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 10


SMART IRRIGATION SYSTEM

to support software updates. On a continuum from "general purpose" to "embedded", large


application systems will have subcomponents at most points even if the system as a whole is
"designed to perform one or a few dedicated functions", and is thus appropriate to call
"embedded". A modern example of embedded system is shown in fig: 3.2.

Fig 3.2 A Modern Example of Embedded System

Labeled parts include microprocessor (4), RAM (6), flash memory (7).Embedded systems
programming is not like normal PC programming. In many ways, programming for an embedded
system is like programming PC 15 years ago. The hardware for the system is usually chosen to
make the device as cheap as possible. Spending an extra dollar a unit in order to make things
easier to program can cost millions. Hiring a programmer for an extra month is cheap in
comparison. This means the programmer must make do with slow processors and low memory,
while at the same time battling a need for efficiency not seen in most PC applications. Below is a
list of issues specific to the embedded field.
3.3.1 History
In the earliest years of computers in the 1930–40s, computers were sometimes dedicated to a
single task, but were far too large and expensive for most kinds of tasks performed by embedded
computers of today. Over time however, the concept of programmable controllers evolved from

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 11


SMART IRRIGATION SYSTEM

traditional electromechanical sequencers, via solid state devices, to the use of computer
technology.
One of the first recognizably modern embedded systems was the Apollo Guidance Computer,
developed by Charles Stark Draper at the MIT Instrumentation Laboratory. At the project's
inception, the Apollo guidance computer was considered the riskiest item in the Apollo project as
it employed the then newly developed monolithic integrated circuits to reduce the size and weight.
An early mass-produced embedded system was the Automatics D-17 guidance computer for the
Minuteman missile, released in 1961. It was built from transistor logic and had a hard disk for
main memory. When the Minuteman II went into production in 1966, the D-17 was replaced with
a new computer that was the first high-volume use of integrated circuits.
3.3.2 Tools
Embedded development makes up a small fraction of total programming. There's also a large
number of embedded architectures, unlike the PC world where 1 instruction set rules, and the
UNIX world where there's only 3 or 4 major ones. This means that the tools are more expensive. It
also means that they're lowering featured, and less developed. On a major embedded project, at
some point you will almost always find a compiler bug of some sort.
Debugging tools are another issue. Since you can't always run general programs on your
embedded processor, you can't always run a debugger on it. This makes fixing your program
difficult. Special hardware such as JTAG ports can overcome this issue in part. However, if you
stop on a breakpoint when your system is controlling real world hardware (such as a motor),
permanent equipment damage can occur. As a result, people doing embedded programming
quickly become masters at using serial IO channels and error message style debugging.
3.3.3 Resources
To save costs, embedded systems frequently have the cheapest processors that can do the job.
This means your programs need to be written as efficiently as possible. When dealing with large
data sets, issues like memory cache misses that never matter in PC programming can hurt you.
Luckily, this won't happen too often- use reasonably efficient algorithms to start, and optimize
only when necessary. Of course, normal profilers won't work well, due to the same reason
debuggers don't work well.Memory is also an issue. For the same cost savings reasons, embedded
systems usually have the least memory they cZan get away with. That means their algorithms must

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 12


SMART IRRIGATION SYSTEM

be memory efficient (unlike in PC programs, you will frequently sacrifice processor time for
memory, rather than the reverse). It also means you can't afford to leak memory It also means you
can't afford to leak memory. Embedded applications generally use deterministic memory
techniques and avoid the default "new" and "malloc" functions, so that leaks can be found and
eliminated more easily. Other resources programmers expect may not even exist. For example,
most embedded processors do not have hardware FPUs (Floating-Point Processing Unit). These
resources either need to be emulated in software, or avoided altogether.
3.3.4. Real Time Issues
Embedded systems frequently control hardware, and must be able to respond to them in real
time. Failure to do so could cause inaccuracy in measurements, or even damage hardware such as
motors. This is made even more difficult by the lack of resources available. Almost all embedded
systems need to be able to prioritize some tasks over others, and to be able to put off/skip low
priority tasks such as UI in favor of high priority tasks like hardware control
3.4 NEED FOR AN EMBEDDED SYSTEMS
The uses of embedded systems are virtually limitless, because every day new products are
introduced to the market that utilizes embedded computers in novel ways. In recent years,
hardware such as microprocessors, microcontrollers, and FPGA chips have become much cheaper.
So when implementing a new form of control, it's wiser to just buy the generic chip and write your
own custom software for it. Producing a custom-made chip to handle a particular task or set of
tasks costs far more time and money. Many embedded computers even come with extensive
libraries, so that "writing your own software" becomes a very trivial task indeed. From an
implementation viewpoint, there is a major difference between a computer and an embedded
system. Embedded systems are often required to provide Real-Time response. The main elements
that make embedded systems unique are its reliability and ease in debugging.
3.4.1 Debugging
Embedded debugging may be performed at different levels, depending on the facilities
available. From simplest to most sophisticate they can be roughly grouped into the following
areas:
 Interactive resident debugging, using the simple shell provided by the embedded operating
system (e.g. Forth and Basic)

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 13


SMART IRRIGATION SYSTEM

 External debugging using logging or serial port output to trace operation using either a
monitor in flash or using a debug server like the Remedy Debugger which even works for
heterogeneous multi core systems.
 An in-circuit debugger (ICD), a hardware device that connects to the microprocessor via a
JTAG or Nexus interface. This allows the operation of the microprocessor to be controlled
externally, but is typically restricted to specific debugging capabilities in the processor.
 An in-circuit emulator replaces the microprocessor with a simulated equivalent, providing
full control over all aspects of the microprocessor.
 A complete emulator provides a simulation of all aspects of the hardware, allowing all of it
to be controlled and modified and allowing debugging on a normal PC.
 Unless restricted to external debugging, the programmer can typically load and run software
through the tools, view the code running in the processor, and start or stop its operation.
The view of the code may be as assembly code or source-code.
Because an embedded system is often composed of a wide variety of elements, the debugging
strategy may vary. For instance, debugging a software (and microprocessor) centric embedded
system is different from debugging an embedded system where most of the processing is
performed by peripherals (DSP, FPGA, co-processor). An increasing number of embedded
systems today use more than one single processor core. A common problem with multi-core
development is the proper synchronization of software execution. In such a case, the embedded
system design may wish to check the data traffic on the busses between the processor cores, which
requires very low-level debugging, at signal/bus level, with a logic analyzer, for instance.
3.4.2 Reliability
Embedded systems often reside in machines that are expected to run continuously for years
without errors and in some cases recover by them if an error occurs. Therefore the software is
usually developed and tested more carefully than that for personal computers, and unreliable
mechanical moving parts such as disk drives, switches or buttons are avoided.
Specific reliability issues may include:
 The system cannot safely be shut down for repair, or it is too inaccessible to repair.
Examples include space systems, undersea cables, navigational beacons, bore-hole
systems, and automobiles.

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 14


SMART IRRIGATION SYSTEM

 The system must be kept running for safety reasons. "Limp modes" are less tolerable. Often
backups are selected by an operator. Examples include aircraft navigation, reactor control
systems, safety-critical chemical factory controls, train signals, engines on single-engine
aircraft.
 The system will lose large amounts of money when shut down: Telephone switches, factory
controls, bridge and elevator controls, funds transfer and market making, automated sales
and service.
A variety of techniques are used, sometimes in combination, to recover from errors both
software bugs such as memory leaks, and also soft errors in the hardware:
 Watchdog timer that resets the computer unless the software periodically notifies the
watchdog
 Subsystems with redundant spares that can be switched over to
 software "limp modes" that provide partial function
 Designing with a Trusted Computing Base (TCB) architecture[6] ensures a highly secure &
reliable system environment
 An Embedded Hypervisor is able to provide secure encapsulation for any subsystem
component, so that a compromised software component cannot interfere with other
subsystems, or privileged-level system software. This encapsulation keeps faults from
propagating from one subsystem to another, improving reliability. This may also allow a
subsystem to be automatically shut down and restarted on fault detection.
 Immunity Aware Programming
3.5 EMBEDDED SOFTWARE
Various software’s can be for various purposes. ALP i.e. Assembly Language program can
be used as the back end the other software like C, VB, etc. can be in front end.
3.6 EMBEDDED SOFTWARE ARCHITECTURE
There are several different types of software architecture in common use.

3.6.1 Simple control loop

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 15


SMART IRRIGATION SYSTEM

In this design, the software has a loop. The loop calls the subroutines, each of which
manages a part of the hardware or software.
3.6.2 Interupt controlled loop
Some embedded systems are predominantly interrupt controlled. This means that tasks
performed by the system are triggered by different kinds of events. An interrupt could be
generated for example by a timer in a pre-defined frequency, or by a serial port controller
receiving a byte.
These kinds of the systems run a simple task in a main loop also, but this task is not
sensitive to expected delays. The tasks performed in the interrupt handlers should be kept short the
interrupt latency to a minimum. Some times longer tasks are added to a queue structure in the
interrupt handlers to be processed in the main loop lar.
3.6.3 Peripherals
Peripherals are the various devices that are connected to the CPU, for performing various
functions. Embedded systems talk with the outside world via peripherals, such as
Serial communication interfaces (SCI) RS-232, RS-422, RS-458 etc.
Synchronous serial communication interfaces (SSCI) 12C, JTAG, SPI, SSC and ESSI
Universal serial bus (USB)\
Network Controller area Network, etc.
Timer PLL(s), Capture/Compare and processing units.
Discrete I/O General Purpose Input/output(GPIO).
3.6.4 Processors
Processors are the key elements in any embedded system. They interact with the memory,
where the various instructions of useful functions into a single IC package.
The ability to execute a stored set of instructions to carry out user defined tasks .The ability to be
able to access external memory chips to both read and writes data from and to the memory.
3.6.5 Micro controller
Basically, a microcontroller is a device which integrates a number of the components of a
microprocessor system on to a single chip. So a microcontroller combines onto the same
microchip CPU core Memory) Most microcontrollers will also combine other devices such as
A Timer module to allow the microcontroller to perform tasks for certain periods.

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 16


SMART IRRIGATION SYSTEM

A serial I/O port to allow data to flow between the microcontroller and other devices such as a PC
or another microcontroller.
An ADC to allow the microcontroller to accept analogue input data for processing.
3.6.6 DSP
It is the study of the signals in digital representation and processing methods of these
signals. It is used where large mathematical and scientific calculations are required.
3.6.7 ASIC
It is an IC designed for a specific application. This IC designed for specific application
can’t be used for other application.

3.7 EXPLANATION OF EMBEDDED SYSTEMS


3.7.1 Software Architecture
There are several different types of software architecture in common use.
 Simple Control Loop:
In this design, the software simply has a loop. The loop calls subroutines, each of which
manages a part of the hardware or software.
 Interrupt Controlled System:
Some embedded systems are predominantly interrupt controlled. This means that tasks
performed by the system are triggered by different kinds of events. An interrupt could be
generated for example by a timer in a predefined frequency, or by a serial port controller receiving
a byte. These kinds of systems are used if event handlers need low latency and the event handlers
are short and simple.
Usually these kinds of systems run a simple task in a main loop also, but this task is not
very sensitive to unexpected delays. Sometimes the interrupt handler will add longer tasks to a
queue structure. Later, after the interrupt handler has finished, these tasks are executed by the main
loop. This method brings the system close to a multitasking kernel with discrete processes.

 Cooperative Multitasking:
A non-preemptive multitasking system is very similar to the simple control loop scheme,

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 17


SMART IRRIGATION SYSTEM

except that the loop is hidden in an API. The programmer defines a series of tasks, and each task
gets its own environment to “run” in. When a task is idle, it calls an idle routine, usually called
“pause”, “wait”, “yield”, “nop” (stands for no operation), etc. The advantages and disadvantages
are very similar to the control loop, except that adding new software is easier, by simply writing a
new task, or adding to the queue-interpreter.

 Primitive Multitasking:
In this type of system, a low-level piece of code switches between tasks or threads based
on a timer (connected to an interrupt). This is the level at which the system is generally considered
to have an "operating system" kernel. Depending on how much functionality is required, it
introduces more or less of the complexities of managing multiple tasks running conceptually in
parallel.
As any code can potentially damage the data of another task (except in larger systems
using an MMU) programs must be carefully designed and tested, and access to shared data must
be controlled by some synchronization strategy, such as message queues, semaphores or a non-
blocking synchronization scheme.
Because of these complexities, it is common for organizations to buy a real-time
operating system, allowing the application programmers to concentrate on device functionality
rather than operating system services, at least for large systems; smaller systems often cannot
afford the overhead associated with a generic real time system, due to limitations regarding
memory size, performance, and/or battery life.
 Microkernels and Exokernels:
A microkernel is a logical step up from a real-time OS. The usual arrangement is that the
operating system kernel allocates memory and switches the CPU to different threads of execution.
User mode processes implement major functions such as file systems, network interfaces, etc.
In general, microkernels succeed when the task switching and intertask communication
is fast, and fail when they are slow. Exokernels communicate efficiently by normal subroutine
calls. The hardware and all the software in the system are available to, and extensible by
application programmers. Based on performance, functionality, requirement the embedded
systems are divided into three categories.

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 18


SMART IRRIGATION SYSTEM

3.7.2 Stand Alone Embedded System


These systems takes the input in the form of electrical signals from transducers or
commands from human beings such as pressing of a button etc.., process them and produces
desired output. This entire process of taking input, processing it and giving output is done in
standalone mode. Such embedded systems comes under stand-alone embedded systems.
Eg: microwave oven, air conditioner etc..
3.7.3 Real-time embedded systems
Embedded systems which are used to perform a specific task or operation in a specific
time period those systems are called as real-time embedded systems. There are two types of real-
time embedded systems.
 Hard Real-time embedded systems:
These embedded systems follow an absolute dead line time period i.e.., if the tasking is
not done in a particular time period then there is a cause of damage to the entire equipment.
Eg: consider a system in which we have to open a valve within 30 milliseconds. If this valve is
not opened in 30 ms this may cause damage to the entire equipment. So in such cases we use
embedded systems for doing automatic operations.
 Soft Real Time embedded systems:
Eg: Consider a TV remote control system, if the remote control takes a few milliseconds
delay it will not cause damage either to the TV or to the remote control. These systems which will
not cause damage when they are not operated at considerable time period those systems comes
under soft real-time embedded systems.
3.7.4 Network communication Embedded systems
A wide range network interfacing communication is provided by using embedded
systems.
 Consider a web camera that is connected to the computer with internet can be used to spread
communication like sending pictures, images, videos etc.., to another computer with internet
connection throughout anywhere in the world.
 Consider a web camera that is connected at the door lock.

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 19


SMART IRRIGATION SYSTEM

Whenever a person comes near the door, it captures the image of a person and sends to
the desktop of your computer which is connected to internet. This gives an alerting message with
image on to the desktop of your computer, and then you can open the door lock just by clicking
the mouse. Fig: 2.2 show the network communications in embedded systems.

fig 3.3 Network Communication Embedded Systems

3.7.5 Different types of processing units

The central processing unit (c.p.u) can be any one of the following microprocessor,
microcontroller, digital signal processing.
 Among these Microcontroller is of low cost processor and one of the main advantage of
microcontrollers is, the components such as memory, serial communication interfaces,
analog to digital converters etc.., all these are built on a single chip. The numbers of
external components that are connected to it are very less according to the application.
 Microprocessors are more powerful than microcontrollers. They are used in major
applications with a number of tasking requirements. But the microprocessor requires many
external components like memory, serial communication, hard disk, input output ports
etc.., so the power consumption is also very high when compared to microcontrollers.
 Digital signal processing is used mainly for the applications that particularly involved with
processing of signals.

3.8 FEATURES

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 20


SMART IRRIGATION SYSTEM

The main feature of an embedded systems are its reliability and the scope for debugging.
3.8.1 Debugging
Debugging may be performed at different levels, depending on the facilities available,
ranging from assembly or source level debugging with an in circuit emulator or in circuit
debugger, to outputs from serial debug ports to an emulated environment running on a PC. As the
complexity of embedded systems grows, higher level tools and operating systems or migrating into
machinery where it makes sense.
3.8.2 Reliability
Embedded systems often reside in machines that are expected to run continuously for years
without errors and in some cases recover by themselves if any error occurs. Therefore the software
is usually developed and tested more carefully than that for PC, and unreliable mechanical moving
parts such as disk drivers, switches or buttons are avoided.
Specific reliable issues may include the system cannot safely be shut down for repair, or it
is too inaccessible to repair. Solutions may involve subsystems with redundant spares that can be
switched over to, or software “limp modes” that provide partial function “Limp modes” are less
tolerable. Often backups are selected by an operator. Examples include aircraft, navigation, reactor
control systems, safely critical chemical factory controls, train signals and engines on single-
engine aircraft.

3.9 APPLICATIONS OF EMBEDDED SYSTEMS


3.9.1 Consumer applications
At home we use a number of embedded systems which include microwave oven, remote
control, vcd players, DVD players, camera etc….

3.9.2 Office automation

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 21


SMART IRRIGATION SYSTEM

Fig 3.4 Fax machine

3.9.3 Industrial automation

Today a lot of industries are using embedded systems for process control. In industries we
design the embedded systems to perform a specific operation like monitoring temperature,
pressure,
humidity ,voltage, current etc.., and basing on these monitored In critical industries where human
presence is avoided there we can use robots which are programmed to do aspecific operation.

Fig 3.5 Robot

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 22


SMART IRRIGATION SYSTEM

4. HARDWARE DESCRIPTION
4.1 ARDUINO

Fig 4.1 : Arduino Board


The Arduino Uno R3 is a microcontroller board based on the ATmega328 (datasheet). It
has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a
16 MHz crystal oscillator, a USB connection, a power jack, an ICSP header, and a reset button. It
contains everything needed to support the microcontroller; simply connect it to a computer with a
USB cable or power it with a AC-to-DC adapter or battery to get started.
The Uno differs from all preceding boards in that it does not use the FTDI USB-to-serial
driver chip. Instead, it features the Atmega16U2 (Atmega8U2 up to version R2) programmed as a
USB-to-serial converter. Revision 2 of the Uno board has a resistor pulling the 8U2 HWB line to
ground ,making it easier to DFU mode

 pinout: added SDA and SCL pins that are near to the AREF pin and two other new pins
placed near to the RESET pin, the IOREF that allow the shields to adapt to the voltage
provided from the board. In future, shields will be compatible both with the board that use
the AVR, which operate with 5V and with the Arduino Due that operate with 3.3V. The
second one is a not connected pin, that is reserved for future purposes.
 Stronger RESET circuit.
 Atmega 16U2 replace the 8U2.
"Uno" means one in Italian and is named to mark the upcoming release of Arduino 1.0. The Uno
and version 1.0 will be the reference versions of Arduino, moving forward. The Uno is the latest in
a series of USB Arduino boards, and the reference model for the Arduino platform; for a
comparison with previous versions, see the index of Arduino boards.

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 23


SMART IRRIGATION SYSTEM

Summary

Microcontroller ATmega328
Operating Voltage 5V
InputVoltage
7-12V
(recommended)
Input Voltage (limits) 6-20V
Digital I/O Pins 14 (of which 6 provide PWM output)
Analog Input Pins 6
DC Current per I/O Pin 40 mA
DC Current for 3.3V Pin 50 mA
Flash Memory 32 KB (ATmega328) of which 0.5 KB used by bootloader
SRAM 2 KB (ATmega328)
EEPROM 1 KB (ATmega328)
Clock Speed 16 MHz

Note: The Arduino reference design can use an Atmega8, 168, or 328, Current models use
an ATmega328, but an Atmega8 is shown in the schematic for reference. The pin configuration is
identical on all three processors.
Power
The Arduino Uno can be powered via the USB connection or with an external power
supply. The power source is selected automatically.
External (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or
battery. The adapter can be connected by plugging a 2.1mm center-positive plug into the board's
power jack. Leads from a battery can be inserted in the Gnd and Vin pin headers of the POWER
connector.
The board can operate on an external supply of 6 to 20 volts. If supplied with less than 7V,
however, the 5V pin may supply less than five volts and the board may be unstable. If using more
than 12V, the voltage regulator may overheat and damage the board. The recommended range is 7
to 12 volts.

The power pins are as follows:

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 24


SMART IRRIGATION SYSTEM

 VIN: The input voltage to the Arduino board when it's using an external power source (as
opposed to 5 volts from the USB connection or other regulated power source). You can
supply voltage through this pin, or, if supplying voltage via the power jack, access it
through this pin.
 5V:The regulated power supply used to power the microcontroller and other components
on the board. This can come either from VIN via an on-board regulator, or be supplied by
USB or another regulated 5V supply.
 3V3: A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50
mA.
 GND: Ground pins.

Memory
The ATmega328 has 32 KB (with 0.5 KB used for the boot loader). It also has 2 KB of
SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM library).

Input and Output


Each of the 14 digital pins on the Uno can be used as an input or output, using pin
Mode(), digital Write(), and digital Read()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 k Ohms. In addition, some pins have specialized functions:

 Serial: 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 Interrupts: 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 analog Write() 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,

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 25


SMART IRRIGATION SYSTEM

the LED is on, when the pin is LOW, it's off.


The Uno has 6 analog inputs, labeled 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 analog Reference() 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 analog Reference().
 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.
See also the mapping between Arduino pins and ATmega328 ports. The mapping for the Atmega8,
168, and 328 is identical.

Communication
The Arduino Uno has a number of facilities for communicating with a computer, another
Arduino, or other microcontrollers. The ATmega328 provides UART TTL (5V) serial
communication, which is available on digital pins 0 (RX) and 1 (TX). An ATmega16U2 on the
board channels this serial communication over USB and appears as a virtual com port to software
on the computer. The '16U2 firmware uses the standard USB COM drivers, and no external driver
is needed. However, on Windows, a .inf file is required. The RX and TX LEDs on the board will
flash when data is being transmitted via the USB-to-serial chip and USB connection to the
computer (but not for serial communication on pins 0 and 1).
A Software Serial library allows for serial communication on any of the Uno's digital
pins.The ATmega328 also supports I2C (TWI) and SPI communication. The Arduino software
includes a Wire library to simplify use of the I2C bus; see the documentation for details. For SPI
communication, use the SPI library.

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 26


SMART IRRIGATION SYSTEM

Programming
The Arduino Uno can be programmed with the Arduino software (download). Select
"Arduino Uno from the Tools > Board menu (according to the microcontroller on your board).
For details, see the reference and tutorials.
The ATmega328 on the Arduino Uno comes preburned with a boot loader that allows you to
upload new code to it without the use of an external hardware programmer. It communicates using
the original STK500 protocol (reference, C header files).
You can also bypass the bootloader and program the microcontroller through the ICSP (In-Circuit
Serial Programming) header; see these instructions for details.
The ATmega16U2 (or 8U2 in the rev1 and rev2 boards) firmware source code is available .
The ATmega16U2/8U2 is loaded with a DFU boot loader, which can be activated by:

 On Rev1 boards: connecting the solder jumper on the back of the board (near the map of
Italy) and then resetting the 8U2.
 On Rev2 or later boards: there is a resistor that pulling the 8U2/16U2 HWB line to ground,
making it easier to put into DFU mode.
You can then use Atmel's FLIP software (Windows) or the DFU programmer (Mac OS X
and Linux) to load a new firmware. Or you can use the ISP header with an external programmer
(overwriting the DFU boot loader). See this user-contributed tutorial for more information.

Automatic (Software) Reset


Rather than requiring a physical press of the reset button before an upload, the Arduino Uno
is designed in a way that allows it to be reset by software running on a connected computer. One
of the hardware flow control lines (DTR) of theATmega8U2/16U2 is connected to the reset line of
the ATmega328 via a 100 nanofarade capacitor. When this line is asserted (taken low), the reset
line drops long enough to reset the chip. The Arduino software uses this capability to allow you to
upload code by simply pressing the upload button in the Arduino environment. This means that the
boot loader can have a shorter timeout, as the lowering of DTR can be well-coordinated with the
start of the upload.
This setup has other implications. When the Uno is connected to either a computer running
Mac OS X or Linux, it resets each time a connection is made to it from software (via USB). For
Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 27
SMART IRRIGATION SYSTEM

the following half-second or so, the boot loader is running on the Uno. While it is programmed to
ignore malformed data (i.e. anything besides an upload of new code), it will intercept the first few
bytes of data sent to the board after a connection is opened. If a sketch running on the board
receives one-time configuration or other data when it first starts, make sure that the software with
which it communicates waits a second after opening the connection and before sending this data.
The Uno contains a trace that can be cut to disable the auto-reset. The pads on either side of
the trace can be soldered together to re-enable it. It's labeled "RESET-EN". You may also be able
to disable the auto-reset by connecting a 110 ohm resistor from 5V to the reset line; see this forum
thread for details.

USB over current Protection


The Arduino Uno has a resettable polyfuse that protects your computer's USB ports from
shorts and over current. Although most computers provide their own internal protection, the fuse
provides an extra layer of protection. If more than 500 mA is applied to the USB port, the fuse will
automatically break the connection until the short or overload is removed.

4.2 Components used in this project

a) LCD
To display any character on LCD micro controller has to send its ASCII value to the data
bus of LCD. For e.g. to display 'AB' microcontroller has to send two hex bytes 41h and 42h
respectively.LCD display used here is having 16x2 size. It means 2 lines each with 16 characters.

Fig 4.2 LCD circuit


Pins Functions

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 28


SMART IRRIGATION SYSTEM

There are pins along one side of the small printed board used for connection to the
microcontroller. There are total of 14 pins marked with numbers (16 in case the background light
is built in).

Function Pin Name Logic Description


Number State
Ground 1 Vss - 0V
Power supply 2 Vdd - +5V
Contrast 3 Vee - 0 – Vdd
Control of 4 RS 0 D0 – D7 are interpreted as
operating 1 commands
D0 – D7 are interpreted as data
5 R/W 0 Write data (from controller to
1 LCD)
Read data (from LCD to
controller)
6 E 0 Access to LCD disabled
1 Normal operating
From 1 to Data/commands are transferred
0 to LCD
Data / 7 D0 0/1 Bit 0 LSB
commands 8 D1 0/1 Bit 1
9 D2 0/1 Bit 2
10 D3 0/1 Bit 3
11 D4 0/1 Bit 4
12 D5 0/1 Bit 5
13 D6 0/1 Bit 6
14 D7 0/1 Bit 7 MSB

Algorithm to send data to LCD:


1. Make R/W low
2. Make RS=0; if data byte is command

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 29


SMART IRRIGATION SYSTEM

RS= 1; if data byte is data (ASCII value)


3. Place data byte on data register
4. Pulse E (HIGH to LOW)
5. Repeat the steps to send another data byte
LCD Initialization:
This is the pit fall for beginners. Proper working of LCD depend on the how the LCD is
initialized. We have to send few command bytes to initialize the LCD. Simple steps to initialize
the LCD
1.Specify function set: Send 38H for 8-bit, double line and 5x7 dot character format.
2. Display On-Off control: Send 0FH for display and blink cursor on.
3. Entry mode set: Send 06H for cursor in increment position and shift is invisible.
4. Clear display: Send 01H to clear display and return cursor to home position.
Addresses of cursor position for 16x2 HD44780 LCD
line1 80H 81H 82H 83H 84H 85H 86H 87H 88H 89H 8AH 8BH 8CH 8DH 8EH 8FH
line2 C0H C1H C2H C3H C4H C5H C6H C7H C8H C9H CAH CBH CCH CDH CEH CFH

Contrast control (Potentiometer):


To have a clear view of the characters on the LCD, contrast should be adjusted. To adjust
the contrast, the voltage should be varied. For this, a preset is used which can behave like a
variable voltage device. As the voltage of this preset is varied, the contrast of the LCD can be
adjusted.

b) Soil Moisture Sensor

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 30


SMART IRRIGATION SYSTEM

Fig 4.3 soil moisture sensor

The soil moisture sensor is a device to measure volumetric water content in the soil. The
sensor measures volumetric water content indirectly, without removing moisture, by using other
parameters of soil like electrical resistance or conductance, dielectric constant and interaction with
other neutrons. The result may vary depending on environmental factors like soil type,
temperature, and conductivity, so it must be calibrated.
Specification
 Voltage supply: 3.3-5V
 Output mode: dual-mode, Analog (more accurate) and digital
 Comparator IC: LM393
 Indicator type:
o Red: power indicator
o Digital switching output indicator
Pin Description
1. Vcc
2. GND
3. DO: Digital output
4. AO: Analog output
Application
 Agriculture
 Gardening

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 31


SMART IRRIGATION SYSTEM

c) Wi-Fi Module

Fig 4.4 WiFi module

The ESP-01S ESP8266 WiFi Module is a self-contained SOC with integrated TCP/IP
protocol stack that can give any microcontroller access to your WiFi network. The ESP8266 is
capable of either hosting an application or offloading all Wi-Fi networking functions from another
application processor. Each ESP-01S ESP8266 module comes pre-programmed with an AT
command set firmware, meaning, you can simply hook this up to your Arduino device and get
about as much WiFi-ability as a WiFi Shield offers (and that’s just out of the box)! The ESP-01S
ESP8266 module is an extremely cost-effective board with a huge, and ever-growing, community.
This module has a powerful enough on-board processing and storage capability that allows it to be
integrated with the sensors and other application-specific devices through its GPIOs with minimal
development up-front and minimal loading during runtime. Its high degree of on-chip integration
allows for minimal external circuitry, including the front-end module, is designed to occupy
minimal PCB area. The ESP8266 supports APSD for VoIP applications and Bluetooth co-
existence interfaces, it contains a self-calibrated RF allowing it to work under all operating
conditions and requires no external RF parts.

Features:

1. 1MB (8Mbit) Flash size.


2. Very competitive price

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 32


SMART IRRIGATION SYSTEM

3. AP, STA, AP+STA modes available.


4. Very simple AT commands, easy to use.
5. Internal LWIP interface.
6. Four pins interface, VCC-3V3, GND, TXD, and RXD. Two extra GPIOs can use.
7. AT commands firmware. New IC ESP8266ex
d) Motor

fig 4.5 Stepper motor

This easy-to-mount GA25-370 DC Gear motor is great for building robots and it comes in
a variety of configurations that suit even the most exigent designs. The motor comes in a Small
cylinder shape with a diameter of 25 mm and a 4mm diameter shaft and 2 Terminal connectors.
These motors are designed to produce high torque at very low current consumptions. It is a
Great replacement for the rusty or damaged DC geared speed reduce motor on the
machine. Benefiting from high torque and low noise, this motor is solidly constructed and ready to
install in numerous applications
This is 12V DC motor which has a gearbox of 25mm diameter same as the motor base
body. The 25GA-370 Gear Motor’s gearbox has metal gears and a centre shaft. The D-Shape Shaft
of the motor is loaded with Metal bush for wear resistance and smooth operation.
We highly suggest you this motor for the general purpose automation projects requiring
considerable torque range.

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 33


SMART IRRIGATION SYSTEM

Applications :
Robotics (Robocon Events), Electric Controlled Valve, Wending Machine, Automatic
Actuator, Automatic Doors, Coin Refund Devices, Money Detector, Soft Napkin Machine,
Infusion Pumps etc
Features: 

1. It has a sturdy construction.


2. Low Noise
3. Shaft equips metal bushes for long life.
4. Metal Gears for High performance
5. It comes with High-Quality gears.
6. High torque at very low Current Consumptions

i) 180 Degree Rotation Servo Motor


Getting an original TowerPro Servo Motor is not an economical option at all!!! And is also a very
difficult task to recognize and buy an original TowerPro servo, Because there are many suppliers
spread over different online shops who are selling fake servo motors under this Brand name.
Robu.in believes in satisfied customers, so whatever the product is we first import them then test
them for their supplier defined and standard capabilities. Only after doing all the possible quality
checks we make the product available to our customers.

Fig 4.6 Servo motor


We have imported this copy of original TowerPro SG90 9g Mini Servo from our trusted supplier.
This good quality servo motor is in very close competition to the original TowerPro SG90
1.2kgCm 180-degree servo motor.

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 34


SMART IRRIGATION SYSTEM

Main Difference between Good Quality SG90 and Standard Quality Sg90 is

Good Quality Sg90 (SKU:- Standard Quality Sg90 (SKU


Property
43849) :- 5764)

Cable Thick Thin

Gears Nylon PolyPropelene Plastic

Motor High torque Slightly Lower Torque

They are compatible with all the applications that use the genuine TowerPro SG90 9g Mini Servo
because of their same size, comparable quality, and optimized performance.

It equips Carbon Fiber Gears which makes the servo motor much lighter than same metal
gear motor. For small load applications using the metal gear servo motor adds on unnecessary
weight, so we suggest using this lightweight plastic gear servo motors.

The TowerPro SG90 1.2kgCm 180 Degree Rotation Servo Motor rotates 90° in each direction
making it 180° servo motor. It is a Digital Servo Motor which receives and processes PWM signal
faster and better. It equips sophisticated internal circuitry that provides good torque, holding
power, and faster updates in response to external forces.

They are packed within a tight sturdy plastic case which makes them water and dust resistant
which is a very useful feature in RC planes, Boats, and RC Monster Trucks etc. It equips 3-wire
JR servo plug which is compatible with Futaba connectors too.

Wire Description

RED – Positive

Brown –  Negative

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 35


SMART IRRIGATION SYSTEM

Orange – Signal

We are selling the wide range of Servo Motors with variable specs and quality material, Check
them now

Servo Motors and Accessories

Features : 

1. The connection cable is thicker.


2. Equips high-quality motor.
3. High resolution
4. Accurate positioning
5. Fast control response
6. Constant torque throughout the servo travel range
7. Excellent holding power
e) Motor Driver

fig 4.6 Motor Driver (L293D)

The L293D Motor Driver/Servo Shield for Arduino is probably one of the most versatile on the
market and features 2 servo and 4 motor connectors for DC or stepper motors. That makes it a
great shield for any robotic project.

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 36


SMART IRRIGATION SYSTEM

This Arduino compatible motor Driver shield is a full-featured product that it can be used to drive
4 DC motor or two 4-wire steppers and two 5v servos. It drives the DC motor and stepper with the
L293D, and it drives the servo with Arduino pin9 and pin10.

The shield contains two L293D motor drivers and one 74HC595 shift register. The shift register
expands 3 pins of the Arduino to 8 pins to control the direction of the motor drivers. The output
enables the L293D is directly connected to the PWM outputs of the Arduino.

Firmware

1. Arduino Stepper/Servo software library with microstepping support.


To install, click on Download in the top right corner, select zip and uncompress the folder.
Rename the folder to AF-motor (check that the renamed folder contains the .cpp and .h files) and
install it into the Arduino sketches/libraries folder. For information on how to use and install
libraries, see our tutorial! This version now works with the Mega. Public domain!
2. AccelStepper library with AFMotor support. This library allows for advanced stepper
control including acceleration and deceleration, and concurrent stepper control!
To install, click on Download in the top right corner, select zip and uncompress the folder.
Rename the folder to AF-motor (check that the renamed folder contains the .cpp and .h files) and
install it into the Arduino sketches/libraries folder.

Features :

1. 2 connections for 5V ‘hobby’ servos connected to the Arduino’s high-resolution dedicated


timer
2. 4 H-Bridges: L293D chipset provides 0.6A per bridge (1.2A peak) with thermal shutdown
protection, internal kickback protection diodes. Can run motors on 4.5VDC to 25VDC.
3. Up to 4 bi-directional DC motors with individual 8-bit speed selection (so, about 0.5%
resolution)
4. Up to 2 stepper motors (unipolar or bipolar) with single coil, double coil, or interleaved
stepping.
5. Pull-down resistors keep motors disabled during power-up

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 37


SMART IRRIGATION SYSTEM

6. Big terminal block connectors to easily hook up wires (18-26AWG) and power
7. Arduino reset button brought up top
8. 2-pin terminal block and jumper to connect external power, for separate logic/motor
supplies
9. Tested compatible with Arduino Mega 1280 & 2560, Diecimila, Duemilanove, and UNO
10. Download the easy-to-use Arduino software library, check out the examples and you’re
ready to go!

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 38


SMART IRRIGATION SYSTEM

5. SOFTWARE DEVELOPMENT

5.1 Introduction to IDE- Integrated Development Environment


This tutorial will walk you through downloading, installing, and testing the Arduino
software (also known as the Arduino IDE - short for Integrated Development Environment).
Before you jump to the page for your operating system, make sure you’ve got all the right
equipment.

Requirements:
 A computer (Windows, Mac, or Linux).
 An Arduino-compatible microcontroller (anything from this guide should work).
 A USB A-to-B cable, or another appropriate way to connect your Arduino-compatible
microcontroller to your computer (check out this USB buying guide if you’re not sure which cable
to get).

Fig 5.1 An A-to-B USB Cable

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 39


SMART IRRIGATION SYSTEM

5.1.1Arduino:
Arduino is an open-source electronics platform based on easy-to-use hardware and
software. Arduino boards are able to read inputs - light on a sensor, a finger on a button, or a
Twitter message - and turn it into an output - activating a motor, turning on an LED, publishing
something online. You can tell your board what to do by sending a set of instructions to the
microcontroller on the board. To do so you use the Arduino programming language (based
on Wiring), and the Arduino Software (IDE), based on Processing.
Over the years Arduino has been the brain of thousands of projects, from everyday objects
to complex scientific instruments. A worldwide community of makers - students, hobbyists, artists,
programmers, and professionals - has gathered around this open-source platform, their
contributions have added up to an incredible amount of accessible knowledge that can be of great
help to novices and experts alike.
Arduino was born at the Ivrea Interaction Design Institute as an easy tool for fast
prototyping, aimed at students without a background in electronics and programming. As soon as
it reached a wider community, the Arduino board started changing to adapt to new needs and
challenges, differentiating its offer from simple 8-bit boards to products for IOT applications,
wearable, 3D printing, and embedded environments

.
Fig: 5.2 Arduino
All Arduino boards are completely open-source, empowering users to build them
independently and eventually adapt them to their particular needs. The software, too, is open-
source, and it is growing through the contributions of users worldwide.
Thanks to its simple and accessible user experience, Arduino has been used in thousands of
different projects and applications. The Arduino software is easy-to-use for beginners, yet flexible
enough for advanced users. It runs on Mac, Windows, and Linux. Teachers and students use it to

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 40


SMART IRRIGATION SYSTEM

build low cost scientific instruments, to prove chemistry and physics principles, or to get started
with programming and robotics.
Designers and architects build interactive prototypes, musicians and artists use it for
installations and to experiment with new musical instruments. Makers, of course, use it to build
many of the projects exhibited at the Maker Faire, for example. Arduino is a key tool to learn new
things. Anyone - children, hobbyists, artists, programmers - can start tinkering just following the
step by step instructions of a kit, or sharing ideas online with other members of the Arduino
community.
5.2 TROUBLESHOOTING
 This guide from Arduino has some more details and troubleshooting tips if you get
stuck.Mac
 This page will show you how to install and test the Arduino software on a Mac computer
running OSX.
 Go to the Arduino download page and download the latest version of the Arduino software
for Mac.
 When the download is finished, un-zip it and open up the Arduino folder to confirm that
yes, there are indeed some files and sub-folders inside. The file structure is important so
don’t be moving any files around unless you really know what you’re doing.
 Power up your Arduino by connecting your Arduino board to your computer with a USB
cable (or FTDI connector if you’re using an Arduino pro). You should see the LED labed
‘ON’ light up. (This diagram shows the placement of the power LED on the UNO).
 Move the Arduino application into your Applications folder.

5.2.1 FTDI Drivers:


If you have an UNO, Mega2560, or Redboard, you shouldn’t need this step, so skip it!

 For other boards, you will need to install drivers for the FTDI chip on your Arduino.
 Go to the FTDI website and download the latest version of the drivers.
 Once you’re done downloading, double click the package and follow the instructions from
the installer.

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 41


SMART IRRIGATION SYSTEM

 Restart your computer after installing the drivers.

After following the appropriate steps for your software install, we are now ready to test your
first program with your Arduino board!
 Launch the Arduino application
 If you disconnected your board, plug it back in
 Open the Blink example sketch by going to: File > Examples > 1.Basics > Blink

Fig 5.8: FTDI Drivers


 Select the type of Arduino board you’re using: Tools > Board > your board type

 Select the serial port that your Arduino is attached to: Tools > Port > xxxxxx (it’ll probably look
something like “/dev/tty.usbmodemfd131” or “/dev/tty.usbserial-131” but probable with a
different number).

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 42


SMART IRRIGATION SYSTEM

Fig 5.9: Serial Port Attaching

 If you’re not sure which serial device is your Arduino, take a look at the available ports,
then unplug your Arduino and look again. The one that disappeared is your Arduino.

 With your Arduino board connected and the Blink sketch open, press the ‘Upload’ button

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 43


SMART IRRIGATION SYSTEM

Fig 5.10: Uploading to the Board

 After a second, you should see some LEDs flashing on your Arduino, followed by the
message ‘Done Uploading’ in the status bar of the Blink sketch.
 If everything worked, the onboard LED on your Arduino should now be blinking! You just
programmed your first Arduino!

An Arduino is a popular open-source single-board microcontroller. Learn how to program one


and let the possibilities take shape.

Sketch

A sketch is a program written with the Arduino IDE. Sketches are saved on the
development computer as text files with the file extension .ino. Arduino Software (IDE) pre-1.0
saved sketches with the extension .pde.

A minimal Arduino C/C++ program consists of only two functions:

 setup( ): This function is called once when a sketch starts after power-up or reset. It is
used to initialize variables, input and output pin modes, and other libraries needed in the sketch. It
is analogous to the function main( ).

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 44


SMART IRRIGATION SYSTEM

 loop( ): After setup( ) function exits (ends), the loop( ) function is executed repeatedly in
the main program. It controls the board until the board is powered off or is reset. It is analogous to
the function while( ).
5.3 HACK AN ARDUINO:
Steps For Hacking An Arduino:
Step1: Arduino microcontrollers come in a variety of types. The most common is the Arduino
UNO, but there are specialized variations. Before you begin building, do a little research to figure
out which version will be the most appropriate for your project.
Step2: To begin, you'll need to install the Arduino Programmer, aka the integrated development
environment (IDE).
Step3: Connect your Arduino to the USB port of your computer. This may require a specific USB
cable. Every Arduino has a different virtual serial-port address, so you’ll need to reconfigure the
port if you're using different Arduinos.
Step4: Set the board type and the serial port in the Arduino Programmer.
Step5: Test the microcontroller by using one of the preloaded programs, called sketches, in the
Arduino Programmer. Open one of the example sketches, and press the upload button to load it.
The Arduino should begin responding to the program: If you've set it to blink an LED light, for
example, the light should start blinking.
Step6: To upload new code to the Arduino, either you'll need to have access to code you can paste
into the programmer, or you'll have to write it yourself, using the Arduino programming language
to create your own sketch. An Arduino sketch usually has five parts: a header describing the
sketch and its author; a section defining variables; a setup routine that sets the initial conditions of
variables and runs preliminary code; a loop routine, which is where you add the main code that
will execute repeatedly until you stop running the sketch; and a section where you can list other
functions that activate during the setup and loop routines. All sketches must include the setup and
loop routines.
Step7: Once you've uploaded the new sketch to your Arduino, disconnect it from your computer
and integrate it into your project as directed

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 45


SMART IRRIGATION SYSTEM

5.4 Project Software (CODE) Used In This Project

#include
Servo myservo;
int m=0;
int n=0;
int pos = 0;
void setup() {
// put your setup code here, to run once:
pinMode(A0, INPUT_PULLUP);
pinMode(A1, INPUT_PULLUP);
pinMode(8,OUTPUT);
Serial.begin(9600);
myservo.attach(9);
}

void loop() {
// put your main code here, to run repeatedly:

int m= analogRead(A0);
int n= analogRead(A1);
Serial.println(m);
delay(10);
Serial.println(n);
delay(200);
if (m>=980)
{
myservo.write(90); // tell servo to go to position in variable 'pos'
digitalWrite(8, HIGH);

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 46


SMART IRRIGATION SYSTEM

delay(1000);
}

else if(m<=970) { digitalWrite(8, LOW); } if (n>=980)


{

myservo.write(0); // tell servo to go to position in variable 'pos'

digitalWrite(8, HIGH);
delay(1000);
}

else if(n<=970)
{

digitalWrite(8, LOW);
}

else
{
digitalWrite(8, LOW)

6.RESULTS AND DISCUSSION

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 47


SMART IRRIGATION SYSTEM

The values obtained through sensors enable the system to switch the sprinkler on and off.
A farmer can remotely monitor the irrigation process on the farm. Hence, the system contributed
in making a smart farm. Table 2 depicts the readings of the two YL-69 soil moisture sensors taken
over a period of one hour

Table 2 depicts readings from two YL-69 soil moisture sensors one of which was inserted
in over irrigated soil and the other in soil with initial moisture content 79% . The readings were
taken over a period of one hour to observe the rate at which moisture content in soil is reducing
when the sprinklers are off. These readings are transmitted to the website and thingspeak channel.
Figure 5 and 6 display the graphs plotted. It can be observed from the graphs that moisture content
of over irrigated soil takes longer period to reduce by 10% as compared to the moisture content of
soil which is initially 79% moist. Thus, the curve for sensor A is a continuously decreasing curve
as the moisture reduces as time passes. For sensor B the moisture value initially is 100%. The
readings depict that sensor was in an over irrigated soil at the beginning. In our system possibility
of over irrigation is avoided by turning the water sprinklers off as soon as the sensor reading is
100%.

Graph of Sensor B: Inserted in over irrigated soil

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 48


SMART IRRIGATION SYSTEM

Time (IST) Sensor A(%) Sensor B(%)

15:53:21 79 100

16:00:22 74 100

16:11:23 70 100

16:16:44 69 100

16:30:05 67 100

16:34:45 66 100

16:43:06 65 98

16:48:07 65 97

16:56:08 64 95

16:59:48 63 93

17:00:08 63 93

17:05:49 62 92

Table 2 : Sensor Readings

6.1 ADVANTAGES
 Increase in productivity
 reduced water consumption
 Safe
 No manpower required
 Reduce soil erosion and nutrient leaching
 Require smaller water sources

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 49


SMART IRRIGATION SYSTEM

6.2 CONCLUSION
A system to monitor moisture levels in the soil was designed and the project provided an
opportunity to study the existing systems, along with their features and drawbacks. The proposed
system can be used to switch on/off the water sprinkler according to soil moisture levels thereby
automating the process of irrigation which is one of the most time consuming activities in farming.
Agriculture is one of the most water-consuming activities. The system uses information from soil
moisture sensors to irrigate soil which helps to prevent over irrigation or under irrigation of soil

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 50


SMART IRRIGATION SYSTEM

thereby avoiding crop damage. The farm owner can monitor the process online through a website.
Through this project it can be concluded that there can be considerable development in farming
with the use of IOT and automation. Thus, the system is a potential solution to the problems faced
in the existing manual and cumbersome process of irrigation by enabling efficient utilization of
water resources.

6.3 FUTURE SCOPE


To improve the efficiency and effectiveness of the system, the following recommendations
can be put into consideration. Option of controlling the water pump can be given to the farmer i.e.
he can switch on/off the pump in order to start/stop the process of irrigation without being present
at the farm. The farmer may choose to stop the growth of crops or the crops may get damaged due
to adverse weather conditions. The idea of using IOT for irrigation can be extended further to

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 51


SMART IRRIGATION SYSTEM

other activities in farming such as cattle management, fire detection and climate control. This
would minimalize human intervention in farming activities.

6.4 REFERENCES
1. Sankar, P., Norman, S.R,(2009) “Embedded System for Monitoring Atmosphere is Weather
Conditions Using Weather Balloon”, International Conference on Control and Automation.

2. L.L.Pfitscher, (2011) “An automated irrigation system for rise cropping with remote supervision”-
proceeding of international conference on power engineering.

3. Joaquín Gutiérrez, Juan Francisco Villa-Medina, Alejandra NietoGaribay, and Miguel Ángel

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 52


SMART IRRIGATION SYSTEM

Porta- Gándara “Automated Irrigation System.

4. X. Wang, W. Yang, A. Wheaton, N. Cooley, B. Moran, "Efficient registration of optical and IR


images for automatic plant water stress assessment".

5. Bircher, S., Skou, N., Jensen, K.H., Walker, J.P., & Rasmussen, L. (2011). A soil moisture and
temperature network for SMOS validation in Western Denmark.

6. Samy Sadeky, Ayoub Al-Hamadiy, Bernd Michaelisy, Usama Sayedz,“ An Acoustic Method for
Soil Moisture Measurement”,IEEE2004

7. Dr. Narayan G. Hegde, “Water Scarcity and Security in India”, BAIF Development
ReseachFoundation, Pune.

8. Marvin T. Batte, “Changing computer use in agriculture: evidence from Ohio”, Computers and
Electronics in Agriculture, Elsevier science publishers, vol. 47, 1–13, 2005

9. Csótó, Magyar, “Information flow in agriculture – through new channels for improved
effectiveness”,Journal of Agricultural Informatics 1 (2), 25–34, 2010

10. Jin Shen, Song Jingling, Han Qiuyan and Yang Yan, “A Remote Measurement and Control
System for Greenhouse Based on GSM-SMS”, Electronic Measurement andInstruments, 2007.
ICEMI '07. 8th International Conference

11. Indu Gautam and S.R.N Reddy, “Innovative GSM based Remote Controlled Embedded System
for Irrigation”, International Journal of Computer Applications Vol. 47 – No.13, June 2012

12. R.Suresh, S.Gopinath, K.Govindaraju, T.Devika,N.SuthanthiraVanitha, “GSM based


Automated IrrigationControl using Raingun Irrigation System”, InternationalJournal of Advanced
Research in Computer and Communication Engineering Vol. 3, Issue 2, February 2014.

13. Karan Kansara, Vishal Zaveri, Shreyans Shah, Sandip Delwadkar, and Kaushal Jani “Sensor
based Automated IrrigationSystemwithIOT:ATechnical Review”,(IJCSIT) International Journal
of Computer Science and Information Technologies, Vol. 6 (6) , 2015, 5331-5333
14. Sumeet. S. Bedekar, Monoj. A. Mechkul, and Sonali. R. Deshpande “IoT based Automated
Irrigation System”, IJSRD - International Journal for Scientific Research& Development| Vol. 3,
Issue 04, 2015 | ISSN (online): 2321-0613

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 53


SMART IRRIGATION SYSTEM

15. K.S.S. Prasad, Nitesh Kumar, Nitish Kumar Sinha and Palash Kumar Saha “Water-Saving
Irrigation System Based on Automatic Control by Using GSM Technology”, Middle-East
Journal of Scientific Research 12 (12): 1824-1827, 2012ISSN 1990-9233 c IDOSI
Publications, 2012DOI: 10.5829/idosi.mejsr.2012.12.12.1258
16. Remote Sensing and Control of an Irrigation System Using a Distributed Wireless Sensor Network
by Yunseop (James) Kim, Member, IEEE, Robert G. Evans, and William M. Iversen, IEEE
Transaction on Instrumentation and Measurement, VOL.57
17. Thingspeak : https:// thingspeak.com/

18. Alexandros Kaloxylos, Robert Eigenmann, Frederick Teye, Zoi Politopoulou, Sjaak Wolfert,
Claudia Shrank, Markus Dillinger, Ioanna Lampropoulou, Eleni Antoniou, Liisa Pesonen, Huether
Nicole, Floerchinger

Dept. of Electronics and Communication Engineering,Malla Reddy College of Engineering 54

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy