Академический Документы
Профессиональный Документы
Культура Документы
ENVIRONMENT
A PROJECT REPORT
Submitted in partial fulfillment of the requirements for the award of the degree of
DIPLOMA
IN
(15352-EE-054)
I hereby express our sincere gratitude to our incharge Mr. M PRAVEEN M.Tech, who has
rendered his constant encouragement and valuable suggestions in making my project report successful.
We are also thankful to Mrs. D Hema M.Tech, (PhD) Head of Electrical and Electronics
Engineering Department for her constant encouragement and valuable support throughout the course
of our project.
We are glad to express our deep sense of gratitude to Mr. J Srikanth B.Tech Assistant
Lecturer, our guide for his guidance and co-operation in completing this project report.
We thank one and all who have rendered help to us directly or indirectly in the completion of
this project report.
Project Associates.....
SUSHMA (15352-EE-047)
SRILAKSHMI (15352-EE-046)
SRIKANTH (14352-EE-051)
MONITOR AND CONTROL OF GREEN
HOUSE ENVIRONMENT
Contents
ABSTRACT...........................................................................................................................1
CURRENT SCENARIO...........................................................................................................2
MANUAL SET-UP:..........................................................................................................................2
PARTIALLY AUTOMATED SET-UP.....................................................................................................2
FULLY- AUTOMATED:.....................................................................................................................2
PROPOSED MODEL FOR AUTOMATION OF GREENHOUSE..............................................................2
SYSTEM MODEL..................................................................................................................4
PARTS OF THE SYSTEM:.................................................................................................................6
TRANSDUCERS (Data acquisition system):......................................................................................................6
ANALOG TO DIGITAL CONVERDER (ADC):........................................................................................................7
MICROCONTROLLER:........................................................................................................................................7
ACTUATORS:.....................................................................................................................................................7
DISPLAY UNIT:...................................................................................................................................................7
HARDWARE DESCRIPTION...................................................................................................9
TRANSDUCERS:............................................................................................................................10
SOIL MOISTURE SENSOR.............................................................................................................10
LIGHT SENSOR.............................................................................................................................12
HUMIDITY SENSOR......................................................................................................................15
TEMPERATURE SENSOR...............................................................................................................18
MICROCONTROLLER 89C52...............................................................................................20
FEATURES:....................................................................................................................................20
PIN DIAGRAM AND ITS DESCRIPTION:.........................................................................................20
THE ON-CHIP OSCILLATORS (CRYSTAL OSCILLATOR)......................................................................25
Program Memory Lock Bits:.........................................................................................................26
Program Counter and Data Pointer:.............................................................................................26
A & B Registers:...........................................................................................................................26
Flags and the Program Status Word (PSW):..................................................................................27
MEMORY ORGANISATION............................................................................................................27
Internal Memory:...........................................................................................................................................27
Internal RAM:.................................................................................................................................................27
RELAYS..............................................................................................................................36
POWER SUPPLY:................................................................................................................39
BLOCK DIAGRAM:........................................................................................................................39
FLOWCHART......................................................................................................................47
FLOWCHART REPRESENTING THE WORKING OF THE SYSTEM:....................................................48
SOFTWARE DESCRIPTION..................................................................................................53
IN-SYSTEM PROGRAMMING:.......................................................................................................54
Programming the Flash – Parallel Mode:.......................................................................................................54
Programming the Flash – Serial Mode:..........................................................................................................55
Power-up sequence:....................................................................................................................55
RESULT ANALYSIS..............................................................................................................56
SOIL MOISTURE SENSOR.............................................................................................................57
LIGHT SENSOR.............................................................................................................................58
HUMIDITY SENSOR......................................................................................................................58
TEMPERATURE SENSOR...............................................................................................................59
ABSTRACT
Appropriate environmental conditions are necessary for optimum plant growth,
improved crop yields, and efficient use of water and other resources. Automating the data
acquisition process of the soil conditions and various climatic parameters that govern plant
growth allows information to be collected at high frequency with less labor requirements. The
existing systems employ PC or SMS-based systems for keeping the user continuously informed
of the conditions inside the greenhouse; but are unaffordable, bulky, difficult to maintain and
less accepted by the technologically unskilled workers.
CURRENT SCENARIO
Greenhouses in India are being deployed in the high-altitude regions where the sub- zero
temperature up to -40° C makes any kind of plantation almost impossible and in arid regions
where conditions for plant growth are hostile. The existing set-ups primarily are:
MANUAL SET-UP:
This set-up involves visual inspection of the plant growth, manual irrigation of plants,
turning ON and OFF the temperature controllers, manual spraying of the fertilizers and
pesticides. It is time consuming, vulnerable to human error and hence less accurate and
unreliable.
FULLY- AUTOMATED:
This is a sophisticated set-up which is well equipped to react to most of the climatic
changes occurring inside the greenhouse. It works on a feedback system which helps it to
respond to the external stimuli efficiently. Although this set-up overcomes the problems
caused due to human errors it is not completely automated and expensive.
When any of the above mentioned climatic parameters cross a safety threshold which
has to be maintained to protect the crops, the sensors sense the change and the
microcontroller reads this from the data at its input ports after being converted to a digital
form by the ADC. The microcontroller then performs the needed actions by employing relays
until the strayed-out parameter has been brought back to its optimum level. Since a
microcontroller is used as the heart of the system, it makes the set-up low-cost and effective
nevertheless. As the system also employs an LCD display for continuously alerting the user
about the condition inside the greenhouse, the entire set-up becomes user friendly.
Thus, this system eliminates the drawbacks of the existing set-ups mentioned in the
previous section and is designed as an easy to maintain, flexible and low cost solution.
SYSTEM MODEL
• Microcontroller (AT89C52)
• Actuators – Relays
• Devices controlled
Water Pump
Sprayer (simulated as a socket)
Cooler (simulated as a fan)
Artificial Lights (simulated as a bulb)
• Buzzer
This part of the system consists of various sensors, namely soil moisture, humidity,
temperature and light. These sensors sense various parameters- temperature, humidity, soil
moisture and light intensity and are then sent to the Analog to Digital Converter.
The analog parameters measured by the sensors are then converted to corresponding
digital values by the ADC.
MICROCONTROLLER:
ACTUATORS:
An array of actuators can be used in the system such as relays, contactors, and change
over switches etc. They are used to turn on AC devices such as motors, coolers, pumps,
fogging machines, sprayers. For the purpose of demonstration relays have been used to drive
AC bulbs to simulate actuators and AC devices. A complete working system can be realized
by simply replacing these simulation devices by the actual devices.
DISPLAY UNIT:
A Liquid crystal display is used to indicate the present status of parameters and the
respective AC devises (simulated using bulbs). The information is displayed in two modes
which can be selected using a push button switch which toggles between the modes. Any
display can be interfaced to the system with respective changes in driver circuitry and code.
Three general steps can be followed to appropriately select the control system:
• It is very important to correctly identify the parameters that are going to be measured
by the controller’s data acquisition interface, and how they are to be measured. The
set of variables typically used in greenhouse control is shown below:
An electronic sensor for measuring a variable must readily available, accurate, reliable
and low in cost. If a sensor is not available, the variable cannot be incorporated into the
control system, even if it is very important. Many times variables that cannot be directly or
continuously measured can be controlled in a limited way by the system. For example,
fertility levels in nutrient solutions for greenhouse production are difficult to measure
continuously.
HARDWARE DESCRIPTION
HARDWARE DESCRIPTION
TRANSDUCERS:
A transducer is a device which measures a physical quantity and converts it into a
signal which can be read by an observer or by an instrument. Monitoring and controlling of a
greenhouse environment involves sensing the changes occurring inside it which can
influence the rate of growth in plants. The parameters which are of importance are the
temperature inside the greenhouse which affect the photosynthetic and transpiration
processes are humidity, moisture content in the soil, the illumination etc. Since all these
parameters are interlinked, a closed loop (feedback) control system is employed in
monitoring it. The sensors used in this system are:
3. Humidity Sensor
4. Temperature Sensor
1. The circuit designed uses a 5V supply, fixed resistance of 100Ω, variable resistance
of 10ΚΩ, two copper leads as the sensor probes, 2N222N transistor.
2. It gives a voltage output corresponding to the conductivity of the soil.
3. The conductivity of soil depends upon the amount of moisture present in it. It
increases with increase in the water content of the soil.
4. The voltage output is taken at the transmitter which is connected to a variable
resistance. This variable resistance is used to adjust the sensitivity of the sensor.
The two copper leads act as the sensor probes. They are immersed into the specimen soil
whose moisture content is under test. The soil is examined under three conditions:
Case#1: Dry condition- The probes are placed in the soil under dry conditions and are
inserted up to a fair depth of the soil. As there is no conduction path between the two copper
leads the sensor circuit remains open. The voltage output of the emitter in this case ranges
from 0 to 0.5V.
Case#2: Optimum condition- When water is added to the soil, it percolates through the
successive layers of it and spreads across the layers of soil due to capillary force. This water
increases the moisture content of the soil. This leads to an increase in its conductivity which
forms a conductive path between the two sensor probes leading to a close path for the current
flowing from the supply to the transistor through the sensor probes. The voltage output of the
circuit taken at the emitter of the transistor in the optimum case ranges from 1.9 to 3.4V
approximately.
Case#3: Excess water condition- With the increase in water content beyond the optimum
level, the conductivity of the soil increases drastically and a steady conduction path is
established between the two sensor leads and the voltage output from the sensor increases no
further beyond a certain limit. The maximum possible value for it is not more than 4.2V.
• The Light Dependent Resistor (LDR) is made using the semiconductor Cadmium
Sulphide (CdS).
• The light falling on the brown zigzag lines on the sensor causes the resistance of
the device to fall. This is known as a negative co-efficient. There are some LDRs that
work in the opposite way i.e. their resistance increases with light (called positive co-
efficient).
• The resistance of the LDR decreases as the intensity of the light falling on it increases.
Incident photons drive electrons from the valence band into the conduction band.
• An LDR and a normal resistor are wired in series across a voltage, as shown in the
circuit below. Depending on which is tied to the 5V and which to 0V, the voltage at
the point between them, call it the sensor node, will either rise or fall with increasing
light. If the LDR is the component tied directly to the 5V, the sensor node will
increase in voltage with increasing light
• The LDR's resistance can reach 10 k ohms in dark conditions and about 100 ohms in
full brightness.
• The circuit used for sensing light in our system uses a 10 kΩ fixed resistor which is
tied to +5V. Hence the voltage value in this case decreases with increase in light
intensity.
• The sensor node voltage is compared with the threshold voltages for different levels
of light intensity corresponding to the four conditions- Optimum, dim, dark and night.
• The relationship between the resistance RL and light intensity Lux for a
typical LDR is:
RL = 500 / Lux kΩ
• With the LDR connected to 5V through a 10K resistor, the output voltage of the LDR
is :
Vo = 5*RL / (RL+10)
• In order to increase the sensitivity of the sensor we must reduce the value of the fixed
resistor in series with the sensor. This may be done by putting other resistors in
parallel with it.
HUMIDITY SENSOR
The humidity sensor HIH4000, manufactured by Honeywell is used for sensing the
humidity. It delivers instrumentation quality RH (Relative Humidity) sensing performance in
a low cost, solder able SIP (Single In-line Package). Relative humidity is a measure, in
percentage, of the vapour in the air compared to the total amount of vapour that could be held
in the air at a given temperature.
Features:
• Linear voltage output vs. %RH
• Laser trimmed interchangeability
• Low power design
• High accuracy
• Fast response time
Stable, low drift performance
• Chemically resistant
• The RH sensor is a laser trimmed, thermoset polymer capacitive sensing element with
on-chip integrated signal conditioning. The sensing element's multilayer construction
provides excellent resistance to most application hazards such as wetting, dust, dirt,
oils and common environmental chemicals.
1
Humidity sensor circuit
Functional description
• The sensor develops a linear voltage vs. RH output that is ratiometric to the supply
voltage. That is, when the supply voltage varies, the sensor output voltage follows in
the same proportion. It can operate over a 4-5.8 supply voltage range. At 5V supply
voltage, and room temperature, the output voltage ranges from 0.8 to 3.9V as the
humidity varies from 0% to 100% (noncondensing).
• The humidity sensor functions with a resolution of up to 0.5% of relative humidity
(RH).
• With a typical current draw of only 200 µA, the HIH-4000 Series is ideally suited for
low drain, battery operated systems.
• The change in the RH of the surroundings causes an equivalent change in the voltage
output. The output is an analog voltage proportional to the supply voltage.
Consequently, converting it to relative humidity (RH) requires that both the supply
and sensor output voltages be taken into account according to the formula:
• This voltage is converted to the digital form by the ADC and then sent as input to the
microcontroller which reads the data.
TEMPERATURE SENSOR
National Semiconductor’s LM35 IC has been used for sensing the temperature. It is
an integrated circuit sensor that can be used to measure temperature with an electrical output
o
proportional to the temperature (in C). The temperature can be measured more accurately
with it than using a thermistor. The sensor circuitry is sealed and not subject to oxidation, etc.
Functional description:
o
• The sensor has a sensitivity of 10mV / C.
• The output of LM35 is amplified using a LM324 single power supply (+5V) op-amp.
o o
Temperature ( C) = (Vout * 100 ) / 5 C …(4.4)
o
So if Vout is 5V, then, Temperature = 100 C
MICROCONTROLLER 89C52:
FEATURES:
Compatible with MCS-51 Products.
8K Bytes of In-System Reprogrammable Flash Memory.
Endurance: 1,000 Write/Erase Cycles.
Fully Static Operation: 0 Hz to 24 MHz
Three-level Program Memory Lock.
256 x 8-Bit Internal RAM.
32 Programmable I/O Lines.
Three 16-bit Timer/Counters.
Eight Interrupt Sources.
Programmable Serial Channel.
Low Power Idle and Power Down Modes
PIN DIAGRAM
With
4Kbytes of Flash
Programmable and
Erasable Read Only Memory (PEROM). The device is manufactured using Atmel’s high
density nonvolatile memory technology and is compatible with the industry standard MCS-
51 instruction set and pinout. The on-chip Flash allows the program memory to be
reprogrammed in-system or by a conventional nonvolatile memory programmer. By
combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89C52 is a
powerful microcomputer which provides a highly flexible and cost effective solution to many
embedded control applications.
The AT89C52 provides the following standard features: 4 Kbytes of Flash, 256 bytes
of RAM, 32 I/O lines, two 16-bit timer/counters, a five vector two-level interrupt
architecture, a full duplex serial port, on-chip oscillator and clock circuitry. In addition, the
AT89C52 is designed with static logic for operation down to zero frequency and supports two
software selectable power saving modes. The Idle Mode stops the CPU while allowing the
RAM, timer/counters, serial port and interrupt system to continue functioning. The Power
Down Mode saves the RAM contents but freezes the oscillator disabling all other chip
functions until the next hardware reset.
ARCHITECTURE OF 89C52
Port 0:
Port 0 is an 8-bit open drain bidirectional I/O port. As an output port each pin can sink
eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high-impedance
inputs. Port 0 may also be configured to be the multiplexed low order address/data bus during
accesses to external program and data memory. In this mode P0 has internal pull-ups. Port 0
also receives the code bytes during Flash programming, and outputs the code bytes during
program verification. External pull-ups are required during program verification
Port 1:
Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 1 output
buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins they are pulled
high by the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are
externally being pulled low will source current (IIL) because of the internal pull-ups. Port 1
also receives the low-order address bytes during Flash programming and program
verification.
Port 2:
Port 2 is an 8-bit bidirectional I/O port with internal pullups. The Port 2 output buffers
can sink/source four TTL inputs. When 1s are written to Port 2 pins they are pulled high by
the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being
pulled low will source current (IIL) because of the internal pullups.Port 2 emits the high-
order address byte during fetches from external program memory and during accesses to
external data memory that use 16-bit addresses (MOVX A,@DPTR).
In this application it uses strong internal pull-ups when emitting 1s. During accesses
to external data memory that uses 8-bit addresses (MOVX A,@RI), Port 2 emits the contents
of the P2 Special Function Register. Port 2 also receives the high-order address bits and some
control signals during Flash programming and verification.
Port 3:
Port 3 is an 8-bit bidirectional I/O port with internal pullups. The Port 3 output buffers
can sink/source four TTL inputs. When 1s are written to Port 3 pins they are pulled high by
the internal pullups and can be used as inputs. As inputs, Port 3 pins that are externally being
pulled low will source current (IIL) because of the pullups. Port 3 also serves the functions of
various special features of the AT89C52 as listed below:
RST:
RST means RESET; 89C52 uses an active high reset pin. It must go high for two
machine cycles. The simple RC circuit used here will supply voltage (Vcc) to reset pin until
capacitance begins to charge. At a threshold of about 2.5V, reset input reaches a low level and
system begin to run.
ALE/PROG:
Address Latch Enable output pulse for latching the low byte of the address during
accesses to external memory. This pin is also the program pulse input (PROG) during Flash
programming. In normal operation ALE is emitted at a constant rate of 1/6 the oscillator
frequency, and may be used for external timing or clocking purposes. Note, however, that one
ALE pulse is skipped during each access to external Data Memory. If desired, ALE operation
can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only
during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the
ALE-disable bit has no effect if the microcontroller is in external execution mode.
PSEN:
Program Store Enable is the read strobe to external program memory. When the
AT89C52 is executing code from external program memory, PSEN is activated twice each
machine cycle, except that two PSEN activations are skipped during each access to external
data memory.
EA/VPP:
External Access Enable. EA must be strapped to GND in order to enable the device to
fetch code from external program memory locations starting at OOOOH up to FFFFH. Note,
however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should
be strapped to Vcc for internal program executions. This pin also receives the 12-volt
programming enable voltage (Vpp) during Flash programming, for parts that require 12-volt
Vpp.
XTAL1: Input to the inverting oscillator amplifier and input to the internal clock operating
circuit
Program instructions may require one, two or four machine cycles to be executed
depending on type of instructions. To calculate the time any particular instructions will take
to be executed, the number of cycles ‘C’,
A & B Registers:
The 89C52 contains 34 general-purpose, working, registers. Two of these, registers A
and B, hold results of many instructions, particularly math and logical operations, of the
89C52 CPU. The other 32 are arranged as part of internal RAM in four banks, B0-B3, of
eight registers. The A register is also used for all data transfers between the 89C52 and any
external memory. The B register is used for with the A register for multiplication and division
operations.
The 89C52 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. The math flags include Carry (C), Auxiliary Carry (AC), Overflow
(OV), and 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.
MEMORY ORGANISATION
Internal Memory:
The 89C52 has internal RAM and ROM memory for the functions. Additional
memory can be added externally using suitable circuits. This has a Hardware architecture,
which uses the same address, in different memories, for code and data.
Internal RAM:
The 256-byte internal RAM. The upper 128 bytes occupy a parallel address space to
the Special Function Registers. Instructions that use indirect addressing access the upper 128
bytes of RAM. Stack operations are examples of indirect addressing.
Internal Data Memory addresses are always one byte wide, which implies an address
space of only 256 bytes. However, the addressing modes for internal RAM can in fact
accommodate 384 bytes, using a simple trick. Direct addresses higher than 7FH access one
memory space, and indirect addresses higher than 7FH access a different memory space.
Thus Figure shows the Upper 128 and SFR space occupying the same block of addresses,
80H through FFH, although they are physically separate entities.
The Lower 128 bytes of RAM are present in all 89C52 devices as mapped in Figure.
The lowest 32 bytes are grouped into 4 banks of 8 registers. Program instructions call out
these registers as R0 through R7.
Two bits in the Program Status Word (PSW) select which register bank is in use. This
allows more efficient use of code space, since register instructions are shorter than
instructions that use direct addressing. The next 16 bytes above the register banks form a
block of bit addressable memory space. The 89C52 instruction set includes a wide selection
of single-bit instructions, and the 128 bits in this area can be directly addressed by these
instructions. The bit addresses in this area are 00H through 7FH. All of the bytes in the
Lower 128 can be accessed by either direct or indirect addressing.
The Upper 128 can only be accessed by indirect addressing. SFRs include the Port
latches, timers, peripheral controls, etc. These registers can only be accessed by direct
addressing. Sixteen addresses in SFR space are both byte- and bit-addressable. The bit-
addressable SFRs are those whose address ends in OH or 80H.
A-D CONVERTER
8-Bit μP Compatible A/D Converters with 8-Channel Multiplexer
General Description:
The ADC0808, ADC0809 data acquisition component is a monolithic CMOS device with an
8-bit analog-to-digital converter, 8-channel multiplexer and microprocessor compatible control
logic. The 8-bit A/D converter uses successive approximation as the conversion technique. The
converter features
a high impedance chopper stabilized comparator, a 256R voltage divider with analog switch tree
and a successive approximation register. The 8-channel multiplexer can
The device eliminates the need for external zero and full-scale
adjustments. Easy interfacing to microprocessors is provided by the latched and decoded
multiplexer address inputs and latched TTL TRI-STATE® outputs. The design of the ADC0808,
ADC0809 has been optimized by incorporating the most desirable aspects of several A/D
conversion techniques. The ADC0808, ADC0809 offers high speed, high accuracy, minimal
temperature dependence, excellent long-term accuracy and repeatability, and consumes minimal
power. These features make this device ideally suited to applications from process and machine
control to consumer and automotive applications. For 16-channel multiplexer with common
output (sample/hold port) see ADC0816 data sheet. (See AN-247 for more information.)
Features:
1 Easy interface to all microprocessors
Key Specifications:
1 Resolution 8 Bits
4 Low Power 15 mW
CONVERTER CHARACTERISTICS:
The Converter: The heart of this single chip data acquisition system is its 8-bit analog-to-digital
converter. The converter is designed to give fast, accurate, and repeatable conversions over a
wide range of temperatures. The converter is partitioned into 3 major sections: the 256R ladder
network, the successive approximation register, and the comparator. The converter’s digital
outputs are positive true.
The 256R ladder network approach (Figure 1) was chosen over the conventional R/2R
ladder because of its inherent monotonicity, which guarantees no missing digital codes.
Monotonicity is particularly important in closed loop feedback control systems. A non-monotonic
relationship can cause oscillations that will be catastrophic for the system. Additionally, the 256R
network does not cause load variations on the reference voltage.
The bottom resistor and the top resistor of the ladder network in Figure 1 are not the
same value as the remainder of the network. The difference in these resistors causes the output
characteristic to be symmetrical with the zero and full-scale points of the transfer curve. The first
output transition occurs when the analog signal has reached +1⁄2 LSB and succeeding output
transitions occur every 1 LSB later up to full-scale.
The A/D converter’s successive approximation register (SAR) is reset on the positive
edge of the start conversion (SC) pulse. The conversion is begun on the falling edge of the start
conversion pulse. A conversion in process will be interrupted by receipt of a new start conversion
pulse. Continuous conversion may be accomplished by tying the end-of-conversion (EOC) output
to the SC input. If used in this mode, an external start conversion pulse should be applied after
power up. End-of-conversion will go low between 0 and 8 clock pulses after the rising edge of
start conversion. he most important section of the A/D converter is the comparator. It is this
section which is responsible for the ultimate accuracy of the entire converter. It is also the
comparator drift which has the greatest influence on the repeatability of the device. A chopper-
stabilized comparator provides the most effective method of satisfying all the converter
requirements.
The chopper-stabilized comparator converts the DC input signal into an AC signal. This signal
is then fed through a high gain AC amplifier and has the DC level restored. This technique limits
the drift component of the amplifier since the drift is a DC component which is not passed by the
AC amplifier. This makes the entire A/D converter extremely insensitive to temperature, long
term drift and input offset errors. Figure 4 shows a typical error curve for the ADC0808 as
measured using the procedures outlined in AN-179.
1) Enable (E)
This line allows access to the display through R/W and RS lines. When this line is
low, the LCD is disabled and ignores signals from R/W and RS. When (E) line is high, the
LCD checks the state of the two control lines and responds accordingly.
2) Read/Write (R/W)
This line determines the direction of data between the LCD and microcontroller.When it
is low data is written to the LCD. When it is high, data is read from the LCD.
3) Register select (RS)
With the help of this line, the LCD interprets the type of data on data lines. When it is
low, an instruction is being written to the LCD. When it is high, a character is being written
to the LCD.
• RS - 0 Instructions
- 1 Character
PIN DESCRIPTION
Most LCDs with 1 controller has 14 Pins and LCDs with 2 controller has 16 Pins
(two pins are extra in both for back-light LED connections).
RELAYS
A relay is an electrical switch that opens and closes under the control of another
electrical circuit. In the original form, the switch is operated by an electromagnet to open or
close one or many sets of contacts. It was invented by Joseph Henry in 1835. Because a relay
is able to control an output circuit of higher power than the input circuit, it can be considered
to be, in a broad sense, a form of an electrical amplifier.
Since relays are switches, the terminology applied to switches is also applied to
relays. A relay will switch one or more poles, each of whose contacts can be thrown by
energizing the coil in one of three ways:
1. Normally - open (NO) contacts connect the circuit when the relay is activate d; the
circuit is disconnected when the relay is inactive. It is also called a FORM A contact or
“make” contact.
2. Normally - closed (NC) contacts disconnect the circuit when the relay is activated;
the circuit is connected when relay is inactive. It is also called FORM B contact or”
break” contact
BLOCK DIAGRAM:
CIR
CIRCUIT DIAGRAM:
Component Used
(a) Capacitors
A diode can be used as rectifier. There are various types of diodes. However,
semiconductor diodes are very popularly used as rectifiers. A semiconductor diode is
a solid-state device consisting of two elements is being an electron emitter or cathode,
the other an electron collector or anode. Since electrons in a semiconductor diode can
flow in one direction only-form emitter to collector-the diode provides the unilateral
conduction necessary for rectification. The rectified Output is filtered for
smoothening the DC, for this purpose capacitor is used in the filter circuit. The filter
capacitors are usually connected in parallel with the rectifier output and the load. The
AC can pass through a capacitor but DC cannot, the ripples are thus limited and the
output becomes smoothed. When the voltage across the capacitor plates tends to rise,
it stores up energy back into voltage and current. Thus, the fluctuation in the output
voltage is reduced considerable
CIRCUIT SCHEMATIC OF THE SYSTEM
SYSTEMS USED IN WORK MODE
DRIP IRRIGATION SYSTEM FOR CONTROLLING SOIL MOISTURE
Polyethylene tubing is run from the source of water to the plant, where the emitter is
attached for dripping water. Emitter line (poly tubing with pre-installed emitters) is used
where a continuous band of water is needed. Fittings are available to make sharp turns
(elbows), branch lines (tees), and to make the transition between different sizes of tubing.
When plants are removed or die, drip lines should be plugged.
Drip irrigation (sometimes called trickle irrigation) works by applying water slowly,
directly to the soil. The high efficiency of drip irrigation results from two primary factors.
The first is that the water soaks into the soil before it can evaporate or run off. The second is
that the water is only applied where it is needed, (at the plant's roots) rather than sprayed
everywhere.
A drip irrigation system slowly provides water to the plant's root system. Regular
watering prevents plant dehydration, but roots don't get overly soaked and in turn, plant
growth can increase up to 50%. Drip systems irrigate all types of landscape: shrubs, trees,
Perennial beds, ground covers, annuals and lawns. Drip is the best choice to water roof
gardens, containers on decks and patios, row crops and kitchen gardens, orchards,
and vineyards.
Growing lights enable cultivators to extend daylight hours - useful for winter and
spring growing when levels of natural lights can be low, and one can therefore improve plant
growth. Three basic types of lamps used in greenhouse lighting are:
• Fluorescent lamps - These have the advantage of higher light efficiency with low
heat. This type of lamp is the most widely used for supplemental light. It is available
in a variety of colors but cool-white lamps are the most common. High intensity
(1500 ma) fluorescent tubes that require higher wattage are also commonly used to
reach 2000 foot candles.
• Incandescent lamps - These vary in size from 60 watts to 500 watts. The grower can
vary foot-candle levels by adjusting the spacing and mounting height above the
plants.
• High-intensity discharge (HID) lamps –These have a long life (5000 hours or more).
With improvements made possible by the addition of sodium and metal- halides,
the lamp has a high emission of light in the regions utilized by plants.
• Low: 1000-1800 foot candles--reduced sunlight, so that if a hand is passed over the
leaves it does not produce a shadow.
One foot candle is equal to 10.76 lux, although in the lighting industry, typically this
is approximated as 1 foot candle being equal to 10 lux.
TEMPERATURE CONTROLLERS
COOLING EQUIPMENT
There are three primary cooling devices in most greenhouses. These are the vent system,
exhaust fan, and swamp cooler. Some greenhouses may make use of air conditioners and/or
misting systems as well.
• Vents are hinged or track connected panels in the roof or sides of greenhouses. They
open up the greenhouse to outside natural air. Hot air that builds up in the greenhouse
can escape, and fresh air can enter the house. The microcontroller can be used to
automate the opening and closing of these vents depending upon requirement.
But during hot summer days, venting alone will not get the job done.
• Exhaust fans can move a large volume of the hot greenhouse air out and pull fresh
air in through the rear vent. They're powerful for a reason, as full sun on a hot
summer day can cause temperatures inside the greenhouse to superheat. An exhaust
fan must be able to pull this air out, or the temperatures will continue to rise.
• Swamp coolers: come in different widths and lengths. They can be configured to the
appropriate size, as this varies depending on the length and width of the greenhouse,
location where you live, and type of plants you wish to grow.
HEATING EQUIPMENT
• Electric heaters: Overhead infrared heating equipment combined with soil cable heat
provides a localized plant environment, which allows plants to thrive even though the
surrounding air is at a lower than normal temperature. Electric resistance-type heaters
are used as space heaters or in a forced air system.
HUMIDIFICATION SYSTEMS
Many evaporative cooling and humidifying systems are available: Foggers, Mist systems,
Roof Sprinklers, and Pan & Fan Systems. They add watervapour to the air, and may
subsequently reduce the amount of water that the plants need to transpire.
• Roof sprinklers add water vapour and cool the incoming air. On large ranges, it is
possible to decrease the temperature by 3 – 5 C and increase the humidity by 5-10%.
• Pad and fan systems consist of porous wet pads at the inlet end of a fan ventilated
greenhouse. As the exhaust fans draw air through the wet pads, water evaporates, cooling
and humidifying the air. Temperatures tend to be coolest nearer the fans and hottest at the
exhaust when using these systems.
• Mist and fog systems produce tiny water droplets that evaporate, thereby cooling and
humidifying the greenhouse air. A misting system can provide needed moisture
to maintain a healthy humidity level of 50 to 70%.
FLOWCHART
FLOWCHART REPRESENTING THE WORKING OF THE SYSTEM:
START
B
INITIALISE THE ADC
NO
A
A
YES NO
SENSOR
THRESHOLD
CROSSED?
START
STOP
START
SELECT AN ANALOG CHANNEL BY SETTING
THE ADDRESS LINES A, B AND C
EOC =0? A
A
STOP
SOFTWARE DESCRIPTION
IN-SYSTEM PROGRAMMING:
The Atmel Microcontroller ISP Software is the primary means for performing in-system
programming (ISP) for the Atmel devices. It provides an intuitive interface for in-system
programming that can be run from your personal computer. The Atmel ISP Software has a
comprehensive set of features that allows you to view, program, and erase data from an
Atmel ISP device.
The Atmel Microcontroller ISP Software also allows you to load hex files containing the
code you want to add to the device. Using the software, you can manipulate this code, verify
it against the existing code on the device, and program the code onto the device.
Additionally, using the software, you can read any existing code from the device and
make minor changes to the code. You can then update the device with your changes or save
them to a hex file for use with other devices.
The software also allows you to protect third parties from accidentally reprogramming
the device and even allows you to lock the device so that the code cannot be read from it.
Atmel’s microcontroller ISP Software contains a variety of tools customized for Atmel ISP
devices
Programming Algorithm:
To program the AT89C52, take the following steps:
1. Input the desired memory location on the address lines.
2. Input the appropriate data byte on the data lines.
3. Activate the correct combination of control signals.
4. Raise EA/VPP to 12V.
5. Pulse ALE/PROG once to program a byte in the flash array or the lock bits.
The byte-write cycle is self-timed and typically takes no more than 50 μs. Repeat
steps 1 through 5, changing the address and data for the entire array or until the end of the
object file is reached.
Programming the Flash – Serial Mode:
The Code memory array can be programmed using the serial ISP interface while RST is
pulled to VCC. The serial interface consists of pins SCK, MOSI (input) and MISO (output).
After RST is set high, the Programming Enable instruction needs to be executed first before
other operations can be executed. Before a reprogramming sequence can occur, a Chip Erase
operation is required. The Chip Erase operation turns the content of every memory location
in the Code array into FFH. Either an external system clock can be supplied at pin XTAL1 or
a crystal needs to be connected across pins XTAL1 and XTAL2. The maximum serial clock
frequency should be less than 1/16 of the crystal frequency. With 33 MHz oscillator clock,
the maximum SCK frequency is 2 MHz.
Serial Programming Algorithm:
To program and verify the AT89C52 in the serial programming mode, the
following sequence is recommended:
Power-up sequence:
1. Apply power between VCC and GND pins. Set RST pin to “H”. If a crystal is not
connected across pins XTAL1 and XTAL2, apply a 3 MHz to 33 MHz clock to XTAL1 pin
and wait for at least 10ms.
2. Enable serial programming by sending the Programming Enable serial instruction to pin
MOSI/P1.5. The frequency of the shift clock supplied at pin SCK/P1.7 needs to be less than
the CPU clock at XTAL1 divided by 16.
3. The Code array is programmed one byte at a time by supplying the address and data
together with the appropriate Write instruction. The write cycle is self-timed and typically
takes less than 1ms at 5V.
4. Any memory location can be verified by using the Read instruction which returns the
content at the selected address at serial output MISO/P1.6.
5. At the end of a programming session, RST can be set low to commence normal device
operation.
RESULT ANALYSIS
RESULT ANALYSIS
0
Readings taken at room temperature of 27 C
TRANSDUCER READINGS
SOIL MOISTURE SENSOR
Tolerance= ± 0.2 V
Soil is dry 0V
Optimum level of
1.9- 3.5V
soil moisture
LIGHT SENSOR
Tolerance = ±0.1V
OPTIMUM 0V-0.69V
ILLUMINATION
DARK 2.5V- 3V
NIGHT 3V-3.47V
HUMIDITY SENSOR
FORMULA:
RH = ((Vout / Vcc) – 0.16 )/0.0062, typical at 25°C
where, Vsupply = 4.98V
Tolerance= ±0.1V
0% to 9.81% 0.8-1.1V
41.3%to50.3% 2.075-2.35V
61.6%to70.5% 2.7-2.975V
71%to80.2% 3-3.275V
TEMPERATURE SENSOR
FORMULA:
o o
Temperature ( C ) = (Vout/5) *100( C/V)
Temperature sensor readings
1 ) 0
1500to 200 C .
0.75-1.0V
20 0to 250 C 1.0-1.25V
250 to 30 0C 1.25-1.5V
30 0to 35 0C 1.5-1.75V
350 to 400 C 1.75-2.0V
400 to 45 0C 2.0-2.25V
450 to 500 C 2.25-2.5V
500 to 55 0C 2.5-2.75V
550 to 600C 2.75-3.0V
600 to 650 C 3.0-3.25V
650 to 70 0C 3.25-3.5V
70 0to 750 C 3.5-3.75V
75 0to 80 0C 3.75-4.0V
900 to 95 0C 4.5-4.75V
ADVANTAGES
3. Closed loop design prevents any chances of disturbing the greenhouse environment.
4. User is indicated for changes in actuator state thereby giving an option for manual
override.
5. Low maintenance and low power consumption.
6. The system is more compact compared to the existing ones, hence is easily portable.
7. Can be used for different plant species by making minor changes in the ambient
environmental parameters.
8. Can be easily modified for improving the setup and adding new features.
9. Labour saving.
10. Provides a user-friendly interface hence will have a greater acceptance by the
technologically unskilled workers.
11. In response to the sensors, the system will adjust the heating, fans, lighting, irrigation
immediately, hence protect greenhouse from damage.
12. Malfunctioning of single sensor will not affect the whole system.
LIMITATIONS
1. Complete automation in terms of pest and insect detection and eradication cannot
be achieved.
1) The performance of the system can be further improved in terms of the operating speed,
memory capacity and instruction cycle period of the microcontroller by using other
controllers such as AVRs and PICs. The number of channels can be increased to interface
more number of sensors which is possible by using advanced versions of
Microcontrollers.
2) The system can be modified with the use of a data logger and a graphical LCD panel
showing the measured sensor data over a period of time.
3) A speaking voice alarm could be used instead of the normal buzzer.
4) This system can be connected to communication devices such as modems, cellular phones
or satellite terminal to enable the remote collection of recorded data or alarming of certain
parameters.
5) The device can be made to perform better by providing the power supply with the help of
battery source which can be rechargeable or non-rechargeable, to reduce the requirement
of main AC power.
6) Time bound administration of fertilizers, insecticides and pesticides can be introduced.
7) A multi-controller system can be developed that will enable a master controller along with
its slave controllers to automate multiple greenhouses simultaneously.
CONCLUSION
CONCLUSION
The continuously decreasing costs of hardware and software, the wider acceptance of
electronic systems in agriculture, and an emerging agricultural control system industry in
several areas of agricultural production, will result in reliable control systems that will
address several aspects of quality and quantity of production. Further improvements will be
made as less expensive and more reliable sensors are developed for use in agricultural
production.
Although the enhancements mentioned in the previous chapter may seem far in the
future, the required technology and components are available, many such systems have been
independently developed, or are at least tested at a prototype level. Also, integration of all
these technologies is not a daunting task and can be successfully carried out.