Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 53

E-AGRICULTURAL BASED MONITORING SYSTEM WITH

ANDROID APP SMS ALERT

SYNOPSIS

Agriculture is the primary occupation in our country for ages. But now due to migration

of people from rural to urban there is hindrance in agriculture. So to overcome this problem we

go for smart agriculture techniques using android app. But small farmers do not have the capital

resources to invest in expensive monitoring systems. Hence to address these issues, we have

designed an microcontroller based agriculture monitoring system which operates on GSM

network. This system will monitor the humidity levels and surrounding temperature and control

the water flow accordingly. The controller activates the relay driver unit when the message is

received through GSM and pumps motor by using relay switches. This design can be used for

alarming the user via SMS (Short message service) if the moisture level and temperature goes

beyond threshold value.

1
CHAPTER 1

INTRODUCTION

1.1 INTRODUCTION

Farmers need agricultural information and pertinent knowledge to make knowledgeable

decisions and to satisfy informational needs. In agriculture domain through the development of a

knowledge management system, enquiries of farmers can be answered with the help of

multimedia which is easily accessible. The application of Information and Communication

Technology (ICT) has proven for widening the opportunities to promote agriculture on several

aspects and domains in developing countries. Technology has crossed hurdles by using wireless

technology, networking, mobile etc. to overcome the utilisation of energy, power and cost

consuming equipments which was helpful in the agricultural development. The development of

ICT in various domains has driven substantial interest in rising investments by private sectors

towards the growth of ICT in Agricultural research (Fredrick Awuor et al., 2013). At present, the

key issue in the current domain is utilisation of resources like man-power and water which is

lacking in many parts of the country. There have not been any significant technological

advancements being made in agricultural sector as compared to other sectors. Agricultural

system needs to be monitored on a regular basis. The use of the developed framework is to

reduce wastage by automating the entire agricultural system. To cooperatively pass their data

through the network to a main location. The more modern networks are bidirectional, also

enabling control of sensor activity. The development of wireless sensor networks was motivated

by military applications such as battlefield surveillance; today such networks are used in many

industrial and consumer applications, such as industrial process monitoring and control, machine

health monitoring, and so on. When deployed in the field, the microprocessor automatically
2
initializes communication with every other node in range, creating an ad hoc mesh network for

relaying information to and from the gateway node. This negates the need for costly and

ungainly wiring between nodes, instead relying on the flexibility of mesh networking algorithms

to transport information from node to node.

1.2 OBJECTIVES

 The objectives of the project to design and implementation of agricultural crop

monitoring system
 To detect the growth of the crops in the field
 To control and automate the farm processes
 To establish a secure connection among the agricultural field area

CHAPTER 2

METHODODLOGY AND LITERATURE SURVEY

3
2.1 METHODOLOGY

We are started to explore the recent trends in implementation of ANDROID in smart

farming techniques. In the meantime, we did a brief literary survey on the published works of

eminent scholars in this field. In a novel approach for Digital Agriculture was proposed

describing Relationships between Precision Agriculture and Digital Earth, Information

Agriculture, Virtual Agriculture, and Digital Agriculture. The requirement to put forward the

concept of Digital Agriculture, was discussed. In sensor data collection and irrigation control was

put forward on vegetable crop using Smartphone and wireless sensor networks for smart

farming. The environmental data can be collected and the irrigation system can be controlled

using Smartphone. A novel cloud-computing-based smart farming system was proposed for early

detection of borer insects in Flower. This problem is solved using Cloud computing and

ANDROID. And the real time monitoring of GPS tracking was suggested for multifunctional

vehicle path control and data acquisition based in Zig-Bee wireless network. It summarizes

portion that is related to path planning for a multifunctional vehicle. The vehicletracking system

uses the global positioning system (GPS) and Zig-Bee wireless network based on to make the

system communicate. The web of Things case study for agriculture was put forward, which

focuses on an experimental smart farm that uses a range of environmental sensors and

microcontroller A system that specifies the alert was tested in a farming area and the results were

analyzed. The linked cube was used which allows longer term analysis and data sharing to a

larger scale. From the above literary survey, we have found a novel approach using a smart

sensing system that keeps track of the external environmental factors and does communication

with the smart system to perform necessary tasks that are required for farming. In this system, we

are resolution for the problems faced by the farmers. The main problems faced by them are
4
electricity shortage, manual work, lack of mechanization, knowledge deficit about farming, and

not knowing about the adequate usage of macro mineral contents (N, P, and K). Our system does

the job of sensing and also habituates to the surroundings

2.2 LITERATURE SURVEY

1) Stipanicev D., Marasovic J.,‖ Network embedded greenhouse monitoring and control‖,

Proceedings of 2003 IEEE Conference on Control Applications, Vol.2, June, pp. 1350 - 1355, 2003.

Wireless sensor networks (WSN) could be used to monitor and control many parameters of

environment such as temperature, humidity, and radiation leakage. In greenhouse the weather and

soil should be independent of the natural agents. To achieve this condition a wireless sensor nodes

could be deployed and communicate with a central base station to measure and transmit the sensed

required environment factors. In this paper a WSN was implemented by deployed wireless sensor

nodes in a greenhouse with temperature, humidity, moisture light, and CO2 sensors. The proposed

model was built and tested, and the result shows an excellent improvement in the sensed parameters.

To control the environmental factors, the used microcontroller programmed to control the parameters

according to preset values, or manually through a user interface panel.

2) Turnell, D.J. deFatima, Q.V., Turnell, M., Deep, G.S., Freire, R.C.S., ―Farm Web-an integrated,

Modular farm automation system‖, Proceedings of IEEE International Conference on Systems,

Man, and Cybernetics, Vol.2, Oct., pp. 1184 - 1189, 1998.

This paper provides an excellent solution to this process. The farmer need not go to the farm to

water his field. He can sit at his present place and start the motor on to water his field. No cabling or

hardware connections are required to do this. Everything will be carried in a wireless fashion and this

system is entirely an automated product. The GSM modem performs the task of receiving the message

from the mobile and sending the messages to the mobile from the controlling unit. To the motor, GSM
5
modem with the controlling unit will be fixed. If the farmer wishes to water his field, he needs to switch

on the motor. Thus, he has to send a predefined message to the modem from his mobile. Temperature and

water level sensors are used to findout the teperature and water level in the field. The GSM modem

receives this message and intimates the same to the microcontroller. Now it is the job of the controller to

switch on/ off the motor in accordance with the received message. Here we are also finding the fault

detection of motor means if the motor is not there in the field that will be checked by fault detection

circuitry then send message to the farmer if not found. The input and output functions status will be

displayed on LCD

3) Wei Lin, "Real time monitoring of electrocardiogram through IEEE802.15.4 network,"

Emerging Technologies for a Smarter World (CEWIT), 2011 8th International Conference & Expo

on , vol., no.,pp.1,6, 2-3 Nov. 2011

Real time monitoring of ECG from mobile patients is clinically significant. Physicians can

catch the irregular events in the ECG for risk assessment while the patients perform daily tasks

without being tethered to an ECG device. The objective of the study was to propose a wireless

healthcare network platform based on IEEE 802.15.4 standard which is capable of streaming

multichannel ECG signals wirelessly in real time. The study evaluated the performance of the

platform for the real time monitoring of ECG signals. The wireless network adopts a star topology

with each patient as the end device and the access point as the network center. The access point

bridges the wireless network with Ethernet so that the data can be forwarded to the data center. The

testing system includes two desktop PCs with XBEE Pro ZB modules, one for ECG acquisition and

transmission as the end device and the other for ECG reception and display as the access point. The

XBEE module implements the IEEE 802.15.4 standard and ZigBee stack. Only its ZigBee routing

protocol was used in this study. The data transmission between the PC and the XBEE module was

through serial port. One channel of ECG signal was digitized after being amplified by the ECG

6
amplifier. The ECG was then sent wirelessly through XBEE module to the second PC for real time

display. The test software was written in LabVIEW. The LabVIEW driver for XBEE module was

developed to provide the interface between the test software and the XBEE module. It provides

functions in the control of the XBEE module and serial communication, the management of data

frames, and transmission and reception of data frames. The effective transmission time was defined

as the time difference between the start of the transmission of a data frame and the reception of the

acknowledge frame.

4) Zhenyu Liao; Sheng Dai; Chong Shen, "Precision agriculture monitoring system based on

wireless sensor networks," Wireless Communications and Applications (ICWCA 2012), IET

International Conference on ,vol., no., pp.1,5, 8-10 Oct. 2012

Wireless sensor network (WSN) is a new technology that can provide processed real-time

field data from sensors physically distributed in the field. Based on investigation and applications in

precision agriculture, a wireless agricultural and environmental sensing system for crop monitoring is

presented in the paper. The setup of smart crop monitoring system is based on TinyOS while system

test is implemented using real-time agricultural data and historical data. The results indicate that the

application scenarios are correct and reasonable, which enables users precisely acquire information

from environment.

5) S.N.; Jha, R.; Nandwana, M.K., "Optimal design of solar powered fuzzy control irrigation

system for cultivation of green vegetable plants in Rural India," Recent Advances in Information

Technology (RAIT), 2012 1st International Conference on , vol., no., pp.877,882, 15-17 March 2012

This paper presents solution for an irrigation controller for cultivation of vegetable plants

based on the fuzzy-logic methodology. Water is an essential element for growth of the plants, the

amount of water given to the plants depends on its size, moisture control of soil, which is affected by

7
temperature of environment, evaporation due to wind velocity and water budget. This paper presents

a control strategy to feed water to plants in a controlled and optimal way. The study pertains to

develop a solar powered pump controller, using fuzzy logic control strategy to feed water for

cultivation of these plants. Solar energy conversion technology has been used to feed power to these

pump controller. The system has been developed and tested with the growth of vegetable like tomato

plant that resulted in saving of 50-60 percent water consumption as well as cost of energy generation.

CHAPTER 3

PROPOSED SYSTEM

Agriculture plays an important role in economy and development. The agriculture is in the

transition from traditional agriculture to modern agriculture currently. For continuously

increasing demand of food necessities, rapid improvement in production of food technology is

8
important. In the paper our main focus is to maintain, control or monitor the agricultural trends

or system making it easier for the user, to get data at regular interval about the field. In many

areas one person is not enough to monitoring the field status and control things. To improve we

have to focus on the agriculture monitoring system and to collect more area information. In

agriculture, there are two important factors, first to get information about fertility of soil and

second is to measure moisture content in soil. Nowadays for irrigation, different techniques are

available which is used to reduce the dependency on rain. And mostly this technique is driven by

electrical power and on/off scheduling controlled system. Here we have used sensors to create an

agricultural monitoring system like soil moisture sensor, temperature sensor. Soil moisture sensor

is basically used to measure the soil moisture level and the temperature sensor is used to keep the

track of temperature.GSM sim 900 is being used for sending the data to the user.

CHAPTER 4

BLOCK DIAGRAM AND EXPLANATION

9
The purpose of the microcontroller is that it connects all the components associated with

the Development kit. Number of pins in this processor is 64. Each pin is assigned with particular

component of the kit for performing particular function. The threshold value of the sensors is set

in this LPC 2148 processor which is responsible for the automatic ON and OFF of the motor

which is coupled with the pump for pumping water to the agricultural land. The temperature

threshold value will be updated to server or system, through GSM for every 1 minute from the

integrated development kit. LM35 temperature sensors use amplifier at the right converts

absolute temperature (measured in Kelvin) into either Fahrenheit or Celsius depend on it

configurations. The two resistors are calibrated in the factory to produce a highly accurate
10
temperature sensor. The integrated circuit has many transistors in it -- two in the middle, some in

each amplifier, some in the constant current source, and some in the curvature compensation

circuit.

The sensor measures the moisture level in the soil. The threshold value is reached

(1 RH%-100 RH%) this limits can be set in the microcontroller if its goes above beyond 10 RH

% conditions will be abnormal otherwise moisture level will be in normal conditions. The values

can have updated to system through GSM gateway. The features of sensor are Excellent

linearity, low power consumption, wide measurement range, quick response, anti-pollution, high

stability, high performance price ratio. Water level indicator is used to measure the water level in

irrigation land. In the water level sensor value measure by using scale level and it’s represent in

cm. If the water level reaches the bottom of the metal rod it indicates abnormal condition and the

control will automatically turn ON, the motor. If the water reaches the certain level the motor can

be turn OFF automatically. These statuses can be continuously updated to the system using

GSM. The GSM is the internetworking of physical devices, vehicles, buildings and other items

embedded with electronics, software, sensors, actuators, and network connectivity that enable

these objects to collect and exchange data. These devices collect useful data with the help of

various existing technologies and then autonomously flow the data between other devices. It is

an impressive, low cost Wi-Fi module suitable for adding Wi-Fi functionality to an existing

microcontroller project via a UART serial connection.

The module can even be reprogrammed to act as a standalone Wi-Fi. GSM requires 3.3V

power–do not power it with 5 volts. It needs to communicate via serial at 3.3V and does not have

5V tolerant inputs, so you need level conversion to communicate with a 5V microcontroller.

Configure the GSM using SIM card (of any service provider). It will automatically configure IP

11
address using DHCP (Dynamic Host Configuration Protocol). Each GSM module has the unique

ID (Device Identification). In the development stage itself they integrate code for transmitter and

receiver operations such that gather data from multiple sensors by using microcontroller and

these values can be send to the GSM modules. By using below link update the integrated sensors

value in browsers for every 1 minute.

COMPONENTS DESCRIPTION

4.1 MICROCONTROLLER

The 8051 is an 8 bit microcontroller originally developed by Intel in 1980. It is the

world's most popular microcontroller core, made by many independent manufacturers. A typical

8051 contains CPU with Boolean processor, 5 or 6 interrupts, 2 or 3 16-bit timer/counters,

programmable full-duplex serial port, 32 I/O lines, RAM and ROM/EPROM in some models.

The 8051 architecture is quite strange and original. One strong point of the 8051 is the way it

handles interrupts.

Vectoring to fixed 8-byte areas is convenient and efficient. The 8051 instruction set is

optimized for the one-bit operations so often desired in real-world, real-time control applications.

The microcontroller 8051 has many prominent features suitable for such interfacing and

controlling applications. They are also suitable for serial port interfacing which is very much

needed for data transfer.

Features of 8051 Microcontroller

The 89C51 architecture consist of these specific features:

 Eight-bit CPU with registers A (the accumulator) and B.


12
 Sixteen-bit program counter (PC) and data pointer (DPTR)

 Eight-bit program status word(PSW)

 Eight-bit stack pointer(SP)

 Internal ROM or EPROM (8751) of 0 (8031) to 4k (8951)

 Internal RAM of 128 bytes:

 Four register banks, each containing eight registers Sixteen bytes, which may be

addressed at the bit level. Eighty bytes of general-purpose data memory

 Thirty-two input/output pins arranged as four 8-bit ports:p0-p3

 Two 16 bit timer/counter:T0 and T1

 Full duplex serial data receiver/transmitter: SBUF

 Control register: TCON,TMOD,SCON,PCON,IP and IE

 Two external and three internal interrupt sources

 Oscillator and clock circuits.

The programming model of the 8951 has collection of 8 and 16-bits registers and 8 bit

memory locations. These registers and memory locations can be made to operate using the

software instructions that are incorporated as part of the design. The program instructions have to

do with the control of the registers and digital data paths that are physically contained inside the

8951, as well as memory locations that are physically located outside the 8951

Pin Diagram

13
8051 Pin Out

 Power - Vcc, Vss


 Reset - RST
 Crystal - XTAL[1,2]
 External device interfacing – EA, ALE, PSEN, WR, RD
 I/O Port – P0[7;0], P1[7:0], P2[7:0], P3
 P3 is shared with control lines
 Serial I/O RxD, TxD,
 External interrupts INT0, INT1
 Counter control T0, T1
 P0 and P2 are multiplexed with Address and Data bus

Pin Description

ALE/PROG:

Address Latch Enable output pulse for latching the low byte of the address during

accesses to external memory. ALE is emitted at a constant rate of 1/6 of the oscillator frequency,
14
for external timing or clocking purposes, even when there are no accesses to external memory.

(However, one ALE pulse is skipped during each access to external Data Memory.) This pin is

also the program pulse input (PROG) during EPROM programming.

PSEN:

Program Store Enable is the read strobe to external Program Memory. When the device is

executing out of external Program Memory, PSEN is activated twice each machine cycle (except

that two PSEN activations are skipped during accesses to external Data Memory). PSEN is not

activated when the device is executing out of internal Program Memory.

EA/VPP:

The EA on pin 31 is tied high to make the 8051 executes program from Internal ROM

When EA is held high the CPU executes out of internal Program Memory (unless the Program

Counter exceeds 0FFFH in the 80C51).

Holding EA low forces the CPU to execute out of external memory regardless of the

Program Counter value. In the 80C51, EA must be externally wired low. In the EPROM devices,

this pin also receives the programming supply voltage (VPP) during EPROM programming.

It can sink eight LS TTL loads. Port 0 pins that have 1s written to them float, and in that

state will function as high impedance inputs. Port 0 is also the multiplexed low-order address and

data bus during accesses to external memory. In this application it uses strong internal pullups

when emitting 1s. Port 0 emits code bytes during program verification. In this application,

external pull-ups are required.

Port 1:
15
Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. Port 1 pins that have 1s

written to them are pulled high by the internal pull-ups, and in that state can be used as inputs. As

inputs, port 1 pins that are externally being pulled low will source current because of the internal

pull-ups.

Port 2:

Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. Port 2 emits the high-order

address byte during accesses to external memory that use 16-bit addresses. In this application, it

uses the strong internal pull-ups when emitting 1s.

Port 3:

Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. It also serves the functions

of various special features of the 80C51 Family as follows:

Port Pin Alternate Function

P3.0 RxD (serial input port)

P3.1 TxD (serial output port)

P3.2 INT0 (external interrupt 0)

P3.3 INT1 (external interrupt 1)

P3.4 T0 (timer 0 external input)

P3.5 T1 (timer 1 external input)

P3.6 WR (external data memory write strobe)

16
P3.7 RD (external data memory read strobe)

VCC: Supply voltage

VSS: Circuit ground potential

Reset Circuit:

RESET is an active High input When RESET is set to High, 8051 goes back to the power

on state. The 8051 is reset by holding the RST high for at least two machine cycles and then

returning it low.

Reset circuit

Architecture

17
Flags and program status word (PSW):

Flags are 1-bit registers provided to store the results of certain program instructions.

Other instructions can test the condition of the flags and made decisions based on the flag states.

The PSW which contains the flag bits is as shown below.

7 6 5 4 3 2 1 0

CY AC F0 RS1 RS0 OV - P

Program Status Word (PSW)

18
The 8951 has four math flags that respond automatically to the outcomes of math

operations and three general-purpose user flags that can be set to 1 or cleared to 0 by the

programmer as desired.

Symbol Functions:

 Carry (C)

 Auxiliary Carry (AC)

 Overflow (OV)

 Parity (P)

User flags are named F0, GF0 and GF1; they are general-purpose flags that may be used

by the programmer to record some event in the program.

Program counter and data pointer:

The 8951 contains two 16 bit registers: Program counter (PC) and Data pointer (DP).

Each is used to hold the address of byte in memory. Program instruction bytes are fetched from

locations in memory that are addressed by the PC. The PC is incremented automatically after

every instruction byte is fetched and may also be altered by certain instructions. The PC is the

only register that does not have an internal address. The DPTR register is made up of two 8 bit

registers, named DPH and DPL, which are used to furnish memory addresses for internal and

external code access and external data access.

A & B REGISTERS:

19
The 8051 contains 34 general - purpose, or working registers. Two of these, registers A

and B, hold results of many instructions particularly math and logical operations, of the 8051

central processing unit.

Internal Memory:

The 128 byte internal RAM, is organized in three distinct areas: 32 bytes from addresses

00h to 1fh that make up 32 working registers organized as four banks of 8 registers each. The

four register bank are numbered 0 to 3 and are made up of 8 registers named R0 to R7.

Each register can be addressed by name or bytes RAM address. Register banks not

selected can be used as general purpose RAM. Bank 0 is selected on reset.

A bit addressable area of 16 bytes occupies RAM byte addresses 20h to 2fh forming a

total of 128 addressable bits. An addressable may be specified by its bit addresses of 00h to 7fh

or 8 bits may form any byte addresses from 20h to 2fh. A general purpose RAM area above the

bit area from 30h to 7fh addressable as bytes.

The stack and the stack pointer:

The stack refers to an area of the internal RAM that is used in conjunction with certain

opcodes to store and retrieve data quickly. The 8-bit stack pointer (SP) register is used by the

8951: to hold an internal RAM address that is called the top of the stack. The address held in the

SP register is the location in internal RAM where the last byte of was stored by the stack

operation.

20
When data is to be placed in the stack, the SP increments before storing data on the stack

so that the stack grows as the data is stored.

As data is retrieved from the stack, the byte is read from the stack, and then the SP

decrements to point to the next available byte of stored data.

The stack is limited in height to the size of the internal RAM. The stack has the potential

to overwrite valuable data in the register banks, bit-addressable RAM, and scratchpad RAM

areas. The programmer is responsible for making sure the stack does not grow beyond bounds.

The stack is normally placed high in internal RAM, by an appropriate choice of number placed

in the SP register, to avoid conflict with the register, bit and scratchpad internal RAM areas.

Special functional registers:

The 89C51 operations do not use the internal 128 – byte RAM addresses 00h to 7Fh are

done by a group of specific internal register each called a special function register, which may be

addressed much like internal RAM using addresses from 80h to FFh .

Ports:

The 89C51 microcontroller consists of four I/O ports. These ports can be used for

multiple functions.

89C51 Oscillator and clock:

The 8051 uses the crystal for precisely that: to synchronize its operation. Effectively, the

8051 operates using what are called "machine cycles." A single machine cycle is the minimum

21
amount of time in which a single 8051 instruction can be executed. Although many instructions

take multiple cycles.

8051 has an on-chip oscillator. It needs an external crystal that’s decides the operating

frequency of the 8051.

This can be achieved in two ways,

1. The crystal is connected to pins 18 and 19 with stabilizing capacitors. 12 MHz

(11.059MHz) crystal is often used and the capacitance ranges from 20pF to 40pF.

2. The oscillator can also be a TTL clock source connected with a NOT gate as shown

Serial data communication needs often dictate the frequency of the oscillator because of the

requirement that internal counters must divide the basic clock rate to yield standard

communication bit per second (baud rates). If the basic clock frequency is not divisible without a

reminder, then the resulting communication frequency is not standard.

Ceramic resonators may be used as a low cost alternative to crystal resonators.

However, decreases frequency stability and accuracy make the ceramic resonator a poor choice if

serial data communication if high speed serial data communication with other systems or critical

timing is to be done.

22
The oscillator formed by the crystal, capacitors, and an on-chip inverter generates a pulse

train at the frequency of the crystal.

The clock frequency establishes the smallest interval of time within the microcontroller,

called the pulse, time. The smallest interval of time to accomplish any simple instruction, or part

of a complex instruction, however, is the machine cycle.

The machine cycle is itself made up of six states. A state is the basic time interval for

discrete operations of the microcontroller such as fetching an opcode byte, decoding an opcode

byte, executing an opcode or writing a data byte. Two oscillator pulses define each state.

Programming instruction may require one, two or four machine cycles to be executed depending

on the type of the instruction.

Instructions are fetched and executed by the microcontroller automatically, beginning

with the instruction, located at ROM memory address 0000h. At the time the microcontroller is

first reset.

4.2 POWER SUPPLY

5V/12V Regulated DC Power Supply

A Direct Current (DC) supply is needed by most circuits as a constant reference voltage.

Also, some components would be damaged by the negative half-cycles of an AC supply. A DC

supply, stays at a fixed, regular, voltage all of the time, like the voltage from a battery. Following

is a block diagram of a power supply system which converts a 230V AC mains supply (230V is

the UK mains voltage) into a regulated 5V DC supply.


23
Transformer

A transformer consists of two coils (often called 'windings') linked by an iron core, as

shown in figure 1. There is no electrical connection between the coils, instead they are linked by

a magnetic field created in the core. Transformers are used to convert electricity from one

voltage to another with minimal loss of power. They only work with AC (alternating current)

because they require a changing magnetic field to be created in their core. Transformers can

increase voltage (step-up) as well as reduce voltage (step-down).

Bridge Rectifier

A diode bridge or bridge rectifier is an arrangement of four diodes in

a bridge configuration that provides the same polarity of output voltage for either polarity of

input voltage. When used in its most common application, for conversion of alternating

current (AC) input into direct current (DC) output, it is known as a bridge rectifier.

In the diagrams below, when the input connected to the left corner of the diamond

is positive (Fig. A), and the input connected to the right corner is negative, current flows from

the upper supply terminal to the right along the red (positive) path to the output, and returns to

the lower supply terminal via the blue (negative) path.

24
When the input connected to the left corner is negative (Fig. B), and the input connected

to the right corner is positive, current flows from the lower supply terminal to the right along

the red path to the output, and returns to the upper supply terminal via the blue path.

In each case, the upper right output remains positive and lower right output negative.

Since this is true whether the input is AC or DC, this circuit not only produces a DC output from

an AC input, it can also provide what is sometimes called "reverse polarity protection". That is, it

permits normal functioning of DC-powered equipment when batteries have been installed

backwards, or when the leads (wires) from a DC power source have been reversed, and protects

the equipment from potential damage caused by reverse polarity.

Smoothing

Most circuits will require 'smoothing' of the DC output of a rectifier, and this is a simple

matter since it involves only one capacitor.

Regulator

Voltage regulator ICs are available with fixed (typically 5, 6, 8, 9, 10, 12, 15, 18 and

24V) or variable output voltages. They are also rated by the maximum current they can pass.

Negative voltage regulators are available, mainly for use in dual supplies. Most regulators

include some automatic protection from excessive current ('overload protection') and overheating

('thermal protection'). Many of the fixed voltage regulator ICs have 3 leads and look like power

transistors, such as the 7805 +5V 1A regulator shown on the right. They include a hole for

attaching a heat sink if necessary.

25
Power Supply Circuit

4.3 MOTOR

A DC motor is designed to run on DC electric power. Two examples of pure DC designs

are Michael Faraday's homopolar motor (which is uncommon), and the ball bearing motor,

which is (so far) a novelty. By far the most common DC motor types are the brushed and

brushless types, which use internal and external commutation respectively to periodically reverse

the current in the rotor windings.

Permanent-magnet motors

A permanent-magnet motor does not have a field winding on the stator frame, instead

relying on permanent magnets to provide the magnetic field against which the rotor field

interacts to produce torque. Compensating windings in series with the armature may be used on

large motors to improve communication under load. Because this field is fixed, it cannot be

adjusted for speed control. Permanent-magnet motors are convenient in miniature motors to

26
eliminate the power consumption of the field winding. Most larger DC motors are of the

"dynamo" type, which requires current to flow in field windings to provide the stator magnetic

field.

To minimize overall weight and size, miniature permanent-magnet motors may use high

energy magnets made with neodymium or other strategic elements. With the higher flux density

provided, electric machines with high energy permanent magnets are at least competitive with all

optimally designed singly-fed synchronous and induction electric machines .

Brushed DC motors

DC motor design generates an oscillating current in a wound rotor, or armature, with a

split ring commutator, and either a wound or permanent magnet stator. A rotor consists of one or

more coils of wire wound around a core on a shaft; an electrical power source is connected to the

rotor coil through the commutator and its brushes, causing current to flow in it, producing

electromagnetism. The commutator causes the current in the coils to be switched as the rotor

turns, keeping the magnetic poles of the rotor from ever fully aligning with the magnetic poles of

the stator field, so that the rotor never stops (like a compass needle does) but rather keeps

rotating indefinitely (as long as power is applied and is sufficient for the motor to overcome the

shaft torque load and internal losses due to friction, etc.)

Many of the limitations of the classic commutator DC motor are due to the need for

brushes to press against the commutator. This creates friction. Sparks are created by the brushes

making and breaking circuits through the rotor coils as the brushes cross the insulating gaps

between commutator sections. Depending on the commutator design, this may include the

27
brushes shorting together adjacent sections—and hence coil ends—momentarily while crossing

the gaps.

Furthermore, the inductance of the rotor coils causes the voltage across each to rise when

its circuit is opened, increasing the sparking of the brushes. This sparking limits the maximum

speed of the machine, as too-rapid sparking will overheat, erode, or even melt the commutator.

The current density per unit area of the brushes, in combination with their resistivity,

limits the output of the motor. The making and breaking of electric contact also causes electrical

noise, and the sparks additionally cause RFI. Brushes eventually wear out and require

replacement, and the commutator itself is subject to wear and maintenance (on larger motors) or

replacement (on small motors). The commutator assembly on a large motor is a costly element,

requiring precision assembly of many parts. On small motors, the commutator is usually

permanently integrated into the rotor, so replacing it usually requires replacing the whole rotor.

Large brushes are desired for a larger brush contact area to maximize motor output, but

small brushes are desired for low mass to maximize the speed at which the motor can run

without the brushes excessively bouncing and sparking (comparable to the problem of "valve

float" in internal combustion engines).

Small brushes are also desirable for lower cost.) Stiffer brush springs can also be used to

make brushes of a given mass work at a higher speed, but at the cost of greater friction losses

(lower efficiency) and accelerated brush and commutator wear. Therefore, DC motor brush

design entails a trade-off between output power, speed, and efficiency/wear.

28
4.4 GSM MODEM

A GSM modem is a specialized type of modem which accepts a SIM card, and operates

over a subscription to a mobile operator, just like a mobile phone. From the mobile operator

perspective, a GSM modem looks just like a mobile phone.

When a GSM modem is connected to a computer, this allows the computer to use the

GSM modem to communicate over the mobile network. While these GSM modems are most

frequently used to provide mobile internet connectivity, many of them can also be used for

sending and receiving SMS and MMS messages.

A GSM modem can be a dedicated modem device with a serial, USB or Bluetooth

connection, or it can be a mobile phone that provides GSM modem capabilities.

For the purpose of this document, the term GSM modem is used as a generic term to refer

to any modem that supports one or more of the protocols in the GSM evolutionary family,

29
including the 2.5G technologies GPRS and EDGE, as well as the 3G technologies WCDMA,

UMTS, HSDPA and HSUPA.

A GSM modem exposes an interface that allows applications such as Now SMS to send

and receive messages over the modem interface. The mobile operator charges for this message

sending and receiving as if it was performed directly on a mobile phone. To perform these tasks,

a GSM modem must support an “extended AT command set” for sending/receiving SMS

messages, as defined in the ETSI GSM 07.05 and and 3GPP TS 27.005 specifications.

GSM modems can be a quick and efficient way to get started with SMS, because a

special subscription to an SMS service provider is not required. In most parts of the world, GSM

modems are a cost effective solution for receiving SMS messages, because the sender is paying

for the message delivery.

A GSM modem can be a dedicated modem device with a serial, USB or Bluetooth

connection, such as the Falcom Samba 75. (Other manufacturers of dedicated GSM modem

devices include Wavecom, Multitech and iTegno. We’ve also reviewed a number of modems on

our technical support blog.) To begin, insert a GSM SIM card into the modem and connect it to

an available USB port on your computer.

A GSM modem could also be a standard GSM mobile phone with the appropriate cable

and software driver to connect to a serial port or USB port on your computer. Any phone that

supports the “extended AT command set” for sending/receiving SMS messages, as defined in

ETSI GSM 07.05 and/or 3GPP TS 27.005, can be supported by the Now SMS & MMS Gateway.

Note that not all mobile phones support this modem interface.

30
Due to some compatibility issues that can exist with mobile phones, using a dedicated

GSM modem is usually preferable to a GSM mobile phone. This is more of an issue with MMS

messaging, where if you wish to be able to receive inbound MMS messages with the gateway,

the modem interface on most GSM phones will only allow you to send MMS messages. This is

because the mobile phone automatically processes received MMS message notifications without

forwarding them via the modem interface.

It should also be noted that not all phones support the modem interface for sending and

receiving SMS messages. In particular, most smart phones, including Blackberries, iPhone, and

Windows Mobile devices, do not support this GSM modem interface for sending and receiving

SMS messages at all at all.

Additionally, Nokia phones that use the S60 (Series 60) interface, which is Symbian

based, only support sending SMS messages via the modem interface, and do not support

receiving SMS via the modem interface.

Following is the simple architecture diagram of GSM network:

31
Following is the diagram of GSM network along with added elements:

The MS and the BSS communicate across the Um interface, also known as the air

interface or radio link. The BSS communicates with the Network Service Switching center

across the A interface.

32
GSM network areas:

In a GSM network, the following areas are defined:

 Cell: Cell is the basic service area: one BTS covers one cell. Each cell is given a Cell

Global Identity (CGI), a number that uniquely identifies the cell.

 Location Area: A group of cells form a Location Area. This is the area that is paged

when a subscriber gets an incoming call. Each Location Area is assigned a Location Area

Identity (LAI). Each Location Area is served by one or more BSCs.

 MSC/VLR Service Area: The area covered by one MSC is called the MSC/VLR service

area.

 PLMN: The area covered by one network operator is called PLMN. A PLMN can contain

one or more MSCs.

4.5 LCD

Liquid crystal displays, abbreviated as LCD’s are passive displays, i.e. they will not

actually generate the light but they modify the existing light. They convert or modulate the light

under the electrical stimulus. Hence LCD’S are light controllers and they require external source

of light. The Typical characteristics of LCD’S are:

 They do not actively generate light and depend for their operation on ambient or black

lighting; they modify light in such away as to perform the display function.

 They consume very low power and good contrast ratio.

 They can operate in a reflective or transmissive configuration.

33
 They are either light scattering or light absorbing devices.

The most commonly used Character based LCDs are based on Hitachi's HD44780 controller or

other which are compatible with HD44580. In this tutorial, we will discuss about character based

LCDs, their interfacing with various microcontrollers, various interfaces (8-bit/4-bit),

programming, special stuff and tricks you can do with these simple looking LCDs which can

give a new look to your application.

Pin Description

The most commonly used LCD found in the market today are 1 Line, 2 Line or 4 Line

LCD which have only 1 controller and support at most of 80 characters, whereas LCD

supporting more than 80 characters make use of 2HD44780controllers.

Most LCD with 1 controller has 14 Pins and LCD with 2 controller has 16 Pins (two pins are

extra in both for back-light LED connections). Pin description is shown in the table below.

Fig LCD display

The 8-bit data pins, DB0 to DB7, are used to send information to the LCD or to read the

contents of the LCD’s internal registers. To display letters and numbers, we send ASCII codes for

the letters A-Z, a-z and numbers 0-9 to these pins while making RS =1.

34
Table : LCD pin description.

There are also instruction command codes that can be sent to the LCD to clear the display

or force the cursor to the home position or blink the cursor. The table below lists the instruction

command codes.

We use RS=0 to check the busy flag bit to see if the LCD is ready to receive information.

The busy flag is DB7 and can be read when R/W=1 and RS=0.R/W input allows the user to write

information to the LCD or read information from it. R/W=1 when reading; R/W=0 when writing.

The enable pin is used by the LCD to latch information presented to its data pins. When data is

supplied to data pins, a high-to-low pulse must be applied to this pin in order for the LCD to

latch in the data present at the data pins.

Command Codes

35
 They do not actively generate light and depend for their operation on ambient or black

lighting; they modify light in such away as to perform the display function.

 They consume very low power and good contrast ratio.

 They can operate in a reflective or transmissive configuration.

 They are either light scattering or light absorbing devices.

The most commonly used Character based LCDs are based on Hitachi's HD44780 controller or

other which are compatible with HD44580. In this tutorial, we will discuss about character based

LCDs, their interfacing with various microcontrollers, various interfaces (8-bit/4-bit),

programming, special stuff and tricks you can do with these simple looking LCDs which can

give a new look to your application.

36
4.6 TEMPERATURE SENSOR:

The LM35 series are precision integrated-circuit temperature sensors, whose output

voltage is linearly proportional to the Celsius (Centigrade) temperature. The LM35 thus has an

advantage over linear temperature sensors calibrated in ˚ Kelvin, as the user is not required to

subtract a large constant voltage from its output to obtain convenient Centigrade scaling. The

37
LM35 does not require any external calibration or trimming to provide typical accuracies of

±1⁄4˚C at room temperature and ±3⁄4˚C over a full −55 to +150˚C temperature range. Low cost is

assured by trimming and calibration at the wafer level. The LM35’s low output impedance, linear

output, and precise inherent calibration make interfacing to readout or control circuitry especially

easy.

µA from its supply, it has very low self-heating, less than 0.1˚C in still air. The LM35 is

rated to operate over a −55˚ to +150˚C temperature range, while the LM35C is rated for a −40˚ to

+110˚C range (−10˚ with improved accuracy).

The LM35 series is available packaged in hermetic TO-46 transistor packages, while the

LM35C, LM35CA, and LM35D are also available in the plastic TO-92 transistor package. The

LM35D is also available in an 8-lead surface mount small outline package and a plastic TO-220

package.

Features

 Calibrated directly in ˚ Celsius (Centigrade)


 Linear + 10.0 mV/˚C scale factor
 0.5˚C accuracy guaranteeable (at +25˚C) n
38
 Rated for full −55˚ to +150˚C range
 Suitable for remote applications
 Low cost due to wafer-level trimming
 Operates from 4 to 30 volts
 Less than 60 µA current drain
 Low self-heating, 0.08˚C in still air
 Nonlinearity only ±1⁄4˚C typical
 Low impedance output, 0.1 Ω for 1 mA load
Temperature is the most often-measured environmental quantity. This might be expected

since most physical, electronic, chemical, mechanical, and biological systems are affected by

temperature. Certain chemical reactions, biological processes, and even electronic circuits

perform best within limited temperature ranges. Temperature is one of the most commonly

measured variables and it is therefore not surprising that there are many ways of sensing

it. Temperature sensing can be done either through direct contact with the heating source, or

remotely, without direct contact with the source using radiated energy instead. There are a wide

variety of temperature sensors on the market today, including Thermocouples, Resistance

Temperature Detectors (RTDs), Thermistors, Infrared, and Semiconductor Sensors.

4.7 SOIL MOISTURE SENSOR

Soil moisture sensors measure the water content in soil. A soil moisture probe is made up

of multiple soil moisture sensors. Since analytical measurement of free soil moisture requires

removing a sample and drying it to extract moisture, soil moisture sensors measure some other

property, such as electrical resistance, dielectric constant, or interaction with neutrons, as a proxy

for moisture content. The relation between the measured property and soil moisture must be

calibrated and may vary depending on soil type. Reflected microwave radiation is affected by the

soil moisture and is used for remote sensing in hydrology and agriculture. Portable probe

instruments are used by farmers or gardeners.

39
TECHNOLOGY:

Technologies commonly used in soil moisture sensors include:

 Frequency domain sensor such as a capacitance sensor.

 Neutron moisture gauges, utilize the moderator properties of water for neutrons.

 electrical resistance of the soil

 Time domain transmission (TDT) and time domain reflectometry (TDR); water has a

high dielectric constant; a higher water concentration causes a higher average dielectric

constant for the soil. The average dielectric constant can be sensed by measuring the

speed of propagation along a buried transmission line.

 Heat dissipation sensors rely on the effective thermal conductivity of soil. Soil with

additional water conducts heat more readily than dry soil. Heat dissipation sensors that

include a porous intermediate water holding element are subject to errors of up to 30%

during the wet and dry cycles.

40
 Measuring soil moisture is important in agriculture to help farmers manage their

irrigation systems more efficiently. Not only are farmers able to generally use less water

to grow a crop, they are able to increase yields and the quality of the crop by better

management of soil moisture during critical plant growth stages.

 Besides agriculture, there are many other disciplines using soil moisture sensors. Golf

courses are now using sensors to increase the efficiencies of their irrigation systems to

prevent over watering and leaching of fertilizers and other chemicals offsite.

The soil moisture sensor consists of two probes which are used to measure the volumetric

content of water. The two probes allow the current to pass through the soil and then it gets the

resistance value to measure the moisture value.

When there is more water, the soil will conduct more electricity which means that there will be

less resistance. Therefore, the moisture level will be higher. Dry soil conducts electricity poorly,

so when there will be less water, then the soil will conduct less electricity which means that there

will be more resistance. Therefore, the moisture level will be lower.

This sensor can be connected in two modes; Analog mode and digital mode. First, we will

connect it in Analog mode and then we will use it in Digital mode.

Specifications

The specifications of the soil moisture sensor FC-28 are as follows

Input Voltage 3.3 – 5V

41
Output Voltage 0 – 4.2V

Input Current 35mA

Output Signal Both Analog and Digital

Pin Out – Soil Moisture Sensor

The soil Moisture sensor FC-28 has four pins

 VCC: For power

 A0: Analog output

 D0: Digital output

 GND: Ground

The Module also contains a potentiometer which will set the threshold value and then this

threshold value will be compared by the LM393 comparator. The output LED will light up and

down according to this threshold value.

Pin Out – Diagram


42
Analog Mode – Interfacing Soil Moisture Sensor

To connect the sensor in the analog mode, we will need to use the analog output of the sensor.

When taking the analog output from the soil moisture sensor FC-28, the sensor gives us the value

from 0-1023. The moisture is measured in percentage, so we will map these values from 0 -100

and then we will show these values on the serial monitor.

You can further set different ranges of the moisture values and turn on or off the water pump

according to it.

CHAPTER 5

HARDWARE REQUIREMENTS

 MICROCONTROLLER
 LCD
 GSM MODEM
 MAX 232 IC
 TEMPERATURE SENSOR
 HUMIDITY SENSOR
 MOTOR
 RELAY DRIVER

43
CHAPTER 6

SOFTWARE REQUIREMENTS

• KEIL C COMPILER

• ATMEL IC PROGRAMMER

44
CHAPTER 7

CIRCUIT DIAGRAM

45
CHAPTER 8

PROGRAMMING CODE

#include <REGX51.H>
46
/* special function register declarations */

/* for the intended 8051 derivative */

void msdelay(unsigned int );

#include<string.h>

sbit LCD_en=P3^4;

sbit LCD_rs=P3^5;

void LCD_delay(unsigned char ms);

void LCD_enable();

void LCD_command(unsigned char command);

void LCD_putc(unsigned char ascii);

void LCD_puts(unsigned char *lcd_string);

void LCD_init();

void Delay_1sec();

#define LCD_DELAY 1535 /* Delay for 1 ms */

#define LCD_clear() LCD_command(0x1) /* Clear display LCD */

#define LCD_origin() LCD_command(0x2) /* Set to origin LCD */

#define LCD_row1() LCD_command(0x80) /* Begin at Line 1 */

#define LCD_row2() LCD_command(0xC0) /* Begin at Line 2 */

#include <stdio.h> /* prototype declarations for I/O functions */

sbit MES1 = P2^0;

sbit MES2 = P2^1;

sbit MES3 = P2^2;

47
sbit MES4 = P2^3;

sbit MES5 = P2^4;

sbit MES6 = P2^5;

sbit MES7 = P2^6;

sbit MES8 = P2^7;

int i;

void time1ms();

void delay(int n);

unsigned int p,num;

//INTRUDER=0;

/****************/

/* main program */

/****************/

void main (void) { /* execution starts here after stack init */

SCON = 0x52; /* SCON: mode 1, 8-bit UART, enable rcvr */

TMOD |= 0x20; /* TMOD: timer 1, mode 2, 8-bit reload */

TH1 = 0xfd; /* TH1: reload value for 9600 baud@11.0592mhz */

TR1 = 1; /* TR1: timer 1 run */

TI = 1; /* TI: set TI to send first char of UART */

LCD_init(); // LCD initialization

LCD_clear(); // clearing lcd display

// initializing serial communication

48
LCD_row1(); // setting cursor into first row

of lcd

CHAPTER 9

PCB LAYOUT AND FABRICATION

49
CHAPTER 10

ADVANTAGES AND APPLICATIONS

50
ADVANTAGES

• Productivity is enhanced.

• Based on the fertility, weather conditions crop is selected.

• It also reduces the cost of traditional farming equipments.

• Output is efficient

APPLICATIONS

Our idea not only tries to mitigate the primitive techniques related to agriculture but also serve

the community by opening new avenues for employment. The applications are extensive with

easy implementation. The foremost function of our project is to monitor the crop growth using

digital means. This will provide the accurate values of various parameters upon which the growth

depends. Besides this, it will help the farmer to monitor more than one agricultural land at the

same time. Since most of the monitoring is done remotely, it will help the farmer to gain

information which is crucial for the business during his/her spare time. We plan to make it user-

friendly by involving a simple GUI along with mobile messaging. Since monitoring through our

system requires less manpower, people with physical disabilities can be employed for the

monitoring of fields. Overall, our project idea is feasible, which can easily be implemented and

has a wide scope in terms of its application.

CHAPTER 11

CONCLUSION AND FUTURE SCOPE

CONCLUSION

51
The progress in electronics and telecommunication engineering, paved way for new

inventions and technologies. As we are moving towards miniaturization, handy components are

needed which has better accuracy and reliability. Here we are developing an embedded system

which will help in agricultural field to monitoring field. The sensors present in the system

measure various parameters. The sensed data is transmitted to the receiver station via SMS by

GSM module. The decisions that are taken by the motor depend on the sensors response i.e. from

soil moisture sensor and humidity sensor as well as the message received. Simulation is

performed by using Proteus software by placing appropriate sensors like temperature and soil

moisture sensor and the results are analyzed under different conditions.

FUTURE SCOPE

This project has enormous potential and may be used in various other ways, due to its cheap and cost

efficient design. For further easy access the data can also be displayed on android applications. The

iteration of this project is for data monitoring. The future iteration will include data collection at base

station and incorporation of additional remote stations to directly control irrigation systems. Web services

for alerting and analytics will be added, in addition to a monitoring user interface. We can also use web

camera to capture live crop images over Wi-Fi.

REFERENCES

1) Stipanicev D., Marasovic J.,‖ Network embedded greenhouse monitoring and control‖, Proceedings of

2003 IEEE Conference on Control Applications, Vol.2, June, pp. 1350 - 1355, 2003.

52
2) Turnell, D.J. deFatima, Q.V., Turnell, M., Deep, G.S., Freire, R.C.S., ―Farm Web-an integrated,

Modular farm automation system‖, Proceedings of IEEE International Conference on Systems, Man, and

Cybernetics, Vol.2, Oct., pp. 1184 - 1189, 1998.

3) Wei Lin, "Real time monitoring of electrocardiogram through IEEE802.15.4 network," Emerging

Technologies for a Smarter World (CEWIT), 2011 8th International Conference & Expo on , vol.,

no.,pp.1,6, 2-3 Nov. 2011

4) Zhenyu Liao; Sheng Dai; Chong Shen, "Precision agriculture monitoring system based on wireless

sensor networks," Wireless Communications and Applications (ICWCA 2012), IET International

Conference on ,vol., no., pp.1,5, 8-10 Oct. 2012

5) S.N.; Jha, R.; Nandwana, M.K., "Optimal design of solar powered fuzzy control irrigation system for

cultivation of green vegetable plants in Rural India," Recent Advances in Information Technology

(RAIT), 2012 1st International Conference on , vol., no., pp.877,882, 15-17 March 2012

53

You might also like