Sie sind auf Seite 1von 64

INTRODUCTION

Continuous increasing demand of food requires the control in highly specialized greenhouse
vegetable rapid improvement in food production technology. In a production and it is a simple,
precise method for country like India, where the economy is mainly based on irrigation. It also
helps in time saving, removal of human agriculture and the climatic conditions are isotropic, still
error in adjusting available soil moisture levels and to we are not able to make full use of
agricultural resources. Maximize their net profits. The main reason is the lack of rains & scarcity
of land Irrigation is the artificial application of water to the soil reservoir water. The continuous
extraction of water from usually for assisting in growing crops. In crop production earth is
reducing the water level due to which lot of land is it is mainly used in dry areas and in periods
of rainfall coming slowly in the zones of un-irrigated land. Another shortfalls, but also to protect
plants against frost. Very important reason of this is due to unplanned use of Types of Irrigation
water due to which a significant amount of water goes to surface irrigation waste. Localized
irrigation in modern drip irrigation systems, the most significant Drip Irrigation advantage is that
water is supplied near the root zone of sprinkler irrigation. The plants drip by drip due to which a
large quantity of water is saved. At the present era, the farmers have been the conventional
irrigation methods like overhead using irrigation techniques in India through manual control
sprinklers, flood type feeding systems usually wet the in which farmers irrigate the land at the
regular intervals. Lower leaves and stem of the plants. The entire soil this process sometimes
consumes more water or surface is saturated and often stays wet long after irrigation sometimes
the water reaches late due to which crops is completed. Such condition promotes infections by
leaf get dried. Water deficiency can be detrimental to plants mold fungi. On the contrary the drip
or trickle irrigation is before visible wilting occurs. Slowed growth rate, lighter a type of modern
irrigation technique that slowly applies weight fruit follows slight water deficiency. This
problem small amounts of water to part of plant root zone. Water is can be perfectly rectified if
we use automatic micro supplied frequently, often daily to maintain favorable soil controller
based drip irrigation system in which the moisture condition and prevent moisture stress in the
plant irrigation will take place only when there will be acute with proper use of water resources.
1.1 AIM

To design automatic plant irrigation system for saving water and soil disturbance

1.2 NEED OF TECHNOLOGY

The proposed system consist of Extremely high-tech solutions also exist using GIS and satellites to
automatically measure the water needs content of each crop parcel and optimize the irrigation system.

1.3 RECENT TECHNOLOGY

The latest innovation in irrigation is the smart sprinkler controller, a device that gives your
plants the right amount of water for the time of year, climate and weather.
With Smart Controllers installed on your property, you will be able to avoid over-watering
and excessive run-off by scheduling the amount of irrigation based on the type of landscape
and current weather.
1.4 ORGANIZATION OF PROJECT REPORT

SR.
ACTIVITY PLANNED
NO WEEK

Formation of group 1st Week (26-29Dec)


1.

Finalization of mini project topic 2nd Week (2-5Jan)


2.

3rd Week(10-12Jan)
Listing out components required
3.

Deciding the components specifications 4th Week(15-19Jan)


4.

Buying required components 5th Week(23-26Jan)


5.

PCB board design 6th Week(5-8Feb)


6.

Hardware assembling 7th Week(13-18Feb)


7.

Programming and testing 8th Week(20-26March)


8.

Testing of final project and preparing final Report 9th Week(28-33March)


9.
Chapter 2

LITERATURE SURVEY

Sr. Paper Title Year of Publication Advantages Disadvantages


No

• Speed of operation high


Implementation due to use of PIC
• High power
of an Automated April-2014 Microcontroller.
1. consumption
Irrigation System • Economical to be
installed.

• Automatic irrigation
Automatic Plant system, Circuit is
May-2016
2. Irrigation System • Saves time of farmers bulky
.

S. Darshna et
• Due to use of
al., "Smart
TIMER IC
Irrigation
• Components in circuit speed of
System", IOSR May-Jun. 2015.
are cheap. operation is
3. Journal of
• Saves time of farmers reduced.
Electronics and
Communication
Circuit is bulky
Engineering
(IOSR JECE)
Chapter 3

OBJECTIVE

• The AC input is given to transformer and the output of transformer is given


to rectifier block.

• After rectification its output is given to filter block and filter output to
regulator, where controlled dc output is obtained.

• This DC output is given to PIC18F4520, soil moisture, dc stepper Motor.

• The PIC18F4520 takes input from Moisture sensor

• The output of pic18f4520 is delivered to motor

• When the résistance level of soil is high or low microcontroller decides


motor will on or off to maintain moisture level
Chapter 4

4.1 SYSTEM OVERVIEW

SYSTEM ORGANIZATION:

1. IC PIC18F4520

This document contains device-specific information for the following


devices:
• PIC18F2420 • PIC18LF2420
• PIC18F2520 • PIC18LF2520
• PIC18F4420 • PIC18LF4420
• PIC18F4520 • PIC18LF4520
This family offers the advantages of all PIC18 microcontrollers – namely,
high computational performance at an economical price – with the addition
of high-endurance, Enhanced Flash program memory. On top of these
features, the PIC18F2420/2520/4420/4520 family introduces design
enhancements that make these microcontrollers a logical choice for many
High-performance, power sensitive applications.
Special Microcontroller Features:

• C Compiler Optimized Architecture:


- Optional extended instruction set designed to
optimize re-entrant code
• 100,000 Erase/Write Cycle Enhanced Flash
Program Memory Typical
• 1,000,000 Erase/Write Cycle Data EEPROM
Memory Typical
• Flash/Data EEPROM Retention: 100 Years Typical
• Self-Programmable under Software Control
• Priority Levels for Interrupts
• 8 x 8 Single-Cycle Hardware Multiplier
• Extended Watchdog Timer (WDT):
- Programmable period from 4 ms to 131s
• Single-Supply 5V In-Circuit Serial
Programming™ (ICSP™) via Two Pins
• In-Circuit Debug (ICD) via Two Pins
• Wide Operating Voltage Range: 2.0V to 5.5V
• Programmable Brown-out Reset (BOR) with
Software Enable Option

Power Management Features:


• Run: CPU on, Peripherals on
• Idle: CPU off, Peripherals on
• Sleep: CPU off, Peripherals off
• Ultra Low 50nA Input Leakage
• Run mode Currents Down to 11 μA Typical
• Idle mode Currents Down to 2.5 μA Typical
• Sleep mode Current Down to 100 nA Typical
• Timer1 Oscillator: 900 Na, 32 kHz, 2V
• Watchdog Timer: 1.4 μA, 2V Typical
• Two-Speed Oscillator Start-up

Flexible Oscillator Structure:


• Four Crystal modes, up to 40 MHz
• 4x Phase Lock Loop (PLL) – Available for Crystal
And Internal Oscillators
• Two External RC modes, up to 4 MHz
• Two External Clock modes, up to 40 MHz
• Internal Oscillator Block:
- Fast wake from Sleep and Idle, 1 μs typical
- 8 use-selectable frequencies, from 31 kHz to
8 MHz
- Provides a complete range of clock speeds
From 31 kHz to 32 MHz when used with PLL
- User-tunable to compensate for frequency drift
• Secondary Oscillator using Timer1 @ 32 kHz
• Fail-Safe Clock Monitor:
- Allows for safe shutdown if peripheral clock stops

Peripheral Highlights (Continued):


• Master Synchronous Serial Port (MSSP) module
Supporting 3-Wire SPI (all 4 modes) and I2C™
Master and Slave modes
• Enhanced Addressable USART module:
- Supports RS-485, RS-232 and LIN/J2602
- RS-232 operation using internal oscillator
Block (no external crystal required)
- Auto-wake-up on Start bit
- Auto-Baud Detect
• 10-Bit, up to 13-Channel Analog-to-Digital (A/D)
Converter module:
- Auto-acquisition capability
- Conversion available during Sleep
• Dual Analog Comparators with Input Multiplexing
• Programmable 16-Level High/Low-Voltage
Detection (HLVD) module:
- Supports interrupt on High/Low-Voltage Detection
2. Soil Moisture Sensor LM 393
1. Introduction
Soil moisture sensor measure the water content in soil. 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, but they are also 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 module uses LM393 comparator to compare the soil moisture level with the preset
threshold. When the soil moisture deficit module outputs a high level, and vice versa.
2. Features
 2 state binary output

 Adjustable sensitivity

3. Specifications
 Input operating voltage: 3.3 to 5V

4. Hardware Connection
The sensor have 3-Pin male header. The pins are as follows VCC (external 3.3V-5V)
GND (external GND) and DO-board digital output interface (0 and 1). The pin
explanation for each pin is shown below.
5. Pseudo Code

Boolean getSoilMoistureStatus (void)

// read DO pin status

If (gpioReadPin (DO) == 1)

Return true; // soil moisture level above threshold

Else

Return false; // soil moisture level below threshold

}
3. DC MOTOR

A DC motor is any of a class of electrical machines that converts direct current electrical
power into mechanical power. The most common types rely on the forces produced by magnetic
fields. Nearly all types of DC motors have some internal mechanism, either electromechanical or
electronic; to periodically change the direction of current flow in part of the motor. Most types
produce rotary motion; a linear motor directly produces force and motion in a straight line.

Features

 100RPM 12V DC motors with Gearbox


 6mm shaft diameter with internal hole
 125gm weight
 Same size motor available in various rpm
 1.2kgcm torque
 No-load current = 60 mA(Max), Load current = 300 mA(Max)
4. LIGHT EMITTING DIODE

An LED Strip Light (also known as an LED tape or ribbon light) is a flexible circuit
board populated by surface mounted light-emitting diodes (SMD LEDs) that usually comes with
an adhesive backing. Traditionally, strip lights had been used solely in accent lighting,
backlighting, task lighting, and decorative lighting applications. Recent developments in
increased luminous efficacy and longer lifespans have allowed LED strip lights to be used in
applications such as high brightness task lighting, fluorescent and halogen lighting fixture
replacements, indirect lighting applications, Ultra Violet inspection during manufacturing
processes, set and costume design, and even growing plants.

Design:

Variables in strip lighting consist of color, adhesives, and water resistance. Water resistant strip
lighting is covered in a heat conducting epoxy to protect the circuitry from direct contact with
water. The most common design differences are in how individual LEDs are controlled,
specifically differences in color and whether or not each LED is addressable.

 Single Color, non-addressable: Every LED on the strand is a single white color, typically
ranging from 2700K to 6500K in color temperature,[4] or any of several monochrome colors
covering the range of the visible spectrum (generally from 400-700 nanometers in
wavelength). A single chip address all of the LEDs in the strand at once so each setting is
applied to every LED
 Multicolor, non-addressable: LED's of different alternating fixed colors, usually red, green,
blue and amber, on a single address.
 RGB, non-addressable: Similar to the single color, non-addressable LED strand, RGB
strands have multiple colors available but the entire strand uses the same address so all LEDs
show the same color.
 RGB, Addressable: Multiple colors and addresses. Each LED has its own chip meaning they
can be individually triggered for chasing, strobing, and color changing.

All LED strip lights require a driver and typically operate on 12 or 24 volts of direct current from
the driver. USB strip lights operate on the standard 5-volt direct current used by USB devices.
Any customizations require an LED controller to adjust brightness, color, or individual LED
activity. This can be done with an included controller or customized with a microcontroller.

5. 7805 VOLTAGE REGULATOR

Voltage sources in a circuit may have fluctuations resulting in not providing fixed voltage
outputs. A voltage regulator IC maintains the output voltage at a constant value. 7805 IC, a
member of 78xx series of fixed linear voltage regulators used to maintain such fluctuations, is a
popular voltage regulator integrated circuit (IC). The xx in 78xx indicates the output voltage it
provides. 7805 IC provides +5 volts regulated power supply with provisions to add a heat sink.

7805 IC Rating

 Input voltage range 7V- 35V


 Current rating = 1A
 Output voltage range VMax=5.2V ,VMin=4.8V
 Pin Details of 7805 IC

Pin Pin Function Description


No.

1 INPUT Input voltage (7V-35V) In this pin of the IC positive


unregulated voltage is given in
regulation.

2 GROUND Ground (0V) In this pin where the ground is


given. This pin is neutral for
equally the input and output.

3 OUTPUT Regulated output; 5V (4.8V-5.2V) The output of the regulated 5V


volt is taken out at this pin of the
IC regulator.
7812 is a 12V Voltage Regulator that restricts the voltage output to 12V and draws 12V
regulated power supply. The 7812 is the most common, as its regulated 12-volt supply provides a
convenient power source for most TTL components.
7812 is a series of 78XX voltage regulators. For ICs within the family, the xx is replaced with
two digits, indicating the output voltage (for example, the 7805 has a 5-volt output, while the
7812 produces 12 volts).

Applications

 Circuits requiring steady 12v supply


 Protection for devices having specific voltage sensitivity
 DIY projects requiring specific voltage from an existing higher/ varying voltage supply

Features

 Fixed 12V voltage regulators


 Thermal overload protection
 Short circuit protection
 Output transition SOA protection
 Heat sink is required

Specifications
 Output Type: Fixed
 Output Voltage: +12V DC
 Current Output: up to 1.5A
 Input Voltage: 14.6 - 35VDC
 Quiescent (standby) current: 8mA
 Dropout Voltage (Max): 2V @ 1A
 Category: Linear Voltage Regulators - Standard
 Polarity: Positive
 Operating Temperature: 0 to +125°C
 Mounting Style: Through Hole
 Pin Spacing Pitch: 2.54mm
 Hole Diameter: 3.8mm
 Dimensions: 10.4 x 4.6 x 9.15mm

6. 1N4007 DIODE

A diode is a device which allows current flow through only one direction. That is the current
should always flow from the Anode to cathode. The cathode terminal can be identified by using
a grey bar as shown in the picture above.

For 1N4007 Diode, the maximum current carrying capacity is 1A it withstand peaks up to 30A.
Hence we can use this in circuits that are designed for less than 1A. The reverse current is 5uA
which is negligible. The power dissipation of this diode is 3W.
Pin Configuration:

Pin No. Pin Name Description

1 Anode Current always Enters through Anode

2 Cathode Current always Exits through Cathode

Features:

 Average forward current is 1A


 Non-repetitive Peak current is 30A
 Reverse current is 5uA.
 Peak repetitive Reverse voltage is 1000V
 Power dissipation 3W
 Available in DO-41 Package

Applications of Diode:

 Can be used to prevent reverse polarity problem


 Half Wave and Full Wave rectifiers
 Used as a protection device
 Current flow regulators
7. RESISTOR 1K

A resistor is a passive two-terminal electrical component that implements electrical resistance as


a circuit element. In electronic circuits, resistors are used to reduce current flow, adjust signal
levels, to divide voltages, bias active elements, and terminate transmission lines, among other
uses. High-power resistors that can dissipate many watts of electrical power as heat may be used
as part of motor controls, in power distribution systems, or as test loads for generators. Fixed
resistors have resistances that only change slightly with temperature, time or operating voltage.
Variable resistors can be used to adjust circuit elements (such as a volume control or a lamp
dimmer), or as sensing devices for heat, light, humidity, force, or chemical activity.

Resistors are common elements of electrical networks and electronic circuits and are ubiquitous
in electronic equipment. Practical resistors as discrete components can be composed of various
compounds and forms. Resistors are also implemented within integrated circuits.

The electrical function of a resistor is specified by its resistance: common commercial resistors
are manufactured over a range of more than nine orders of magnitude. The nominal value of the
resistance falls within the manufacturing tolerance, indicated on the component.

The ohm (symbol: Ω) is the SI unit of electrical resistance, named after Georg Simon Ohm. An
ohm is equivalent to a volt per ampere. Since resistors are specified and manufactured over a
very large range of values, the derived units of milliohm (1 mΩ = 10−3 Ω), kilohm (1 kΩ =
103 Ω), and megohm (1 MΩ = 106 Ω) are also in common usage.
8. CAPACITOR

An electrolytic capacitor (e-cap) is a polarized capacitor whose anode or positive plate is made
of a metal that forms an insulating oxide layer through iodization. This oxide layer acts as
the dielectric of the capacitor. A solid, liquid, or gel electrolyte covers the surface of this oxide
layer, serving as the (cathode) or negative plate of the capacitor. Due to their very thin dielectric
oxide layer and enlarged anode surface, electrolytic capacitors have a much higher capacitance-
voltage(CV) product per unit volume compared to ceramic capacitors or film capacitors, and so
can have large capacitance values. There are three families of electrolytic capacitor: aluminum
electrolytic capacitors, tantalum electrolytic capacitors, and niobium electrolytic capacitors.

Electrolytic capacitors are polarized components due to their asymmetrical construction, and
must be operated with a higher voltage (i.e., more positive) on the anode than on the cathode at
all times. For this reason the anode terminal is marked with a plus sign and the cathode with a
minus sign. In addition they can only tolerate low applied voltages. Applying a reverse polarity
voltage or a voltage exceeding the maximum rated working voltage of as little as 1 or 1.5 volts
can destroy the dielectric and thus the capacitor. The failure of electrolytic capacitors can be
hazardous, resulting in an explosion or fire. Bipolar electrolytic (aka non-polarized) capacitors
which may be operated with either polarity are special constructions with two anodes connected
in series.

9. SWITCH

A push-button (also spelled pushbutton) or simply button is a simple switch mechanism for
controlling some aspect of a machine or a process. Buttons are typically made out of hard
material, usually plastic or metal.[1] The surface is usually flat or shaped to accommodate the
human finger or hand, so as to be easily depressed or pushed. Buttons are most often biased
switches, although many un-biased buttons (due to their physical nature) still require a spring to
return to their un-pushed state. Terms for the "pushing" of a button
include pressing, depressing, mashing, hitting, and punching.

Switching Mechanism
There are several pole and throw configurations for pushbutton switches. The number of switch
contact sets used is known as the number of poles and the number of conducting positions (single
or double) is referred to as the throw. Switching mechanisms function differently by type; the
five types of switches are described below:

Single pole single throw (SPST) is a switch that makes or breaks the connection of a single
conductor in a single branch circuit. This switch typically has two terminals. It is commonly
referred to as simple on-off switch and can be used to switch the power supply to a circuit.
On-Off switch circuit symbol.
SPST switches can also work as "push-to-make" on, where when the button is released it returns
to its normally open (off) position or vice-versa.

(On)-Off switch circuit symbol

Single pole double throw (SPDT) is a switch that makes or breaks the connection of a single
conductor with either of two other single conductors. This switch typically has 3 terminals, and
is commonly used in pairs and called a "Three-Way" switch. The switch can be in both on/off
positions, switching on a separate device in each case. For example, a SPDT switch can be used
to switch on a red lamp in one position and a green lamp in another position. Special versions
can have a third switch position which turns both circuits off.

On-On switch circuit


Double pole single throw (DPST) is a switch that makes or breaks the connection of two circuit
conductors in a single branch circuit. This switch typically has four terminals. The pair of on-off
switches operates together and it is often used to switch the main electricity because it can isolate
both the live and neutral connections.
On-Off switch circuit
Double pole double throw (DPDT) is a switch that makes or breaks the connection of two
conductors to two separate circuits. This switch typically has six terminals and is available in
both momentary and maintained contact versions. It can be wired up as a reversing switch for a
motor and special versions can include a centre off position.

10. POWER SUPPLY:

When working with electronics, you always need one basic thing: Power. In every
electronic circuit power supply is required. The proper working of each and every component,
the exact amount of voltage and current to be supplied to it. If the power exceeds its limit, it can
be fatal. Below is the circuit diagram of power supply which gives output of 5V, as only that
much is required for microcontroller. Its circuit diagram and designing calculation are given
below.

Fig.3.18 +5 V Regulated Power Supply

The +5 volt power supply is based on the commercial 7805 voltage regulator IC. This IC
contains all the circuitry needed to accept any input voltage from 8 to 18 volts and produce a
steady +5 volt output, accurate to within 5% (0.25 volt). It also contains current-limiting circuitry
and thermal overload protection, so that the IC won't be damaged in case of excessive load
current; it will reduce its output voltage instead. The advantage of a bridge rectifier is you don’t
need a Centre tap on the secondary of the transformer. A further but significant advantage is that
the ripple frequency at the output is twice the line frequency (i.e. 50Hz) and makes filtering
somewhat easier. The use of capacitor c1, c2, c3 and c4 is to make signal ripple free. The two
capacitor used before the regulator is to make ac signal ripple free and then later which we are
using is for safety, if incase there is a ripple left after regulating, then c3 and c4 will remove it.

Power Supply Component Design:

 Transformer Design:

- We require 5V at the o/p of the regulator.


- The drop out voltage of the regulator is 2V As per the data sheet)
- Vdc = 5+2 = 7V
- So at the regulator input, the voltage applied should be of 7V.
- According to the formula,
- Vdc = 2Vm/Pi
- Assuming there is no ripple Capacitor from
- Vm= Vdc .pi/2
- =7 x 3.14)/2
- =10.99V
- Vm= 10.99V
- During one cycle, two diodes are conducting.
- Drop out voltage of one diode = 0.7V
- Drop out voltage of two diode = 1.4V
- Vim = Vm+ 1.4V
- =10.99+1.4= 12.39V
- Vim=12.39V
- Vrms = Vim/sqrt(2)
- = 12.39/sqrt(2)
- = 8.76V
- Vrms = 8.76V
- So we select transformer of 9V.
- Similarly
- Im=Idc x pi/2
- Im=400m x 3.14/2
- = 628mA.
- Irms= Im/sqrt(2)
- = 628mA/sqrt(2)
- ` = 444.06mA
- Irms = 444.06mA
- So we select the transformer of current rating 500mA.
- Considering the above transformer rating.
- We take the transformer of 0-9V/500mA
- TRANSFORMER –
- 0-9V/500mA Step-down transformer.
- 8.2.2 Rectifier Design:
- PIV of diode = Vm = 12.39V
- Im= 628mA
11. Transformers.

Step down transformer is one whose secondary voltage is less than its primary voltage. It is
designed to reduce the voltage from the primary winding to the secondary winding. This kind of
transformer “steps down” the voltage applied to it. As a step-down unit, the transformer converts
high-voltage, low-current power into low-voltage, high-current power.

Step down transformers are made from two or more coils of insulated wire wound around a core
made of iron. When voltage is applied to one coil (frequently called the primary or input) it
magnetizes the iron core, which induces a voltage in the other coil. The turn’s ratio of the two
sets of windings determines the amount of voltage transformation.

A Transformer consists of at least two sets of windings wound on a single magnetic core There
are two main purposes for using transformer s. the first is to convert the energy on the primary
side to a different voltage level on the secondary side. This is accomplished by using different
turn’s counts on primary and secondary windings. The voltage ratio is the same as the turn’s
ratio.

Fig 5.8.3: Step down Transformer


12. Rectifier

Rectifier is an electronic circuit consisting of diodes which carries out the rectification process.
Rectification is the process of converting an alternating voltage or current into corresponding
direct (dc) quantity. The input to a rectifier is ac whereas its output is unidirectional pulsating dc.
Usually a full wave rectifier or a bridge rectifier is used to rectify both the half cycles of the ac
supply (full wave rectification).
A bridge rectifier consists of four p-n junction diodes connected in the above shown manner. In
the positive half cycle of the supply the voltage induced across the secondary of the electrical
transformer. Therefore point E is positive with respect to F. Hence, diodes D3 and D2 are
reversed biased and diodes D1 and D4 are forward biased. The diode D3 and D2 will act as open
switches (practically there is some voltage drop) and diodes D1 andD4 will act as closed switches
and will start conducting. Hence a rectified waveform appears at the output of the rectifier as
shown in the first figure. When voltage induced in secondary i.e. VMN is negative than D 3 and
D2 are forward biased with the other two reversed biased and a positive voltage appears at the
input of the filter.

Fig 5.8.4: Bridge Rectifier


13. Transistor
14. Relay

Relay Pin Configuration

Pin
Pin Name Description
Number

Used to trigger(On/Off) the Relay, Normally one


1 Coil End 1
end is connected to 5V and the other end to ground

Used to trigger(On/Off) the Relay, Normally one


2 Coil End 2
end is connected to 5V and the other end to ground

Common is connected to one End of the Load that


3 Common (COM)
is to be controlled

The other end of the load is either connected to NO


4 Normally Close (NC) or NC. If connected to NC the load remains
connected before trigger
The other end of the load is either connected to NO
5 Normally Open (NO) or NC. If connected to NO the load remains
disconnected before trigger
Features of 5-Pin 5V Relay

 Trigger Voltage (Voltage across coil) : 5V DC


 Trigger Current (Nominal current) : 70mA
 Maximum AC load current: 10A @ 250/125V AC
 Maximum DC load current: 10A @ 30/28V DC
 Compact 5-pin configuration with plastic molding
 Operating time: 10msec Release time: 5msec
 Maximum switching: 300 operating/minute (mechanically)

Equivalent Relays

3V Relay, 12V Relay, 1-channel Relay module, 4-channel Relay Module.

How to use a Relay


Relays are most commonly used switching device in electronics. Let us learn how to use one in
our circuits based on the requirement of our project.

Before we proceed with the circuit to drive the relay we have to consider two important
parameter of the relay. Once is the Trigger Voltage, this is the voltage required to turn on the
relay that is to change the contact from Common->NC to Common->NO. Our relay here has 5V
trigger voltage, but you can also find relays of values 3V, 6V and even 12V so select one based
on the available voltage in your project. The other parameter is your Load Voltage & Current,
this is the amount of voltage or current that the NC, NO or Common terminal of the relay could
withstand, in our case for DC it is maximum of 30V and 10A. Make sure the load you are using
falls into this range.
The above circuit shows a bare-minimum concept for a relay to operate. Since the relay has 5V
trigger voltage we have used a +5V DC supply to one end of the coil and the other end to ground
through a switch. This switch can be anything from a small transistor to a microcontroller or a
microprocessor which can perform switching operating. You can also notice a diode connected
across the coil of the relay, this diode is called the Fly back Diode. The purpose of the diode is
to protect the switch from high voltage spike that can produced by the relay coil. As shown one
end of the load can be connected to the Common pin and the other end is either connected to NO
or NC. If connected to NO the load remains disconnected before trigger and if connected to NC
the load remains connected before trigger.

Applications of Relay

 Commonly used in used in switching circuits.


 For Home Automation projects to switch AC loads
 To Control (On/Off) Heavy loads at a pre-determined time/condition
 Used in safety circuits to disconnect the load from supply in event of failure
 Used in Automobiles electronics for controlling indicators glass motors etc.
15. LCD

A general purpose alphanumeric LCD, with two lines of 16 characters.

LCD used here is the 16×2 line LCD. Liquid Crystal Display which is commonly
known as LCD is an Alphanumeric Display it means that it can display Alphabets, Numbers
as well as special symbols thus LCD is a user friendly Display device which can be used for
displaying various messages unlike seven segment display which can display only numbers
and some of the alphabets. The only disadvantage of LCD over seven segment is that seven
segment is robust display and be visualized from a longer distance as compared to LCD.
Here we have used 16 x 2 Alphanumeric Display which means on this display. We can
display two lines with maximum of 16 characters in one line.

Function of each pin is given in the table:

Fig 3.6 16 × 2 LCD


Pin Symbol I/O Description

1 GND - Ground

2 Vcc - +5V power supply

3 Vee - Contrast control

4 RS I command/data register selection

5 R/W I write/read selection

6 E I/O Enable

7 DB0 I/O The 8-bit data bus

8 DB1 I/O The 8-bit data bus

9 DB2 I/O The 8-bit data bus

10 DB3 I/O The 8-bit data bus

11 DB4 I/O The 8-bit data bus

12 DB5 I/O The 8-bit data bus

13 DB6 I/O The 8-bit data bus

14 DB7 I/O The 8-bit data bus

Table 3.13 Pin Description of LCD


LCD Commands:
The LCD’s internal controller accepts several commands and modifies the display accordingly.
These commands would be things like:
– Clear screen –
Return home
– Shift display right/left

Entry mode set:

This command sets cursor move direction and display shift ON/OFF. There are 4
possible function set commands; 04, 05, 06, and 07. This command changes the direction the
cursor moves by setting the address counter to increment or decrement. This command is very
important. If you do not understand it you may not see anything or what you actually wanted to
see on LCD screen.

LCD Display PINOUT and Description:

Fig 3.7 LCD pin diagram

Data pins D7:D0: Pins 7-14:

Bi-directional data/command pins. Alphanumeric characters are sent in ASCII format. As shown
in figure lcd1.0, there are 8 pins, Pin No.7-14 used for data lines.
RS: Register Select: Pin No.4:
RS = 0; Command Register is selected
RS = 1; Data Register is selected
R/W: Read or Write: Pin No.5:

R/W=0; Write.

R/W= 1; Read

E: Enable (Latch data): Pin No.6:

Used to latch the data present on the data pins.


A high-to-low edge is needed to latch the data.
VO: contrast control: Pin No.2:

NOTE: When writing to the display, data is transferred only on the high to low
transition of this signal. However, when reading from the display, data will become available
shortly after the low to high transition and remain available until the signal falls low again.

The standard LCD Display requires 3 control lines as well as either 8 I/O lines for
the data bus. The three control lines are EN, RS, and RW. Note that the EN line must be
raised/lowered before/after each instruction sent to the LCD regardless of whether that
instruction is read or write text or instruction. In short, you must always manipulate EN when
communicating with the LCD. EN is the LCD's way of knowing that you are talking to it. If you
don't raise/lower EN, the LCD doesn't know you're talking to it on the other lines.

Specifications:

 5 x 8 dots with cursor


 Built-in controller (KS 0066 or Equivalent
 + 5V power supply (Also available for + 3V)
 1/16 duty cycle
 B/L to be driven by pin 1, pin 2 or pin 15, pin 16 or A.K (LED)
 N.V. optional for + 3V power supply.
16. BLOCK DIAGRAM
17. CIRCUIT DIAGRAM:
18. CODE

#include <p18f4520.h>
#include <delays.h>
#include <string.h>
#include <stdio.h>
#include <timers.h>
#include "lcd.h"
#include "serial.h"
#include "adc.h"
#include "config.h"

#define rly PORTDbits.RD1


unsigned char buff[16],buff1[16];
unsigned char start_str1[]="Agricultural ";
unsigned char start_str2[]="Monitoring";

void lm35();
unsigned int sm;
void main()
{
CMCON=0x07;
ADCON1=0x0f;
lcd_init();
adc_init();
TRISDbits.TRISD1=0;
rly=0;
serial_init();
lcd_clr_line(1);
lcd_clr_line(2);
lcd_string(start_str1,1);
lcd_string(start_str2,2);
Delay10KTCYx(500);
while(1)
{
lm35();
Delay10KTCYx(200);
if(sm<30)
{
sprintf(buff1,"Moisture Low");
rly=1;
}
else if(sm>40)
{
sprintf(buff1,"Moisture OK");
rly=0;
}
lcd_clr_line(2);
lcd_string(buff1,2);
}
}

void lm35()
{
sm = adc_scan(0);
sm=1023-sm;
sm/=10;
if(sm>=100)
sm=100;
sprintf(buff,"SM: %d",sm);
lcd_clr_line(1);
lcd_string(buff,1);
Delay10KTCYx(1000);
}
Chapter 5

DESIGNING OF PCB:
The connections on the PCB should be identical to the circuit diagram, but while the
circuit diagram is arranged to be readable, the PCB layout is arranged to be functional, so there is
rarely any visible correlation between the circuit diagram and the layout.

PCB layout can be performed manually (using CAD) or in combination with an Auto router.
The best results are usually still achieved using at least some manual routing - simply because
the design engineer has a far better judgment of how to arrange circuitry. Surprisingly, many
auto routed boards are often completely illogical in their track routing - the program has
optimized the connections, and sacrificed any small amount of order that may have been put in
place by manual routing. Generally auto routed boards are somewhat harder for a technician to
repair or debug, for this reason. Historically, PCBs used to be laid out by drawing or using stick
on paper shapes on Mylar film, - that really WAS manual routing!

The printed circuit board manufacturing process is a difficult and complex series of operations
to make a printed circuit board. The process starts once our files and specifications have been
decided.

Most of our Etched PCB laminates are:

Double sided Laminate

Two layers of copper tracks, one each side of the board in progressively smaller
Quantities 4 Layer, 6 Layer, and 8 Layer

Plated Through Hole

PTH - each hole is copper plated providing a circuit between sides of the PCB. Normally
we also Tent the visa - cover them with solder mask.

Solder Mask over Bare Copper

SMOBC - green insulating ink everywhere except connections


Component legend

Identifying lettering, component outlines and values in white ink

Immersion Silver

For ROHS compliant work Silver plate on all exposed copper, prevents
Oxidation and so keeps the surface solder able. An alternative is electro less gold.

Tinned

For non-ROHS work Tinning is application of Lead-Tim Solder to all


Exposed copper, increasing solder ability

Hot oil leveled

Hot oil - or hot air - leveling makes the tinning flat, so that surface mount components
can be positioned reliably.

Different methods of PCB construction:

Conventional

A rigid PCB (usually of thickness 1.6mm), with wire-leaded components mounted on


only one side of the PCB, with all the leads through holes, soldered and clipped.
Conventional circuitry is generally easier to debug and repair than Surface mount.

Surface Mount Technology (SMT) or devices (SMD)

A PCB with tag-leaded components soldered flush to PCB


pads. Holes are still needed on the PCB, but not where the
component leads are attached. Surface mount circuitry is
generally smaller than conventional. Surface mount is
generally more suited to automated assembly than
conventional.
Fig 8.1 PCB
Surface mount & conventional mix

In practice, most boards are a mix of surface mount and conventional components. This
can have its disadvantages as the two technologies require different methods of insertion
and soldering.

Double sided Laminate

A bare PCB laminate having tracks on both sides, normally with PTH holes connecting
circuitry on the two sides together.

Double sided Component Assembly

Mounting components on both sides of the PCB. Normally only surface mount circuitry
would be mounted on both sides of a PCB, but some conventional components (such as
LEDs) may be mounted on the reverse of a PCB to suit the enclosure design.

Multi-layer

A PCB Laminate may be manufactured with more than two layers of copper tracks by
using a sandwich construction. The cost of the laminate reflects the number of layers. The
extra layers may be used to route more complicated circuitry,
and/or distribute the power supply more effectively.

Gold plated

Certain areas on a PCB may be gold plated for use as contact pads
or as a ROHS-compliant board finish. Normally only thin gold
plating is required, and this can be achieved with electro less gold. If a thicker gold
plating is required (for instance a quality 50um contact) an electrolytic process is needed.
Normally this is limited to pads on the edge of a PCB, as an electrolytic plating bar
Fig 8 Gold plated PCB
Must be attached to the pads, and then removed part way through the PCB manufacturing
process. Gold plating normally needs a nickel under plate or the Gold quickly disappears
through migration effects into the underlying copper.

Immersion Silver plating

A ROHS-compliant board finish that is a cost effective alternative to Gold

ROHS Compliance

Simple definition: Getting rid of the Lead in PCBs and components which poisons
groundwater when it leaches out of discarded boards put in landfill waste dumps.
Actually, lead is not the only substance covered, but it is the main one. Frankly it would
also help if people stopped throwing away so much electronics, and that would be helped
if boards were made to last.

Flexible PCB

A technique used extensively with membrane keyboards, combination connector/circuit


boards, and circuit boards to fit in awkward shapes - e.g. cameras.

Chip On Board (COB)

Where the IC die is attached direct to a PCB and bond out wires from the IC connect
directly to PCB lands. The chip is then covered with a black blob of epoxy. A technique
used mostly with very high volume, cost sensitive applications, e.g. musical greeting
cards.

Phenolic PCB

As distinct from Fiberglass, Phenolic is a cheaper PCB laminate material.


Daughterboard

A circuit board mounted to another circuit board - such as a plug in card.

Patterning/etching
The majority of printed circuit boards are manufactured by applying a layer of copper over
the entire surface of the circuit board substrate either on one side or both sides. This creates what
is referred to as a blank printed circuit board, meaning the copper is everywhere on the surface.
From here the unwanted areas are removed, this is called a subtractive method, the most
common subtractive method is known as photoengraving.

Photoengraving
The photoengraving process uses a mask or photo mask combined with chemical etching to
subtract the copper areas from the circuit board substrate. The photo mask is created with a photo
plotter which design from a CAD PCB software program. Lower resolution photo masks are
sometimes created with the use of a laser printer using a transparency.

Lamination
Many printed circuit boards are made up of multiple layers; these are referred to as multi-
layer printed circuit boards. They consist of several thin etched boards or trace layers and are
bonded together through the process of lamination.

Drilling
Each layer of the printed circuit board requires the ability of one layer to connect to another;
this is achieved through drilling small holes called “VIAS”. These drilled holes require precision
placement and are most commonly done with use of an automated drilling machine. These
machines are driven by computer programs and files called numerically controlled drill or
(NCD) files also referred to as excellent files. These files determine the position and size of each
file in the design.
Some files require very small visa to be drilled which results in heavy wear and tear of the
drill bit itself. Drilling through different substrates may require the drill bit to be made of
tungsten carbide and are costlier than other materials but required to provide a proper hole.

Solder plating/solder resist


Pads and lands which will require components to be mounted on are plated to allow solder
ability of the components. Bare copper is not readily solder able and requires the surface to be
plated with a material that facilitates soldering. In the past a lead based tin was used to plate the
surfaces, but with Rosh compliance enacted newer materials are being used such as nickel and
gold to both offer solder ability and comply with Rosh standards.

Testing

Unpopulated circuit boards are subjected to a bare board test where each test circuit
connection (as defined in a net list) is verified as correct on the finished circuit board. In high
volume circuit board production, a bed of nails tester or fixture is used to make contact with the
copper lands or holes on one or both sides of the board to facilitate testing. Computers are used
to control their electrical testing unit to send a small current through each contact point on the
bed of nails and verify that such current can be detected on the appropriate contact points.

For small to medium volume production runs, a flying probe tester is used to check
electrical contacts. These flying probes employ moving heads to make contact with the copper
lands and holes to validate the electrical connectivity of the board being tested.

Debugging and testing

Check over your work for proper assembly and short circuits. Make sure that each IC is
correctly oriented and in its proper place. Check each resistor and make sure the resistor values
are in the proper location as well.

Use an oscilloscope to look at the signal at the collector of Q2. You should see a pulse train
with peak-to-peak amplitude of approximately 8 volts. The positive-going pulses should be
approximately 300-milliseconds wide and should be separated by approximately 1500-
millisecond spaces.

If you don’t have an oscilloscope, connect the ground lead of an analog (non digital)
voltmeter to the negative terminal of the battery. Set the voltmeter for 10 volts or higher.
Connect the positive lead of the voltmeter to the collector of Q2. The meter reading should
repeatedly pulse from about 1 to about 9 volts.

Next, turn on an FM receiver and set it to a clear (unused) frequency between 88 and 108
MHz using a non-conductive alignment tool adjust C7 and C6 until you hear the transmitter on
the receiver. You may have to squeeze or spread L2 to insure that the tracking transmitter tunes
from the low end to the high end of the band.

Mechanical design

After making the PCB layout, holes were made according to the components by using 0.8mm
drill. After that the components were mounted on the PCB board then using the soldering iron
and aluminum wire of 20 gauge necessary connections were done on the board necessary
checking regarding the connection were made i.e. it was checked that no two points wire
unnecessarily short. Using the millimeter the connection was checked.

Later on completing the necessary connections the circuit was mounted on the wooden case.
The design of wooden case provides safety to the component and let it look better. It makes it
easily to handle.
Chapter 6

RESULT

It can be seen from the results obtained that the system responded linearly with respect to the
degree of dryness for the three soil types. There is a linear relationship between the degree of soil
dryness and the time taken to irrigate the soil. At 50% dryness, irrigation durations were 2.0, 2.0
and 2.5 seconds for sandy, loamy and clayey soils respectively. While at 70% dryness, irrigation
durations increased to 3.0, 7.5 and 8.0 seconds for sandy, loamy and clayey soils respectively. It
is seen that irrigation in loamy soil generally took longer in loamy soil than in sandy soil, and
clayey soil irrigation took longest.
Chapter 7

CONCLUSION & FUTURE WORK

AND REFERENCE

CONCLUSION

Automatic irrigation control system has been designed and constructed. The prototype of the
system worked according to specification and quite satisfactorily. The system components are
readily available, relatively affordable and they operate quite reliably. The system helps to
eliminate the stress of manual irrigation and irrigation control while at the same time conserving
the available water supply. Improving Irrigation efficiency can contribute greatly to reducing
production costs of agricultural products, thereby making the industry to be more competitive
and sustainable. The system was tested on three types of soil and from the result analysis sandy
soils require less water than loamy soils and clay soils require the most water for irrigation. For
future work on this project, we recommend that for a large scale implementation a more
powerful water pump can be used. Also a microcontroller should be used to accommodate more
than one sensor input and also control different irrigation regimes independently.

FUTURE WORK

Our project can be improvised by adding a Webs caper which can predict the weather and water
the plants/crops accordingly. If rain is forecasted, less water is let out for the plants. Also, a GSM
module can be included so that the user can control the system via smart phone. A water meter
can be installed to estimate the amount of water used for irrigation and thus giving cost
estimation. A solenoid valve can be used for varying the volume of water flow. Furthermore,
Wireless sensors can also be used.

REFERENCE

1] Rafael Muñoz-Carlene and Michael D. Dukes, Automatic Irrigation Based on Soil Moisture
for Vegetable Crops, IFAS Extension, 2005. [2] K.N.Manjula B.Swathi and D.Sree Sandhya,
Intelligent Automatic Plant Irrigation System. [3] G. Vellidis , M. Tucker, C. Perry, C. Kevin, C.
Bednorz, “A Real-Time Wireless Smart Sensor Array for Scheduling Irrigation”, National
Environmentally Sound Production Agriculture Laboratory (NESPAL), 2007. [4] Constantine’s
Mario’s Angelopoulos, Sotiris Nikoletseas , Georgios Constantinos Theofanopoulos, A Smart
System for Garden Watering using Wireless Sensor Networks, Mobic ,October 31–November 4,
2011.
[5] R.suresh, S.Gopinath, K.Govindaraju, T.Devika, N.Suthanthira Vanitha, GSM based
Automated Irrigation Control using Raingun Irrigation System, International Journal of
Advanced Research in Computer and Communication Engineering ,Vol. 3, Issue 2, February
2014.
BILL OF MATERIAL:

COMPONENTS QUANTITY COST

Power supply with transformer 1 300

LCD 1 120

PIC18F 1 150

Soil moisture 1 250

Crystal 1 15

Dc motor 1 110

Relay 1 20

Transistor 1 25

PCB film 1 200

PCB board 1 200

Resistors 5 3

Switch 1 2

LED 2 4

Das könnte Ihnen auch gefallen