Anda di halaman 1dari 69

COMPUTER SCIENCE AND AUTOMATED IRRIGATION

SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

FINAL YEAR PROJECT REPORT

Automated Irrigation Control System

SUBMITTED BY

JOSE THOMAS.P
DON P DANIEL
AJAYAN JOY

MARCH 2011

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING


Toc H INSTITUTE OF SCIENCE & TECHNOLOGY
Arakkunnam P.O, Ernakulam District, KERALA –682 313

PAGE NO: 1
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

ACKNOWLEDGEMENT
Project is a product of experience and it goes a long way in shaping up a person in his
respective profession and it is not only him who gains that experience but a group of kind
hearts behind his success. If words are considered as a symbol of approval and token of
knowledge, then these words play a heralding role in expressing our deep sense of gratitude.

First and foremost of all, we express our heartfelt gratitude to God Almighty for
showering his blessings upon us in enabling to complete the project on time

We extend our gratitude to the Management of Toc H Institute of Science and


Technology, for providing us great infrastructure necessary for the development of our
project.

We would like to express our sincere thanks to Dr.Job.V.Kuruvilla, Principal, Toc H


Institute of Science and Technology for his kind support for the completion of this venture.

We would like to express our heartfelt thanks to Dr.Varghese Paul, Dean, Computer
Science and Engineering and Information Technology, for his invaluable inspiration and
guidance.

We would also like to express our sincere gratitude to Mrs.Sreela Sreedhar, Head of
Department, Computer Science and Engineering, for her kind support and guidance that
proved to be the real support for the completion.

We also express our sincere and heartfelt thanks to our Project Co-ordinators Mr. Alfred
Thomas and Mr. Prince Renjan, project guide Mrs.Smitha Mohan, and all the faculty
members of Department of Computer Science for the pain they took to enquire about the
project unfailingly and for motivating us.

I would also like to express appreciation and thanks to all our friends and family who
knowingly assisted me with their valuable suggestions and supports. I would also like to thank
those who were directly or indirectly guiding us.

PAGE NO: 2
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

Thank You……..
TABLE OF CONTENTS

1. INTRODUCTION…………………………………………………………………………………….1
2.1 Definition…………………………………………………………………………………………4
2.2 About the Project………………………………………………………………………………..4
2.3 Scope of the Project…………………………………………………………………………….4
2. SYSTEM ANALYSIS………………………………………………………………………........5
3.1 Hardware requirements…………………………………………….………....……………....7
3.2 Software requirements…………………………………………………………………….7
3. SYTEM STUDY…………………………………………….……………………....9
4.1 Study of existing system…………………………………………...….......................................... 10
4.2 Analysis of proposed system………………………………………………………….................... .10
4. TOOLS AND UTILITIES…………………………………………………………………………………….
4.1 JAVA……………………………………………………………………………………………………
4.2 NETBEANS…………………………………………………………………………………………
4.3 MY SQL……………………………………………………………………………………………..
4.4 MICROCONTROLLER 16F877A…………………………………………………………………
5. DESIGN……………………………………………………………….…………………………………19
5.1 Module requirements…………………………………………………………………………….….20
5.2 Data Flow Diagram…………………………………………….................................................21
5.3 Database tables………………………………………………………………………………………
6. SAMPLE CODE…………………………………………………………………………………………..
7. SYSTEM TESTING…………………………………….…........................................................48
8. SCREEN SHOTS………………………………………………………………………………………..53
9. CONCLUSION…………………………………………………………………….…………….……….55
10. BIBLIOGRAPHY……………………………………………………………….………………………..57

PAGE NO: 3
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

PAGE NO: 4
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

Now days, water shortage is becoming one of the biggest problem in the world. Many
different methods are developed for conservation of water. Also water is essential in our day to
day life. Agriculture is one of the fields where water is required in tremendous quantity.
Wastage of water is the major problem in agriculture. Irrigation is an artificial application of
water to the soil. It is usually used to assist the growing of crops in dry areas and during
periods of inadequate rainfall.

The continuous increasing demand of the food requires the rapid improvement in food
production technology. In a country like India, where the economy is mainly based on
agriculture and the climatic conditions are isotropic, still we are not able to make full use of
agricultural resources. The main reason is the lack of rains & scarcity of land reservoir water.

Automatic irrigation systems are convenient, and highly efficient. Traditional methods of
irrigation using a hose or an oscillator wastes water. Neither method targets plant roots with
any significant degree of precision. Automatic irrigation systems can be programmed to
discharge more precise amounts of water in a targeted area, which promotes water
conservation.

PAGE NO: 5
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

INTRODUCTION

PAGE NO: 6
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

2.1 Definition
Our project Automated Irrigation control System as the name implies
aims at automating the irrigation process. It aims at making the irrigation process
simple & Efficient by enabling a user to control and monitor the conditions in the
agricultural field based on data collected using temperature and humidity sensors.
This project is designed for satisfying the needs of different users. It is mainly suited
for those farmers who have large acres of land where manual monitoring is very
difficult.

2.2 Scope of the project

Irrigation process can be automated.


Manual monitoring can be reduced to an extent
Time delay in irrigation can be avoided.
Entire irrigation process can be monitored through a single central system.
Temperature and Humidity details can be collected and appropriate actions can be
triggered

2.3 About the Project


The continuous increasing demand of the food requires the rapid improvement in
food production technology. In a country like India, where the economy is mainly
based on agriculture and the climatic conditions are isotropic, still we are not able to
make full use of agricultural resources. The main reason is the lack of rains &
scarcity of land reservoir water. The continuous extraction of water from earth is

PAGE NO: 7
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

reducing the water level due to which lot of land is coming slowly in the zones of un-
irrigated land. Another very important reason of this is due to unplanned use of
water due to which a significant amount of water goes waste. Water is considered to
be the basic need of human.

In order to overcome this problem automatic watering system use sensors


such as soil moisture sensor are used to control the watering system in a greenhouse. The
system also has the capability to control the water level. The main objective of this project is to
automatically control the watering system using humidity sensor. With the use of low cost
sensors and the simple circuitry makes this project a low cost product. This project is best
suited for places where water is scarce and has to be used in limited quantity.

The heart of the project is the PIC16F877A microcontroller. A 16×2 LCD is connected to
the microcontroller, which displays the humidity level. The humidity sensors used in this project
is SMTHS07. Irrigation system uses valves to turn irrigation ON and OFF. These valves may
be easily automated by using controllers. 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
valves 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. It also helps in time
saving, removal of human error in adjusting available soil moisture levels and to maximize their
net profits

A water conservation system that connects between a standard irrigation system


that is controlled by a clock, and the water control valves of that system in order to limit the
flow of water during timed irrigation cycles. When the timed watering cycles are initiated by the
standard irrigation system, the water conservation device senses the humidity in the soil,

PAGE NO: 8
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

temperature and compares it with preset wet and dry humidity limits and scales back each of
the watering cycles in proportion to the humidity content of the ground to thereby conserve
irrigation water that is applied to a ground area. The device includes a humidity sensor, a
temperature sensor, a voltage sensor, a central processing unit. When the device of the
invention is initialized, the temperature and humidity sensors will take the readings and sent it
to the database so that each time the timed irrigation system cycles. Graphs are then plotted
using the values available in the database.

Irrigation system uses valves to turn irrigation ON and OFF. These valves may be
easily automated by using controllers and solenoids. 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 valves 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 Drip 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. It
also helps in time saving, removal of human error in adjusting available soil moisture levels
and to maximize their net profits.

This software can be accessed by only few authorized clients which include
owner of agricultural land, field manager. This software is managed by a single
administrator that is by the owner. He can administer the whole irrigation process by
login this software. Owner can allocate staff, check status of field by analyzing
temperature and humidity data collected by sensors. Each time an employee access
this software the detailed graphs of temperature and humidity plotted against time
will be displayed. The time at which an employee access the site is recorded and
displayed. He can schedule irrigation at appropriate times by evaluating the data.

PAGE NO: 9
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

SYSTEM ANALYSIS

PAGE NO: 10
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

2. SYSTEM ANALYSIS

The system environments with regard to an application project are the


environments which shaped the flesh and bones of the system from concepts and ideas to a
real working model. It is so crucial in selecting the various environments for the system
development since they plays a vital role in determining the properties and behavior of the new
system.
Basically, the system environment is divided into two.
 Software requirements
 Hardware requirements

2.1 Hardware Requirements

Hardware configuration is that the physical components used for developing


the project. The best hardware environment provides the developer with the best utilization of
the available resources.

 Intel Pentium IV Processor or higher


 1GB RAM
 40 GB Hard disk

PAGE NO: 11
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

 1024*768 Resolution Color Monitor


 PICkit 2 Development Programmer/Debugger 
 Standard keyboard and mouse

The importance of system hardware configuration comes into scene when the project
development is in its peak utilization of the system’s physical resources. It can be
observed that for developing a software project, one needs a better and higher
configuration of the hardware that which is needed for its actual run. The extravaganza
is the overhead caused by the developing environment.

2.2 Software Requirements

Operating System used:


 Windows XP or higher.

Software Packages used:


 JDK Version 1.6
 Netbeans IDE Version6.9
 MPLab IDE 8.63

Technologies used:
 JFC
 IO Streams
 Sockets
 Threads

PAGE NO: 12
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

SYSTEM STUDY

PAGE NO: 13
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

3. SYSTEM ANALYSIS

System analysis is the process of gathering and interpreting facts, diagnosing problems, and
using the information to recommend improvements to the system. This is the job of the system analyst.
System analysts do more than solve current problems. They are frequently called upon to help handle
the planned expansion of a business. Analysts assess as carefully as possible what the future needs of
the business will be and what changes should be considered to meet these needs.

The various tasks in the system analysis include the following.

 Understanding application.

 Planning.

 Scheduling.

 Developing candidate solution.

 Performing trade studies.

 Performing cost benefit analysis.

 Recommending alternative solutions.

 Selling of the system.

 Supervising, installing and maintaining the system

PAGE NO: 14
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

3.1 STUDY OF EXISTING SYSTEM


Climates change triggers variability in terms of rainfall and temperature. India, the second
biggest populated country might face high intensity threat to livelihoods of poor and vulnerable
combined with fresh water scarcity. Existing system demands daily visit to field by farmer to evaluate
the crops.this may be difficult for farmers who own acres of agricultural land. It is not possible for
farmer to monitor the entire land at the same time.

Advantage of existing system


 Direct supervision is possible

Limitations of Existing System:


Accuracy is not reached
It is prone to errors
It is time consuming
No security is provide
Highly confusing
Employees are overloaded with work.
Inefficient, poorly managed, and Lacks Flexibility.
.

3.2 ANALYSIS OF PROPOSED SYSTEM


In order to overcome the limitations in traditional irrigation system automated irrigation system is
used. Owner of the farm land is the administrator, he can monitor the condition of land using this
software.He can add new employees and can monitor their work.temperature and humidity sensors are
placed on the field.they collect data and is forwaded to server and is stored in database.employee on
accessing the software can analyse this data.the data stored in database is then plotted in the form of a
graph.graphs plotted includes temperature plotted against time,humidity plotted against time and
temperature plotted against humidity.time at which a particular employee login to the software is noted
and entered into the database.

PAGE NO: 15
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

Advantages of the Proposed System:


 Accuracy is attained
 It is fast and consumes less time
 Reduce manual intervention
 Security is provided
 Less complexity
 Confidentiality and anonymity issues.

This project is mainly intended for those who own large acres of land as they need not go to
farm land everyday. they can collect data through sensors installed in the field and can analyse
it. All information about the farm land is stored in a central server ,which can be accessed by the
administrator.

PAGE NO: 16
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

PROJECT IMPLEMENTATION

PAGE NO: 17
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

5.1 TOOLS & UTILITIES

5.1.1 JAVA

Java was developed at Sun Microsystems. Work on Java initially began with the
goal of creating a platform-independent language and OS for consumer electronics. The
original intent was to use C++, but as work progressed in this direction, developers identified
that creating their own language would serve them better. The effort towards consumer
electronics led the Java team, then known as First Person Inc., towards developing h/w and
s/w for the delivery of video-on-demand with Time Warner.

Unfortunately (or fortunately for us) Time Warner selected Silicon Graphics as
the vendor for video-on-demand project. This set back left the First Person team with an
interesting piece of software (Java) and no market to place it. Eventually, the natural synergies
of the Java language and the www were noticed, and Java found a market.

Today Java is both a programming language and an environment for executing


programs written in Java Language. Unlike traditional compilers, which convert source code

PAGE NO: 18
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

into machine level instructions, the Java compiler translates java source code into instructions
that are interpreted by the runtime Java Virtual Machine. So unlike languages like C and C++,
on which Java is based, Java is an interpreted language.

Java is the first programming language designed from ground up with network
programming in mind. The core API for Java includes classes and interfaces that provide
uniform access to a diverse set of network protocols. As the Internet and network
programming have evolved, Java has maintained its cadence. New APIs and toolkits have
expanded the available options for the Java network programmer.

Advantages Of JAVA

In one of their early papers about the language, Sun described Java
as follows: Java: A simple, object-oriented, distributed, interpreted, robust, secure, architecture
neutral, portable, high-performance, multithreaded, and dynamic language.
Sun acknowledges that this is quite a string of buzzwords, but the
fact is that, for the most part, they aptly describe the language. In order to understand why
Java is so interesting, let's take a look at the language features behind the buzzwords.

(a) Object-Oriented

Java is an object-oriented programming language. As a programmer,


this means that you focus on the data in your application and methods that manipulate that
data, rather than thinking strictly in terms of procedures. If you're accustomed to procedure-
based programming in C, you may find that you need to change how you design your

PAGE NO: 19
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

programs when you use Java. In an object-oriented system, a class is a collection of data and
methods that operate on that data. Taken together, the data and methods describe the state
and behavior of an object. Classes are arranged in a hierarchy, so that a subclass can inherit
behavior from its super class. Java comes with an extensive set of classes, arranged in
packages, which you can use in your programs. Strings are represented by objects in Java, as
are other important language constructs like threads. A class is the basic unit of compilation
and of execution in Java; all Java programs are classes. For a complete description of the
object-oriented features of Java, The object oriented language used to create executable
contents such as applications and applets.

(b) Interpreted

Java is an interpreted language: the Java compiler generates byte-codes


for the Java Virtual Machine (JVM), rather than native machine code. To actually run a Java
program, you use the Java interpreter to execute the compiled byte-codes. Because Java
byte-codes are platform-independent, Java programs can run on any platform that the JVM
(the interpreter and run-time system) has been ported to. In an interpreted environment, the
standard "link" phase of program development pretty much vanishes. If Java has a link phase
at all, it is only the process of loading new classes into the environment, which is an
incremental, lightweight process that occurs at run-time. This is in contrast with the slower and
more cumbersome compile-link-run cycle of languages like C and C++.

(c) Architecture Neutral and Portable

Because Java programs are compiled to an architecture neutral byte-code


format, a Java application can run on any system, as long as that system implements the Java

PAGE NO: 20
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

Virtual Machine. This is a particularly important for applications distributed over the Internet or
other heterogeneous networks. But the architecture neutral approach is useful beyond the
scope of network-based applications. If you write your application in Java, however, it can run
on all platforms. The fact that Java is interpreted and defines a standard, architecture neutral,
byte-code format is one big part of being portable. Programmers need only to make simple
efforts to avoid non-portable pitfalls in order to live up to Sun's trademarked motto "Write
Once, Run Anywhere."

(d) Dynamic and Distributed

Java is a dynamic language. Any Java class can be loaded into a


running Java interpreter at any time. These dynamically loaded classes can then be
dynamically instantiated. Native code libraries can also be dynamically loaded. Classes in
Java are represented by the Class class , you can dynamically obtain information about a
class at run-time. This is especially true in Java 1.1, with the addition of the Reflection API.
Java is also called a distributed language. This means, simply, that it provides a lot of high-
level support for networking. Together, these features make it possible for a Java interpreter to
download and run code from across the Internet. This is what happens when a Web browser
downloads and runs a Java applet.

(e) Simple

Java is a simple language. The Java designers were trying to create a


language that a programmer could learn quickly. If you are a C or C++ programmer, you'll find

PAGE NO: 21
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

that Java uses many of the same language constructs as C and C++. In order to keep the
language both small and familiar, the Java designers removed a number of features available
in C and C++. For example, Java provides labeled break and continue statements and
exception handling. Java does not use header files and it eliminates the C preprocessor.
Because Java is object-oriented, Java also eliminates the operator overloading and multiple
inheritance features of C++. Perhaps the most important simplification, however, is that Java
does not use pointers.

(f) Robust
Java has been designed for writing highly reliable or robust software. Java
certainly does not eliminate the need for software quality assurance; it is still quite possible to
write buggy software in Java. One of the things that make Java simple is its lack of pointers
and pointer arithmetic. This feature also increases the robustness of Java programs by
abolishing an entire class of pointer-related bugs. Similarly, all accesses to arrays and strings
are checked at run-time to ensure that they are in bounds, eliminating the possibility of
overwriting memory and corrupting data. Casts of objects from one type to another are also
checked at run-time to ensure that they are legal. Finally, and very importantly, Java's
automatic garbage collection prevents memory leaks and other pernicious bugs related to
memory allocation and deallocation. Exception handling is another feature in Java that makes
for more robust programs.

(g)Secure

PAGE NO: 22
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

One of the most highly touted aspects of Java is that it is a secure


language. Without an assurance of security, you certainly would not want to download code
from a random site on the Internet and let it run on your computer. Java was designed with
security in mind, and provides several layers of security controls that protect against malicious
code, and allow users to comfortably run untrusted programs such as applets. At the lowest
level, security goes hand-in-hand with robustness. By attaching a digital signature to Java
code, the origin of that code can be established in a cryptographically secure and unforgivable
way. Some security holes were found in early versions of Java, but these flaws were fixed
almost as soon as they were found, and it seems reasonable to expect that any future holes
will be fixed just as quickly.

(h)High-Performance

Java is an interpreted language, so it is never going to be as fast as a


compiled language like C. Java 1.0 was said to be about 20 times slower than C. Java 1.1 is
nearly twice as fast as Java 1.0, however, so it might be reasonable to say that compiled C
code runs ten times as fast as interpreted Java byte-codes. Furthermore, the speed-critical
sections of the Java run-time environment, that do things like string concatenation and
comparison, are implemented with efficient native code. The Java byte-code format was
designed with these "just in time" compilers in mind, so the process of generating machine
code is efficient and it produces reasonably good code. The performance of Java's interpreted
byte-codes is much better than the high-level scripting languages (even Perl), but it still offers
the simplicity and portability of those languages.

PAGE NO: 23
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

(i) Multi threaded


In a GUI-based network application such as a Web browser, it's easy to
imagine multiple things going on at the same time. A user could be listening to an audio clip
while she is scrolling a page, and in the background the browser is downloading an image.
Java is a multi-threaded language; it provides support for multiple threads of execution
(sometimes called lightweight processes) that can handle different tasks. An important benefit
of multi threading is that it improves the interactive performance of graphical applications for
the user. you must instead create a thread that blocks on every I/O channel you are interested
in.
(j) Java is garbage collected
Java programs do not have to worry about memory management. The Java
system has a built in program called the garbage collector, which scans the memory and
automatically frees the memory chunks that are not in use.
(k) Java Runtime Environment

The runtime environment used to execute the code. It is made up of the


java language and Java virtual machine. It is portable and it is platform neutral.

(l) Java tools

It is used by the developers to create java code. They include java


compiler, Java interpreter, classes, libraries and applet viewer.

(m) Java Application

PAGE NO: 24
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

Applications are programs written in java to carry out certain tasks on


standalone local computer. Execution of a standalone program involves two steps.

 Compiling the source code into byte code using javac.

 Executing byte code program using java interpreter.

(n) Java Applets

Java applets are pieces of java code that are embedded in HTML
document using the applet tag. When the browser encounters such code it automatically
download it and execute it.

(o) Java Virtual Machine

It is a specification to which Java codes must be written. All Java code


is to be compiled to be used in this nonexistent virtual machine. Writing the code, which
compiles in JVM ensures platform independence.

5.1.2. NETBEANS

The NetBeans IDE is a free, open-source Integrated Development


Environment for software developers. The IDE runs on many platforms including Windows,
Linux, Solaris, and the MacOS. It is easy to install and use straight out of the box. The
NetBeans IDE provides developers with all the tools they need to create professional cross-
platform desktop, enterprise, web and mobile applications.

Using an Integrated Development Environment (IDE) for developing


applications saves you time by managing windows, settings, and data. In addition, an IDE can
store repetitive tasks through macros and abbreviations. Drag-and-drop features make

PAGE NO: 25
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

creating graphical user interface (GUI) components or accessing databases easy, and
highlighted code and debugging features alert you to errors in your code.

The NetBeans IDE is open source and is written in the Java programming
language. It provides the services common to creating desktop applications such as window
and menu management, settings storage and is also the first IDE to fully support JDK 5.0
features. The NetBeans platform and IDE are free for commercial and noncommercial use,
and they are supported by Sun Microsystems.

5.1.3 MY SQL

MySQL is a relational database management system (RDBMS) which has more


than 11 million installations. The program runs as a server providing multi-user access to a
number of databases. MySQL is owned and sponsored by a single for-profit firm, the Swedish
company MySQL AB, now a subsidiary of Sun Microsystems, which holds the copyright to
most of the codebase. The project's source code is available under terms of the GNU General
Public License, as well as under a variety of proprietary agreements. "MySQL" is officially
pronounced (MySQL), not "My sequel". This adheres to the official ANSI pronunciation;
SEQUEL was an earlier IBM database language, a predecessor to the SQL language. The
company does not take issue with the pronunciation "My sequel" or other local variations.
There are 3 types of MySQL Server Compilations for Enterprise and Community users:

Standard: The MySQL-Standard binaries are recommended for most users, and
include the InnoDB storage engine. Max: (not MaxDB, which is cooperation with SAP AG) is
mysqld-max Extended MySQL Server. The MySQL-Max binaries include additional features
that may not have been as extensively tested or are not required for general usage.

PAGE NO: 26
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

The MySQL-Debug binaries have been compiled with extra debug information,
and are not intended for production use, because the included debugging code may cause
reduced performance.

Beginning with MySQL 5.5, MySQL AB has stopped providing these different
package variants. There will only be one MySQL server package, which includes a
MySQL binary with all functionality and storage engines enabled. Instead of providing a
separate debug package, a server binary with extended debugging information is also included
in the standard package.

5.2 The PIC16F877A microcontroller

PIC is a family of Harvard architecture microcontrollers made by Microchip Technology,


derived from the PIC1640 originally developed by General Instrument's Microelectronics
Division. The name PIC initially referred to "Peripheral Interface Controller".

PICs are popular with both industrial developers and hobbyists alike due to their low cost, wide
availability, large user base, extensive collection of application notes, availability of low cost or
free development tools, and serial programming (and re-programming with flash memory)
capability.

PIC16F877A is a small piece of semiconductor integrated circuits. The package type of this
integrated circuits is DIP package. DIP stand for Dual Inline Package for semiconductor IC.
This package is very easy to be soldered onto the stripboard. However using a DIP socket is
much easier so that this chip can be plugged and removed from the development board.

The PIC16F877A is very cheap. The 16F877A is one of the most popular PIC microcontrollers
and it's easy to see why - it comes in a 40 pin DIP pinout and it has many internal peripherals.

PAGE NO: 27
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

The 40 pins make it easier to use the peripherals as the functions are spread out over the pins.
This makes it easier to decide what external devices to attach without worrying too much if
there are enough pins to do the job.  Apart from that it is also very easy to be assembled.
Additional components need to make this IC work is just a 5V power supply adapter, a 20MHz
crystal oscillator and 2 units of 22pF capacitors.

Advantages of PIC16F877A
 One of the main advantages is that each pin is only shared between two or three
functions so its easier to decide what the pin function (other devices have up to 5
functions for a pin).

 This IC can be reprogrammed and erased up to 10,000 times. Therefore it is very good
for new product development phase.

 Programs can also be written in assembly.

 Code isn’t interpreted so it runs blazingly fast.

PIC16F877A pinout

The pinout of the PIC16F877A is:

PAGE NO: 28
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

PIC16F877A

PAGE NO: 29
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

5.3 HD44780U DOT MATRIX LCD:-

PAGE NO: 30
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

LCDs are the materials, which combine both the properties of both liquids and crystals.
Rather than having melting points, they have a temp range within which the molecules are
almost as mobile as they would be in liquid, but are grouped together in an ordered form
similar to a crystal .LCD would not generate light but scatter light. It consumes less power.

Recent LCDs are field effect LCDs. They are based on optical action of polarized light
on properly oriented liquid crystal. LCD consists of 2 glass panels within the liquid crystal
material sand witched between them. The inner surface of glass plates are coated with
transparent electrodes which defines the character, symbols or patterns to be displayed. The
polymeric layers are present in between the electrodes and the liquid crystal which makes the
liquid crystal molecules to maintain a defined orientation angle. The polarizer would rotate the
light rays passing through them to a defined angle, in a particular direction.

When the LCD is in OFF state, the 2 polarizer’s and the liquid crystals rotates the light
rays, such that the light rays come out the LCD without any orientation and hence the LCD
appear to be transparent. When sufficient light is applied to the electrodes, the liquid crystal
molecules would be aligned in specific direction. The light rays passing through the LCD would
be rotated by the polarizer which would result in activating/highlighting the desired character
.The LCDs are light weight with a few millimeter thickness. They are compatible with low
power electronic circuits. The LCD display used here is HD44780U dot matrix display.

The LCD It is 5*7 matrix display. It is a 16*2 display. The data we are sending are put
into Data Display RAM. At power on the Data Display RAM is empty. After that the data is
displayed. The maximum size of DDRAM is 80 bytes. There are two rows each of 40 bytes.
But at a particular time 16 at top and 16 at bottom can be displayed. There is a pointer
(address counter) .The address counter is initially zero. The data to be displayed are put into
location pointed by the address counter. It is automatically incremented. There is a register
select, which decides whether it is a data or command.

PAGE NO: 31
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

If RS=1, then it is a data. If RS=0, then it is a command. Then the controller processes it.
After each command or data send to LCD it takes some time for execution. During this time
the LCD won’t take any data. There is a busy signal given by the LCD. Busy signal is MSB of
the data bus. So the user has to call the data bus to see that busy is low before sending next
data. For reliable Performance LCD has to be initialized. At power on microcontroller sends
some commands to LCD for proper initialization.

The commands for LCD initialization are

 38- Two row 8-bit interface.


 01-clear display. It clears DDRAM
 0C-turns off display cursor
 06- Increment the cursor position automatically
LCD accepts any command or data only if it is enabled. The EN signal has to be made
high and then send data or command and then disable it.

Fig: 4.d LCD Display

PAGE NO: 32
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

5.6 MAX232

The MAX232 is an integrated circuit that converts signals from an RS-232 serial port to signals


suitable for use in TTL compatible digital logic circuits. The MAX232 is a dual driver/receiver
and typically converts the RX, TX, CTS and RTS signals.

The drivers provide RS-232 voltage level outputs (approx. ± 7.5 V) from a single + 5 V supply
via on-chip charge pumps and external capacitors. This makes it useful for implementing RS-
232 in devices that otherwise do not need any voltages outside the 0 V to + 5 V range,
as power supply design does not need to be made more complicated just for driving the RS-
232 in this case.

The receivers reduce RS-232 inputs (which may be as high as ± 25 V), to standard
5 V TTL levels. These receivers have a typical threshold of 1.3 V, and a typical hysteresis of
0.5 V.

The newer MAX3232 is also backwards compatible, but operates at a broader voltage range,
from 3 to 5.5 V.

PAGE NO: 33
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

PROJECT DESIGN
PAGE NO: 34
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

6.1 MODULE REQUIREMENTS


The project can be mainly divided into software and hardware part.
Software part consists of modules:

1. Login Module

2. DataBase Handler

3. Graph Generator

4. Data Analyzer

Hardware part consists of modules:

1. Sensor Module

PAGE NO: 35
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

2. Communication Module

Login Module

The software is designed in such a way that, it can be used only by authenticated
users. The admin can add/remove users and have full access control. Other users can
customize, view graphs, reports, and customize settings such as time interval,
modifying area ID no, password changing etc.

DataBase Handler

The sensor readings are recorded very frequently at specific time intervals (few
seconds) and stored in the database. The average readings for each minute, hour, day and
month is stored separately for each area.

Graph Generator

The current temp & humidity are plotted against time. Different graphs are
generated for current hour, day and month.

Data Analyzer

All data stored at the database are analyzed and processed which involves
scientific mathematical calculations. Specific settings such as time interval, watering
mode (auto/manual),etc are considered.

PAGE NO: 36
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

The different conditions for a hot, wet or chance of rain are being studied at
varied temperature and humidity conditions.

Dewpoint is calculated based on certain mathematical calculations. Also


irrigation after morning and before evening is avoided, which is inefficient/harmful for
crops
.
If the above conditions are satisfied, the system decides whether or not to switch
on the relay(which switch ONs the water pump).

Sensor Module

This module deals with measuring climatic conditions such as temperature and humidity.
The sensor driving circuit is now being designed using sensor’s datasheet.

Communication Module

Handles communication via serial port, Responds to requests from the computer with the
sensor data.
We are now testing serial port interfacing techniques for accurate and timely transmission of
data at varied time intervals.

6.2 DATAFLOW DIAGRAM


Dataflow diagram is used to define the flow of the system and their resources .It is the way of
expressing system requirements in a graphical manner. It is one of the most ingenious tools
used for structured analysis. It is the starting point of design

PAGE NO: 37
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

PAGE NO: 38
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

6.3 DATABASE TABLES:

LOGIN
Field Data type Constraint Description
name
username varchar Primary key username

password varchar Password

Fullname varchar fullname

address varchar address

gender varchar gender

email varchar Email id

Mobile Big int Mobile no

PAGE NO: 39
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

no

Table: 4.d Employee login details

DAILY

Field name Data type Constraint Description


time Small int Primary key time
temperatur varchar temperature
e
humidity humidity
Table: 4.d Daily sensor readings

HOURLY

Field name Data type Constraint Description


time Small int Primary key time
temperatur varchar temperature
e
humidity humidity

Table: 4.d Hourly sensor readings

MINUTELY

Field name Data type Constraint Description


time Small int Primary key time
temperatur varchar temperature
e
humidity humidity

Table: 4.d Minutely sensor readings

PAGE NO: 40
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

SECONDLY

Field name Data type Constraint Description


time Small int Primary key time
temperatur varchar temperature
e
humidity humidity

Table: 4.d Secondly sensor readings

PAGE NO: 41
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

5.1 The PIC16F877A microcontroller

PIC is a family of Harvard architecture microcontrollers made by Microchip Technology,


derived from the PIC1640 originally developed by General Instrument's Microelectronics
Division. The name PIC initially referred to "Peripheral Interface Controller".

PICs are popular with both industrial developers and hobbyists alike due to their low cost, wide
availability, large user base, extensive collection of application notes, availability of low cost or
free development tools, and serial programming (and re-programming with flash memory)
capability.

PAGE NO: 42
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

PIC16F877A is a small piece of semiconductor integrated circuits. The package type of this
integrated circuits is DIP package. DIP stand for Dual Inline Package for semiconductor IC.
This package is very easy to be soldered onto the stripboard. However using a DIP socket is
much easier so that this chip can be plugged and removed from the development board.

The PIC16F877A is very cheap. The 16F877A is one of the most popular PIC microcontrollers
and it's easy to see why - it comes in a 40 pin DIP pinout and it has many internal peripherals.
The 40 pins make it easier to use the peripherals as the functions are spread out over the pins.
This makes it easier to decide what external devices to attach without worrying too much if
there are enough pins to do the job.  Apart from that it is also very easy to be assembled.
Additional components need to make this IC work is just a 5V power supply adapter, a 20MHz
crystal oscillator and 2 units of 22pF capacitors.

Advantages of PIC16F877A
 One of the main advantages is that each pin is only shared between two or three
functions so its easier to decide what the pin function (other devices have up to 5
functions for a pin).

 This IC can be reprogrammed and erased up to 10,000 times. Therefore it is very good
for new product development phase.

 Programs can also be written in assembly.

 Code isn’t interpreted so it runs blazingly fast.

PIC16F877A pinout

PAGE NO: 43
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

The pinout of the PIC16F877A is:

PIC16F877A

PAGE NO: 44
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

5.5 HD44780U DOT MATRIX LCD:-

PAGE NO: 45
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

LCDs are the materials, which combine both the properties of both liquids and crystals.
Rather than having melting points, they have a temp range within which the molecules are
almost as mobile as they would be in liquid, but are grouped together in an ordered form
similar to a crystal .LCD would not generate light but scatter light. It consumes less power.

Recent LCDs are field effect LCDs. They are based on optical action of polarized light
on properly oriented liquid crystal. LCD consists of 2 glass panels within the liquid crystal
material sand witched between them. The inner surface of glass plates are coated with
transparent electrodes which defines the character, symbols or patterns to be displayed. The
polymeric layers are present in between the electrodes and the liquid crystal which makes the
liquid crystal molecules to maintain a defined orientation angle. The polarizer would rotate the
light rays passing through them to a defined angle, in a particular direction.

When the LCD is in OFF state, the 2 polarizer’s and the liquid crystals rotates the light
rays, such that the light rays come out the LCD without any orientation and hence the LCD
appear to be transparent. When sufficient light is applied to the electrodes, the liquid crystal
molecules would be aligned in specific direction. The light rays passing through the LCD would
be rotated by the polarizer which would result in activating/highlighting the desired character
.The LCDs are light weight with a few millimeter thickness. They are compatible with low
power electronic circuits. The LCD display used here is HD44780U dot matrix display.

The LCD It is 5*7 matrix display. It is a 16*2 display. The data we are sending are put
into Data Display RAM. At power on the Data Display RAM is empty. After that the data is
displayed. The maximum size of DDRAM is 80 bytes. There are two rows each of 40 bytes.
But at a particular time 16 at top and 16 at bottom can be displayed. There is a pointer
(address counter) .The address counter is initially zero. The data to be displayed are put into
location pointed by the address counter. It is automatically incremented. There is a register
select, which decides whether it is a data or command.

PAGE NO: 46
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

If RS=1, then it is a data. If RS=0, then it is a command. Then the controller processes it.
After each command or data send to LCD it takes some time for execution. During this time
the LCD won’t take any data. There is a busy signal given by the LCD. Busy signal is MSB of
the data bus. So the user has to call the data bus to see that busy is low before sending next
data. For reliable Performance LCD has to be initialized. At power on microcontroller sends
some commands to LCD for proper initialization.

The commands for LCD initialization are

 38- Two row 8-bit interface.


 01-clear display. It clears DDRAM
 0C-turns off display cursor
 06- Increment the cursor position automatically
LCD accepts any command or data only if it is enabled. The EN signal has to be made
high and then send data or command and then disable it.

Fig: 4.d LCD Display

PAGE NO: 47
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

5.6 MAX232

The MAX232 is an integrated circuit that converts signals from an RS-232 serial port to signals


suitable for use in TTL compatible digital logic circuits. The MAX232 is a dual driver/receiver
and typically converts the RX, TX, CTS and RTS signals.

The drivers provide RS-232 voltage level outputs (approx. ± 7.5 V) from a single + 5 V supply
via on-chip charge pumps and external capacitors. This makes it useful for implementing RS-
232 in devices that otherwise do not need any voltages outside the 0 V to + 5 V range,
as power supply design does not need to be made more complicated just for driving the RS-
232 in this case.

The receivers reduce RS-232 inputs (which may be as high as ± 25 V), to standard
5 V TTL levels. These receivers have a typical threshold of 1.3 V, and a typical hysteresis of
0.5 V.

The later MAX232A is backwards compatible with the original MAX232 but may operate at
higher baud rates and can use smaller external capacitors – 0.1 μF in place of the 1.0 μF
capacitors used with the original device.

The newer MAX3232 is also backwards compatible, but operates at a broader voltage range,
from 3 to 5.5 V

PAGE NO: 48
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

SOURCE CODE

PAGE NO: 49
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

ASM CODE:

***** Program Header ************************************************

list P=PIC16F877a, F=INHX8M, ST=OFF, R=HEX, N=42, MM=OFF, B=6


#include "p16f877a.inc"
__config ( _CP_OFF & _PWRTE_ON & _HS_OSC & _WDT_OFF & _BODEN_ON & _LVP_OFF )
errorlevel -302

;----------------- rs232 interrupt -----------------------------------

movlw '$'
xorwf rectemp,w
btfss STATUS,Z
goto bkk2
bsf rcflag,2
movlw 0xa0
movwf FSR
goto back11
bkk2
movlw 'T'
xorwf rectemp,w
btfss STATUS,Z
goto itest
bsf rcflag,0

PAGE NO: 50
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

goto back11
itest
movlw 'H'
xorwf rectemp,w
btfss STATUS,Z
goto btest
bsf rcflag,1
goto back11

btest
movlw 'B'
xorwf rectemp,w
btfss STATUS,Z
goto ntest
bsf rcflag,5
goto back11
ntest
movlw 'N'
xorwf rectemp,w
btfss STATUS,Z
goto onetest
bsf rcflag,6
goto back11

onetest
movlw '1'
xorwf rectemp,w
btfss STATUS,Z
goto twotest
bsf rcflag,3
goto back11
twotest
movlw '0'
xorwf rectemp,w
btfss STATUS,Z
goto back11
bsf rcflag,4
goto back11

coon
; movwf INDTEMP
;movwf INDF
xorlw '$'
btfss STATUS,Z
goto coon1
bcf rcflag,2
goto initfsr

PAGE NO: 51
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

coon1
movf rectemp,w
;movf INDTEMP,w
movwf INDF
incf FSR,f
movlw 0x1f
xorwf FSR ,w
btfss STATUS,Z
goto back11
initfsr
bsf rcflag,7
movlw 0xa0
movwf FSR

Control Desk:
import java.text.SimpleDateFormat;
import java.text.DateFormat;
import java.util.Date;
import java.util.regex.*;
import java.sql.*;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.data.xy.XYSeries;
import org.jfree.data.xy.XYSeriesCollection;
import org.jfree.ui.ApplicationFrame;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;

PAGE NO: 52
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

import javax.swing.JCheckBox;
/**
*
* @author Don P Daniel
*/
public class ControlDesk extends javax.swing.JFrame {
public ControlDesk(String sUser)
{
initComponents();
DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
Date date = new Date();
dd=dateFormat.format(date);
statusMessageLabel.setText("Logged in as "+ sUser+" "+dd);
currUser=sUser;

}
public class XYSeriesDemo extends ApplicationFrame {
public XYSeriesDemo(final String title,String tblname,int i,String X,String Y) {

super(title);
final XYSeries series = new XYSeries("Sensor Readings");
try
{
Class.forName("com.mysql.jdbc.Driver");
String connURL = "jdbc:mysql://localhost:3306/aics";
Connection con = DriverManager.getConnection(connURL,"root","0");
Statement stmt1=con.createStatement();
ResultSet rs=stmt1.executeQuery("select * from aics."+tblname);

PAGE NO: 53
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

while (rs.next())
{
Float fx=rs.getFloat(X);
Float fy=rs.getFloat(Y);
series.add(fx,fy);
}
}
catch(Exception e)
{ }
String graphTitle=Y+"-"+X+" Graph";
final XYSeriesCollection data = new XYSeriesCollection(series);
final JFreeChart chart = ChartFactory.createXYLineChart(
graphTitle,
X,
Y,
data,
PlotOrientation.VERTICAL,
true,
true,
false
);

final ChartPanel chartPanel = new ChartPanel(chart);


chartPanel.setPreferredSize(new java.awt.Dimension(500, 200));
setContentPane(chartPanel);
switch(i)
{
case 8:jPanel8.add(chartPanel);break;

PAGE NO: 54
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

case 9:jPanel9.add(chartPanel);break;
}

}
}

boolean Emailvalid(String email)


{
//Pattern p = Pattern.compile(".+@.+\\.[a-z]+");
Pattern p=Pattern.compile("[a-zA-Z]+[[0-9]*|[a-zA-Z]*]+@[a-zA-Z]+[.[a-zA-Z]+]+");
Matcher m = p.matcher(email);
boolean matchFound = m.matches();
if (matchFound)
return true;
else
return false;
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
try{
final XYSeriesDemo Tgraph = new XYSeriesDemo("Temperature
Graph","second",8,"Time","Temp");
Tgraph.pack();
final XYSeriesDemo Hgraph = new XYSeriesDemo("Humidity
Graph","second",9,"Time","Humidity");
Hgraph.pack();
} catch(Exception e) {
}
}

PAGE NO: 55
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

PAGE NO: 56
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

SYSTEM TESTING

7. SYSTEM TESTING

Testing is the process of executing a program with the intention of


finding any error. A good test of course has the high portability of finding a yet undiscovered
error. A successful test is the one that uncovers a yet undiscovered error.

A test is vital to the success of any system. System test makes a


logical assumption that if all parts of the system are correct, then goal will be successfully
achieved. The candidate system is subjected to a variety of tests online like responsiveness,

PAGE NO: 57
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

its value, stress, and security. A series of tests are performed before the system is ready for
user acceptance testing.

System testing is the stage of implementation, which is aimed at


ensuring that the system works accurately and efficiently before live operation commences.
Testing is the process of executing the program with the intent of finding errors and missing
operations and also a complete verification to determine whether the objectives are met and
the user requirements are satisfied. The ultimate aim is quality assurance.
Tests are carried out and the results are compared with the expected
document. In the case of erroneous results, debugging is done. Using detailed testing
strategies a test plan is carried out on each module.

Some of the testing methods used for testing the system are:

 UNIT TESTING
 INTEGRATION TESTING
 BLACKBOX TESTING
 VALIDATION TESTING
 OUTPUT TESTING

7.1 UNIT TESTING

Here we test each module individually and integrate the overall system.
Unit testing focuses verification effort even in the smallest unit of software development in
each module. This is also known as module testing. The modules of the system are tested
separately. This testing is carried out in the programming style itself. In this testing, each
module is focused to work satisfactorily as regard to expect output from the module.

PAGE NO: 58
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

7.2 INTEGRATION TESTING

Data can be lost across on an interface, one module can have an adverse effect
on the other sub-functions, when combined may not produce the desired functions. Integrated
testing is the systematic testing to uncover the error within the interface. The testing is done
with simple data and the developed system can run successfully with this simple data. Here
the major intention is to find the overall system performance. The objective is to take unit
tested modules and build a program structure. All the modules are combined and tested as a
whole.
7.3 BLACKBOX TESTING
This is a software testing approach in which the tester doesn’t know the internal
working of the item being tested. For eg: in a black box test, on software design the tester only
knows the input and the expected outputs. He does not know how the program derives the
output. He doesn’t even imagine as to how, the coding is done. He need know only the
specifications.

The advantages of this testing approach are-

 The test is unbiased because the designer and tester is independent of


each other.

 The tester needs no specific knowledge on any programming language.

 The test is done from the point of view of the user, not the designer.

 The test can be designed as soon as the specifications are complete.

The disadvantages of this testing approach are-

PAGE NO: 59
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

 The test can be redundant if the software designer has already run a test
case.

 The test can be difficult to design.


 Testing every possible input stream is unrealistic.

7.4 VALIDATION TESTING


At the culmination of integration, testing the software is completely assembled
as a whole package. Interfacing errors have been uncovered and corrected and the final series
of tests, ie validation begins. The validation test can be defines by the following simple
definition, that validation succeeds when the software functions in a manner that can be
reasonably accepted by the customer.

7.5 OUTPUT TESTING


After performing validation testing the next step is the output testing. The
system cannot be useful if it does not produce the required output. Asking the user about the
format in which the system is required, test the output that is displayed or generated by the
system under consideration. Here the output format is considered in two way. One is on
screen format and the other is the printed format. The output format on the screen is found to
be correct as the format was designed in the system phase according to user needs. As for
hard copy, the output comes according to the specification requested by the user. Here the
output testing does not result in any correction in the system.

PAGE NO: 60
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

PAGE NO: 61
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

SCREEN SHOTS

PAGE NO: 62
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

Login

Control Desk

PAGE NO: 63
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

Live Monitoring

PAGE NO: 64
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

Connection Tester

Add User

PAGE NO: 65
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

CONCLUSION

In India agriculture plays a vital role in helping millions to earn their livelihood. So
it is necessary to improve and maintain crops to fulfill their needs. The main challenge in front
of farmers is the variation in climatic conditions. Also the farmer needs to visit the farm daily
this may not be possible for those who own many acres of land. Lack of proper irrigation and
unscientific use of fertilizers led to destruction of crops.

Our project ‘Automatic Irrigation Control System’ can solve these problems. We
place temperature and humidity sensors on fields there by making monitoring easy. The
temperature and humidity of field is obtained and is stored in the database. Based on the

PAGE NO: 66
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

information available in database the user will irrigate the fields. Graphs are plotted using
values obtained using the sensors.

PAGE NO: 67
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

BIBLIOGRAPHY

11.1 Reference books

1. Java2 The Complete Reference Third Edition. By Herbert Schildit & Patrick Naughton
2. Programming with Java A Primer By E.Balaguruswamy.
3. Head First Java 2nd Edition, by O'Reilly
4. Java 2 – The Complete Reference, by Herbert Schildit
5. Thinking in Java 3rd Edition, by Bruce Eckel
6. Roger S Pressman, Software Engineering – A Practitioners Approach, McGraw Hill

PAGE NO: 68
COMPUTER SCIENCE AND AUTOMATED IRRIGATION
SEMESTER:VIII
ENGINEERING CONTROL SYSTEM

Inter Editions 1991

11.2 Websites used

1. www.java.sun.com

2. www.wikipedia.org

3. www.google.com

PAGE NO: 69

Anda mungkin juga menyukai