Sei sulla pagina 1di 46

Contents

1 INTRODUCTION

2 LEARNING PROCESS

3 BLOCK DIAGRAM

4 PROJECT DESCRIPTION
4.1 SOIL MOISTURE SENSOR . . . . . . . . . . . . . . . .
4.1.1 Components . . . . . . . . . . . . . . . . . . . . .
4.1.2 Making of soil moisture sensor . . . . . . . . . . .
4.1.3 Principle of operation . . . . . . . . . . . . . . . .
4.1.4 Flowchart of soil moisture sensor . . . . . . . . .
4.1.5 Working of soil moisture . . . . . . . . . . . . . .
4.1.6 Circuit diagram of soil moisture-valve-LCD circuit
4.1.7 Problems faced . . . . . . . . . . . . . . . . . . .
4.2 RAIN SENSOR . . . . . . . . . . . . . . . . . . . . . . .
4.2.1 Components . . . . . . . . . . . . . . . . . . . . .
4.2.2 Making of Rain sensor . . . . . . . . . . . . . . .
4.2.3 Working of the rain sensor . . . . . . . . . . . . .
4.3 SHIELD . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.3.1 Components . . . . . . . . . . . . . . . . . . . . .
4.3.2 Making of the Shield . . . . . . . . . . . . . . . .
4.3.3 Circuit diagram of rain sensor-shield . . . . . . .
4.3.4 Problems faced . . . . . . . . . . . . . . . . . . .
4.4 TEMPERATURE AND CONTROLLING SYSTEM . .
4.4.1 Components . . . . . . . . . . . . . . . . . . . . .
4.4.2 Overview . . . . . . . . . . . . . . . . . . . . . .
4.4.3 Flowchart of temperature and controlling system
4.4.4 Problems faced . . . . . . . . . . . . . . . . . . .
4.4.5 Circuit diagram of temperature controlling system
4.5 WIND SPEED DETECTION . . . . . . . . . . . . . . .
4.5.1 Components . . . . . . . . . . . . . . . . . . . . .

ii

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

8
8
8
9
9
11
11
12
12
13
13
13
14
15
15
15
15
16
17
17
18
19
19
20
21
21

4.5.2 Anemometer construction . . . . . . . .


4.5.3 IR module working . . . . . . . . . . . .
4.5.4 Overview . . . . . . . . . . . . . . . . .
4.5.5 Circuit diagram of anemometer-window .
4.5.6 Problems faced . . . . . . . . . . . . . .
4.6 SUN TRACKER . . . . . . . . . . . . . . . . .
4.6.1 Components . . . . . . . . . . . . . . . .
4.6.2 Overview . . . . . . . . . . . . . . . . .
4.6.3 Algorithm for sun tracker . . . . . . . .
4.6.4 Problem faced . . . . . . . . . . . . . . .
4.6.5 Circuit diagram for sun tracker . . . . .
4.7 RF MODULE . . . . . . . . . . . . . . . . . . .
4.7.1 Transmitter . . . . . . . . . . . . . . . .
4.7.2 RF receiver . . . . . . . . . . . . . . . .
4.7.3 Working of RF module . . . . . . . . . .
4.8 SERIAL COMMUNICATION . . . . . . . . . .
4.8.1 Components . . . . . . . . . . . . . . . .
4.8.2 Overview . . . . . . . . . . . . . . . . .
4.8.3 Circuit diagram for data transmission . .
4.8.4 Problems faced . . . . . . . . . . . . . .

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

21
22
22
23
24
24
24
25
25
26
27
28
28
28
29
30
30
30
30
31

5 RESULT

32

6 CONCLUSION AND FUTURE DEVELOPMENTS

35

7 APPENDIX

36

References

42

iii

List of Figures
3.1 Block diagram of the system . . . . . . . . . . . . . . . . . . . . . . . . . .
4.1
4.2
4.3
4.4
4.5
4.6
4.7
4.8
4.9
4.10
4.11
4.12
4.13
4.14
4.15
4.16
4.17
4.18
4.19
4.20
4.21

Soil moisture sensor . . . . . . . . . . . . . . . . .


Valve . . . . . . . . . . . . . . . . . . . . . . . . .
Flowchart of soil moisture sensor . . . . . . . . .
Circuit diagram of soil moisture-valve-LCD circuit
Table showing variation in moisture sensor . . . .
Rain sensor . . . . . . . . . . . . . . . . . . . . .
Circuit diagram of soil moisture-valve-LCD circuit
Various stages in the design of the shield . . . . .
Exhaust fan . . . . . . . . . . . . . . . . . . . . .
Temperature and controlling system . . . . . . . .
Flowchart of temperature and controlling system .
Circuit diagram of temperature controlling system
Anemometer . . . . . . . . . . . . . . . . . . . . .
IR Module . . . . . . . . . . . . . . . . . . . . . .
Window . . . . . . . . . . . . . . . . . . . . . . .
Circuit diagram of anemometer-window . . . . . .
Various stages in the design of sun tracker . . . .
Circuit diagram for sun tracker . . . . . . . . . .
RF Module . . . . . . . . . . . . . . . . . . . . .
Circuit diagram for serial communication . . . . .
Serial communication . . . . . . . . . . . . . . . .

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

5
9
10
11
12
12
14
15
16
17
18
19
20
21
22
23
23
26
27
28
30
31

5.1 simulation result of moisture sensor . . . . . . . . . . . . . . . . . . . . . . 32


5.2 simulation result of temperature sensor . . . . . . . . . . . . . . . . . . . . 33
7.1 PIC 16F877A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

iv

Chapter 1
INTRODUCTION
For the large rural distract, the greenhouse production has become a way of being
rich. The growth of crop in greenhouse depends on temperature, humidity, wind and
other parameters in greenhouse. So it is important to properly measure and adjust the
temperature, humidity and other parameters in the greenhouse. The wireless monitoring
system is developed, which based on wireless communication technology, does not need
cables, adds or reduces conguration at random, possess simple system construction.
A greenhouse environment parameters monitoring system based on wireless communication technology has been developed, which realizes the measurement, summary and
control of temperature, humidity and the other parameters. To give more Importance to
conservation of energy, solar energy is used. To increase the eciency of the solar panel,
sun tracker is also designed.

Chapter 2
LEARNING PROCESS
After many survey and research we nally ended up in doing a project in agricultural sector. To make the irrigation simpler we planned of controlling several environmental parmeters. Thus the title to our project was given as 'Control of Environmental
parameters in Greenhouse'.The base papers that suits our project were 'Wireless measurement and controlling of Environmental parameters' and 'Remote Sensing and Control of
an Irrigation System Using a Distributed Wireless Sensor Network'. In addition to the
above, we planned of utilizing a conventional source of energy as a part of conservation
of energy.
Several sensors were introduced like rain sensor, temperature sensor and soil
humidity sensor since rain, temperature and soil water content are the most important
parameters in irrigation system.
The description of the above mentioned sensors are as follows:
1. Soil moisture sensor: For proper cultivation of crops, proper check on soil moisture
has to be monitored continuously .The idea about soil moisture sensor was available
from the webpage 'http://blog.makezine.com/2009/03/04/nocost-soil-moisture-sensor'.
According to the webpage, it says that if two nail when dipped in plaster of Paris
and separated by a xed distance can act as a soil moisture sensor. The principle
of operation was that the resistance of a porous block is proportional to its water
content. Thus, wetter the block, lower is the resistance measured across the two
embedded electrodes. Thus soil moisture was able to design.
2. Rain sensor: The idea about the rain sensor was available from webpage
'http://www.nationalstemcentre.org/CEM5.pdf'.' In the webpage, it says that a
simple PCB using etching process can be used as a rain sensor. It is the cheapest
form of rain sensor.
3. Temperature sensor: Too much temperature can fade away the crops. In order to
avoid the above, we thought of introducing a temperature sensor. The idea about
temperature sensor was available from webpage 'http://www.engineersgarage.com
2

electronic-components/lm35-sensor-datasheet. In the webpage, LM35 is used as the


temperature sensor. The features of LM35 are
Sensor gain of 10mV/C
temperature range of 0-100V

Now along with rain, temperature, and soil moisture, wind is also an important
parameter. In order to measure the wind speed we thought of introducing anemometer.
The idea regarding the wind speed detection was available from the webpage . In the
webpage, anemometer along with IR module was able to measure the wind speed. The
principle of operation of wind speed detection is that the ap of the anemometer cuts the
IR rays and the number of cut was counted to measure the wind speed.
We have control unit, which controls the irrigation system depending on the
sensors output. Depending on the sensors used, we planned of installing several control
measures. The dierent control units we are planning to use are:
1. Valve: A valve is placed across the eld, which help in drip irrigation. The valve
is supposed to be opened or closed depending on the soil moisture level. The soil
moisture level was determined by the soil moisture sensor.
2. Shield: Shield can act as a cover to the eld. The shield gets activated depending
on the output of rain sensor. The design of shield was available from the mechanical
department. According to the department, the shield rolls the sheets when there is
rain and wraps the sheet when there is no rain.
3. Exhaust fan: The exhaust was provided to prevent the crop from getting faded out
due to high temperature. The exhaust fan will be made on as the temperature
exceeds a critical temperature.
4. Window: A window is placed across the eld. The idea of working of window was
available from the journal 'Microcontroller Based Clockwise/Anticlockwise Stepper
Motor Controller Using PC Keyboard Via Com Port'. In the paper, a stepper motor
was used to rotate the window. The rotation of the window depends on the output
of the wind speed detector.
Now we need an interface to provide a relation between the sensor unit( plus
anemometer) and the control unit. Thus PIC 16F877A was used as an interface. The
features of PIC are as follow:
High-performance RISC CPU
Operating speed: DC - 20 MHz clock input,DC - 200 ns instruction cycle
Timer0:8-bit timer/counter with 8-bit prescaler

Timer1: 16-bit timer/counter with prescaler, can be incremented during sleep via

external crystal/clock
Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler
10-bit multi-channel Analog-to-Digital converter

The sensor and anemometer output could be given to the PIC. The PIC thus
would activate the control unit.
We are also planning to monitor the irrigation system from a long distance.
Thus we need a monitor screen. The output of the sensor and anemometer was send to
PIC. An RF module was placed near the PIC. Using the RF module, we can send the
data using a RF transmitter to a RF receiver placed near the monitor. The working of
RF module is explained in detail in the paper CYTRON technologies-Sending data using
RF module.
Now with the help of serial communication, the data in the receiver is send
to the monitor. The principle of serial communication was also obtained from the above
mentioned paper.
Thus combining all the above detail, we were able to design the block diagram.
The block diagram is explained in the next chapter.

Chapter 3
BLOCK DIAGRAM

Figure 3.1: Block diagram of the system


Fig 3.1 gives the block diagram of the project. Each section could be
explained as follows.

Several sensors were placed on the eld. They include rain sensor, soil moisture
sensor, and temperature sensor. The workings of the sensors are given below:
Rain sensor: Check whether it is raining or not
Soil moisture sensor: Check the moisture level of the soil.
Temperature sensor: Check the temperature of the eld

Along with the sensors, the project includes an anemometer and sun tracker.
The Anemometer was used to measure the wind speed. The output of the sensors and
the anemometer were given to the PIC 877A. The output of the PIC was given to the
control unit. The control unit consists of
Shield: Act as an umbrella for the eld.
Valve: Provide water for the soil in the eld.
Exhaust fan: Provide cooling eect.
Window: Provide protection from heavy wind.

The brief working of the block diagram is as follows.


Rain sensor was placed on the eld. When rain falls on the eld, its shorts the
rain sensor and activate the shield via pic. The shield rolls a sheet across the eld. Now,
when raining stops, the shield was activated to its initial state. Thus rain sensor-pic-shield
provides protection from rain.
Soil moisture sensor was placed across the eld to check the moisture level.
The moisture level was classied into 3 types: low, medium, high. According to the
above moisture level, the valve was opened. When the moisture level is low, the valve
was opened for 5sec . This was a continuous process till the moisture was increased to
medium. When the moisture level was medium, the valve was opened for 3sec. This
process was a continuous one, till the moisture level was high. When the moisture level
was high, the valve was closed.
Temperature sensor was placed on the eld. When the temperature was high,
the fan was activated via PIC. The critical temperature at which the fans get activated
was decided by the PIC. The fan was able to reduce the temperature, as the temperature
decreases the critical temperature, the fan became inactive. Thus the temperature sensor
helps in stablilising the temperature with less tolerance.
Anemometer was placed across the eld. Anemometer along with the IR module was used to measure the wind speed.The number of turns made by the anemomter
was counted and used toi measure the wind speed. Depending on the wind speed, the
window frame was adjusted using PIC.If the wind speed is high, the aps of the window is
6

made perpendicular to the ground and when the speed is low, the ap is rotated parallel
to the ground. Thus anemometer along with the wind, help in prevent from heavy mind.
The sun tracker was placed on the eld. A solar cell was placed over the sun
tracker. The sun tracker was a time varying device to increase the eciency.The output
of the solar tracker was send to the battey, to charge the battery.
The outputs of the rain sensor, moisture sensor, anemometer and temperature
sensor were send to the monitor using a RF module. The RF module consists of a RF
transmitter and receiver operating at 434MHz. An encoder and a decoder were placed
along with the transmitter and receiver respectively for proper data transfer. The receiver
was placed near the screen. The output of the receiver was send to the screen to monitor
the eld
All the above were assembled together to get the nal product, which help in
control of irrigation system automatically.

Chapter 4
PROJECT DESCRIPTION
4.1

SOIL MOISTURE SENSOR

Irrigation without soil moisture monitoring can be costly, wasteful guesswork. So,
detecting the amount of soil moisture content will be of great help for the farmers. Monitoring of soil moisture status is increasingly being adopted to improve irrigation scheduling. It helps to determine when you need to irrigate and will show up any over watering.
A simple moisture monitoring system may be used if there is sucient time to
read the equipment and analyze the results. For controlling irrigations from soil moisture
sensor, reaction time is essential. Life span of the equipment needs to be considered along
with cost. Hence, simple soil moisture was made with the help of gypsum which was
enough to measure the moisture content in the soil.
4.1.1

Components

Plaster of paris
Galvanized nail
LCD screen
PIC
Water valve

4.1.2

Making of soil moisture sensor

The making of soil moisture was quite easy. Just mix plaster of paris with water
and it was made into a paste. The paste was then suppressed in a small cylindrical bottle
of smaller base and two stainless steel nails were dipped in it, a small distance apart such
that their one end of the nail were not dipped. It was placed in sunlight for about an
hour. By that time, the mould got hardened and the bottle was broken to obtain the
mould gypsum.

Figure 4.1: Soil moisture sensor

4.1.3

Principle of operation

The principle of operation is that the resistance of a porous block is proportional


to its water content. Thus, wetter the block, lower is the resistance measured across the
two embedded electrodes. So, one electrode was given to ground via a resistor. Here the
resistance across the resistors was actually measured so that while programming, it would
be easier to use.
The resistance would be very small when the gypsum block was very dry, so
the resistance across the block would be very high as conductivity was very low. The
next stage of consideration was moderately wet state. This is the state of requirement for
agriculture. A threshold value was kept at this value measured voltage value.
The microcontroller checks this voltage and decides what step should follow
9

next to control the irrigation. If the voltage was below a threshold value, i.e, the gypsum
block was very dry, the microcontroller activate the motor and drip irrigation occurs.
The valve used for the water to ow is shown in Fig 4.2.

Figure 4.2: Valve


A solenoid valve was the one used. The valve would remain closed until an electric
supply is given to one end.

10

4.1.4

Flowchart of soil moisture sensor

Figure 4.3: Flowchart of soil moisture sensor


Fig 4.3 shows the algorithm of the program used in the microcontroller for the
operation of the valve.
4.1.5

Working of soil moisture

Soil moisture sensor was placed across the eld to check the moisture level. The
moisture level was classied into 3 levels: low, medium, high. According to the above
moisture level, the valve was opened. When the moisture level is low, the valve was
opened for 5sec and it again checked the moisture level. This was a continuous process
till the moisture was increased to medium. When the moisture level was medium, the
valve was opened for 3sec and it again checked the moisture level. This process was a
continuous one, till the moisture level was high. When the moisture level was high, the
valve was closed.
An LCD was connected near the eld. The LCD displays the moisture level
of the ground,i.e, if the moisture was high, the LCD displays 'HIGH'. Thus a person can
check the condition of the soil, by looking at the LCD display.

11

4.1.6

Circuit diagram of soil moisture-valve-LCD circuit

Figure 4.4: Circuit diagram of soil moisture-valve-LCD circuit


Fig 4.4 gives the circuit diagram of the soil moisture sensor. Dierent voltages obtained
at dierent moisture levels were tabulated and is given in Fig 4.5

Figure 4.5: Table showing variation in moisture sensor

4.1.7

Problems faced

As iron nails were used as electrodes in the rst case, due to moisture content, iron

nails started to corrode. It aected the voltage value obtained considerably. So,
instead of iron nails, electrodes made of stainless steel were used.
Making of the moisture sensor required several attempts.

12

4.2

RAIN SENSOR

Rain is a important parameter in irrigation system. Too much rain can cause damage to
the crops. With the help of rain sensor, rain can be detected and convenient measures
can be enabled.
4.2.1

Components

PCB
Ferric chloride
Permanent Marker

The rain sensor was made by simply etching the PCB as shown in the gure. The two
lines in the PCB are Vcc and ground. This type of rain sensor is nowdays becoming a
common practice, as it is a cheap form of rain senor.
4.2.2

Making of Rain sensor

1. Plane PCB was cleaned using kerosene


2. The circuit was drawn on the plane PCB using a permanent marker.
3. The circuit was designed as shown in the above gure
4. 50mg Ferric chloride powder was mixed with 100ml water to prepare the ferric
chloride solution.
5. The PCB was dipped in the solution for about 20 minutes.
6. The region uncovered by the marker was dissolved in the solution.
7. The board was taken out and wiped using a cloth.
8. Thus the rain sensor is designed.

13

Figure 4.6: Rain sensor


Fig 4.6 shows the making of rain sensor before and after the etching process was carried
out.
4.2.3

Working of the rain sensor

The working of the rain sensor was checked using the Multimeter. The buzzer of
the multimeter was activated when water was dropped on the PCB.
When rain
falls on the PCB, the Vcc and the ground of the circuit gets closed. When the circuit gets
closed, the shield was activated using the motor via microcontroller.

14

4.3

SHIELD

A shield was made to provide cover to the eld. The shield can prevent the eld from
damage caused by the rain.
4.3.1

Components

two 12V motors


printer scrap
plywood
roller
driver

4.3.2

Making of the Shield

The shield was designed using rack and pinion method. The two motors were used
to roll the sheet and wrap the sheet. A single driver was used to roll and wrap the sheet.
Plywood was placed to provide mechanical support to the shield. The plywood
was drilled properly and the scrap of the printer was placed on the top. The motors were
placed across the board. The PIC 16877A was used to activate the roller .When rain falls
on the rain sensor, it gets shorted and since it was connected to the PIC, the PIC becomes
activated. The PIC enables the motor and help to roll and wrap the sheet. When rain
falls on the rain sensor, the shield was activated by the PIC such that the shield rolls the
sheet. As the raining stops, the shield rolls the sheet back into its initial state. Both the
motors activate the same driver. Thus reduces the wastage of the space.
4.3.3

Circuit diagram of rain sensor-shield

Figure 4.7: Circuit diagram of soil moisture-valve-LCD circuit


15

Figure 4.8: Various stages in the design of the shield

4.3.4

Problems faced

Several problems were faced during the design of shield


Dicult to obtain the components required for the shield
Mechanical construction of the shield was aquite a dicult task and it costed a lot

of time.

16

4.4

TEMPERATURE AND CONTROLLING SYSTEM

Temperature is an important parameter in irrigation system. Very high temperature can


damage the crops , as it dehydrates the water content of the crop. Exhaust fan were
enabled to prevent rise in temperature beyond the critical temperature.
4.4.1

Components

LM 35
Exhaust fan
PIC

Figure 4.9: Exhaust fan


In the project, LM35 was used as the temperature sensor.
The features of LM35 are
Sensor gain, 10mV/C
0 - 100C
0-5V

17

Figure 4.10: Temperature and controlling system


4.4.2

Overview

The design of the temperature sensor was designed using LM 35. The output of
LM35 was observed on the breadboard with the help of a CRO. In CRO , the voltage
variation was observed as the temperature was changed by placing hot solder lead near
LM35. The output of the temperature sensor was send to the micro-controller. The PIC
converts the output voltage into corresponding degree using simple formula. The output
of the PIC was send to a LCD screen.
Final product was obtained after several trials. The temperature sensor was
able to send the variation in the surrounding temperature to the PIC. The PIC accepts
the output of the Temperature sensor. The PIC activates the exhaust fan which is placed
across the eld.
A motor is connected to the fan. The working of the exhaust fan was veried,
as the fan was rotating when power supply was applied. The PIC was able to provide
power supply to the motor. The above was made to occur only when the temperature
sensor exceeds a predened limit.
Thus temperature sensor-exhaust fan interface using a the PIC 16F877A was
obtained.

18

4.4.3

Flowchart of temperature and controlling system

The ow chart of the program for temperature conrol is given in g 4.11

Figure 4.11: Flowchart of temperature and controlling system

4.4.4

Problems faced

Several problems were faced during the design of temperature sensor


Noises were obtained during the verication of the output,
LM 35 got heated immediately at many instances. This sometimes even damaged

the sensors. Due to over heating, sometimes the LCD display didn't show any
output.

19

4.4.5

Circuit diagram of temperature controlling system

Figure 4.12: Circuit diagram of temperature controlling system


Fig 4.12 shows the complete circuit diagram of the temperature control section including the LCD display and the exhaust fan.

20

4.5

WIND SPEED DETECTION

Wind is an important parameter in agriculture. Too much wind can damage to


the crop, as strong wind can uproot the crops. This project has bought a remedy to the
above concern. Thus anemometer was used to measure the wind speed with the help of
an IR module.
4.5.1

Components

Anemometer
IR module
PIC
Window

4.5.2

Anemometer construction

In order to activate the frame of the window shown in the gure; we need to nd
the wind speed. To measure the wind speed, we use an anemometer. Anemometer consists
of metal rod and metal cups. They are weld to form the anemometer. Gears and drives
and placed to get the nal product. The gure of the anemometer is shown below.

Figure 4.13: Anemometer

21

4.5.3

IR module working

An IR module along with the anemometer was used to measure the wind speed.
For the above to occur, an IR module was placed along the anemometer. An IR module
consists of a comparator, variable pot and two LED's. One of the LED is the IR transmitter while the other one is the IR receiver. When IR rays reect back to the IR module,
a pulse is formed at the output.

Figure 4.14: IR Module

4.5.4

Overview

As the leaf of the anemometer cuts the IR rays, these rays were reected back to
the IR module and pulse was formed at the output. The distance between the IR module
and the obstacle can be varied by adjusting the variable pot. The variable should not be
changed again, as it cannot provide correct output. The number of pulse formed at the
IR module is used to measure the wind speed in rpm.
A LCD screen was placed in the eld to display the wind speed. The power
supply for the LCD screen was provided using the PIC. The output of the IR module was
send to the PIC.The PIC activate the LCD screen and also the window.
The position of the window frame was varied depending upon the wind speed.
When the wind speed was slow, the frame of the window was perpendicular with respect
to the eld, so that maximum wind can enter the eld. When the speed of the wind
exceeds a predened value, the window was readjusted. The gure of the window used is
shown below.

22

Figure 4.15: Window


4.5.5

Circuit diagram of anemometer-window

Figure 4.16: Circuit diagram of anemometer-window


subsectionAlgorithm for working of anemometer-IR module
The Algorithm used for the proper working of the anemometer-IR module
We need to dene various constants and LCD data pins as easy identiers.
LCD module needs to be initialized with appropriate command words before sending

the status message for interface upon startup of the system.


Timer is initialized as counter and its value is made as zero before counting is

started.
Counting started.

23

The count value is multiplied by 4 to get the rotations per minute value and it is

displayed on the LCD.


If rpm is over certain threshold value, the ap of the motor gets activated accord-

ingly.
Jump to STEP 3 and continue innitely.

4.5.6

Problems faced

The major problem was that where to place the sensor. It was done after many discussions.
4.6

SUN TRACKER

Sun is an abundant source of energy. The agriculture eld is exposed to sunlight


for plenty of time. Now, the project helps in to understand the concept of conservation
of energy by using the solar cell.
Extracting usable energy from sun was made possible by the discovery of photoelectric mechanism and subsequent development of the solar cell. In a eld or in agricultural areas far from reach of the city, the electrical energy supply would be insucient. So
in such cases, solar energy is the ecient way to meet the needs. By using solar panels, a
series of solar cells electrically connected, a DC voltage is generated which can be physically used on as a load. So as most of the sensors and the microcontroller are supplied
with voltages in the range of 5V to 12V, a solar panel producing a maximum output of
25V was chosen.
4.6.1

Components

Solar panel- max output of 25v and 5w power


Gear wheels
PIC 16F877A to control the rotation of the motor
DC gear motor
Gear wheels to reduce the speed of rotation of panel
L293D used as motor driver.
12V battery.

24

4.6.2

Overview

If the solar panel is kept strictly horizontal, in the morning and evening the angle
of incidence onto the panel would be about 90 degree. At such angle, the light gathering
ability of the cell is essentially zero resulting in no output. As the day progresses to
midday, the angle of incidence approaches zero, causing a steady increase in power until at
the point where the light incident on the panel is completely perpendicular, and maximum
power is obtained. As the day continues toward dusk, the reverse happens, and the
increasing angle causes the power to decrease again to minimum. From this background,
we see the need to maintain the maximum output power from the panel by maintaining
the angle of incidence as close to 0 degree as possible.
To increase the eciency of the panel, a solar tracker was designed based on
time such that the panel takes a specic degree of rotation in specic time. To reduce
the speed of rotation, gear wheels of the gear ratio 18:32 were chosen. Gear wheels were
obtained from scraps of a printer. A shaft was placed horizontally and solar panel was
xed to it. On one end, a gear motor was xed and gear wheels were attached to shaft of
the motor. The motor driver circuit was made using L293D.
To adjust the speed of rotation, a program was written inmikroC pro. As
the solar tracker is time-based, the motor should turn a specic degree in specic time.
In normal cases, the panel would sweep a specic degree of rotation from morning till
evening. After dusk, energy for the working of sensors would be taken from the 12V
battery which was stored from the solar energy. So, in order to increase the eciency of
the tracker, an ON-OFF mechanism was supplied to the motor driver circuit such that
the driver would turn on only for a short time in every hour or two so that the panel
covers a total of about 90 degree of rotation from morning to evening. At the evening,
the panel would take a complete 90 degree of anti-clockwise rotation at a single pulse.
The output of the solar panel was send to a rechargeable battery to charge it.
This battery can be used as a source of power supply.
4.6.3

Algorithm for sun tracker

1. Start the program.


2. The output port given to the motor would be made ON for 2sec and is then turned
OFF.
3. A delay of 3sec was given for every ON-OFF.
4. This step was continued for a count of 5. A clockwise rotation of 90 degree of the
panel was acquired in 5 steps.
5. A complete anti-clockwise rotation of 90 degree was made in a single step.
25

Figure 4.17: Various stages in the design of sun tracker


4.6.4

Problem faced

Several problems were faced during the design of the sun tracker. The sun tracker
was rst designed using a motor of 250 rpm, but it was unable to rotate the sun tracker.
Again 50 rpm motor was used, but it still showed the same result. Later 10rpm motor
was used along with the gear for the sun tracker to rotate along with the solar panel.
Gear adjustment was dicult, so nylon tape and cello tape were used for its alignment.

26

4.6.5

Circuit diagram for sun tracker

Figure 4.18: Circuit diagram for sun tracker

27

4.7

RF MODULE

RF module consist of transmitter and receiver. The module contains a transmitter


and receiver pair synchronised at 434 MHz frequency.

Figure 4.19: RF Module

4.7.1

Transmitter

A radio frequency transmitter is a device that transmits information by means of


radio waves. The signal intelligence was translated in terms of high frequency wave commonly termed as carrier wave. The process of intelligence translation into high frequency
is termed as modulation. All RF transmitters use one form of modulation or the other
for transmission of intelligence.
The features of the transmitter are
Wide input supply (2.5V-12V)
Easy to integrate (Data, Vcc and GND)
Device in deep sleep mode when Data pin is grounded
Very small dimension

4.7.2

RF receiver

A radio frequency receiver is a device that receives information send by the transmitter with the help of the antenna.The receiver receives the signal and send it to the
28

decoder.For the proper functioning of the device, the transmitter and receiver must operate synchronously
The features of the receiver are
Low power consumption (4mA)
Easy to integrate (Vcc, GND and Data)
Super regeneration design
Very small dimension

4.7.3

Working of RF module

The transmitter section consists of a transmitter module TWS 434A and a HT12D
decoder. The output of the sensors and anemometer which includes the surrounding
temperature, soil moisture leveland wind speed was given to the transmitter and was
transmitted through the transmitting antenna.
The receiver section consists of mainly the receiver module RWS 434A and
an HT12E encoder. The address logic of the encoder and decoder must match for data
transmission to take place. Ie, data synchronization must take place.The decoder receives
serial addresses and data from a programmed encoder that were transmitted by a carrier
using a RF medium. They compare the serial input data three times continuously with
their local addresses.

29

4.8

4.8.1

SERIAL COMMUNICATION

Components

RF module
FTDI chip
connection cable

4.8.2

Overview

The next part of the work was to transmit the sensor output to a nearby station
to verify the output in a computer. Serial communication is one of the easiest protocol
available. This part of the project was the place where most diculties were faced.
Some new computer's especially don't support older serial cables. So, now USB to serial
converter and serial to USB cables are available.
PIC microcontroller has serial communication module (USART) which operates
using CMOS logic levels which changes between +5V and 0V logic. All the sensor outputs
were calibrated in a single microcontroller using the dierent output ports available in the
micro controller. The PIC microcontroller has only one transmit and receive buer. So it
was our responsibility to read received data from PIC's receive buer(RCREG) as soon as
data arrived. RC6 was the transmit port of the micro controller. So all the sensor outputs
were copied to the transmission port in a certan delay so that outputs never overlapped.
4.8.3

Circuit diagram for data transmission

Figure 4.20: Circuit diagram for serial communication

30

Fig 4.20 gives the serial data transmission from one PIC to a distant computer.
As transmission to distant port was required, a RF transmission method was adapted.
RF transmitter and receiver module (TWS-434 and RWS-434) were used for wireless
transmission. The RF transmitter and receiver connection were independently checked
with the help of LED array and was found working.

Figure 4.21: Serial communication


So the RC6 port was connected to the input of the 4-pin transmitter module
and was transmitted. The output was obtained using a receiver kept at a distance. The
data out of the receiver was connected to RC7 port of the receiver micro controller. This
was the receiver buer of the microcontroller. This output was interfaced with a serial to
USB (FTDI chip) cable. The output was veried using USART terminal in mikroC and
was found working.
4.8.4

Problems faced

Serail communication was one of the dicult task. The input data was not available
at the output, only after several attempts the output was occupied. New Serial to USB
connector was required for its proper functioning. Later on, we decided to use the FTDI
chip.

31

Chapter 5
RESULT
Several experiments were done step by step and following results were obtained.
Soil moisture sensor was designed. It was seen that as water level in the soil
varies, the resistance across the nail varied. The variation of the moisture with the voltage
was tabulated. The output of the simulation of the program for which soil moisture is
medium is given in the gure below.

Figure 5.1: simulation result of moisture sensor


Rain sensor was later designed. When rain falls on the rain sensor, the circuit
becomes short. Similarly when the PCB becomes dry, the circuit was open.
After the designing both the sensor, temperature sensor was then designed. In
the above, as the temperature was varied the output of the temperature sensor was varied.
The variation in temperature was veried using a soldering iron.
32

Figure 5.2: simulation result of temperature sensor


Along with dierent sensors, anemometer was also designed. The anemometer
was rotating as the wind was blowing. Thus sensor unit along with anemometer was
veried and found working.
Later the control unit was designed step by step. Control unit includes the
valve, shield, exhaust and window. The control unit was interfaced using the PIC
16F877A. The program for the working of the soil moisture sensor was rst checked
and simulated using MiCro C. It is software for simulating the program to be burned on
to the PIC. The veried program was burned on to the PIC using the software PICkit 2
v2.61.
The program for the working of the soil moisture-valve, rain sensor-shield,
temperature sensor-exhaust fan, anemometer-window and solar tracker were veried using
MiCro C and was burnt on to the PIC using PICkit 2 v2.61.
The soil moisture was connected to valve via PIC. As the soil moisture was
low; the valve was open for 5sec . When the soil moisture was medium, the valve was
open for 3sec. Similarly when the soil moisture was high, the valve was completely closed.
An LCD screen placed near the PIC displayed the moisture content of the soil, i.e., low,
medium, or high depending upon the moisture level.
The rain sensor was connected to a shield via PIC. When water was poured
on to the rain senor, the PIC activated the shield and a sheet was rolled over the eld.
Similarly when the rain was dry, the PIC activates the PIC so that sheet was wrapped in
to its initial state.
The temperature sensor was connected to the exhaust fan via PIC. An LCD
screen was placed near the PIC which displayed the surrounding temperature. As the
temperature exceeded the critical temperature, the exhaust fan became working. When
the temperature was reduced below the critical temperature, the fan was switched OFF.
33

Thus temperature senor-exhaust fan was veried and found working.


The anemometer was made to activate the window depending upon the anemometer output. It was seen that as the wind speed increased too much, the window frame
was adjusted such that the window frame was perpendicular to the ground. Similarly
when the wind speed was low, the window frame was readjusted such that the frame was
parallel to the ground.
The above all experiments were assembled together and all the setup were
working as mentioned above.
Later the sensor+anemometer output was supposed to be sent to the monitor
placed at farther station. The RF module used for transmission of the data was checked.
First sample data was made to send from the transmitter and it was seen that the above
data was available at the receiver. Hence RF transmission was checked and veried.
The data (output of sensor and the anemometer) was sent to the monitor using
serial communication. For the proper working of serial communication, FDTI chip was
used. The sensor unit data was thus seen in the monitor.
Finally, the solar tracker was installed as a part of conservation of energy. The
solar tracker when connected via PIC was rotating with a xed time period. The solar
cell was placed over the sun tracker. Thus the solar cell rotated along with the sun tracker
and hence it was veried and found working. The sun tracker was also placed near the
eld.
Thus a working model of the project was obtained and found working.

34

Chapter 6
CONCLUSION AND FUTURE
DEVELOPMENTS
This project 'Control of Environmental parameters in a Greenhouse' is a very
helpful idea in the modernized way of agriculture. Here, most of the environmental
parameters such as wind ,soil moisture,rain were successfully monitored and were handled
in such a way that they don't aect the cultivation adversely. By this method, we could
eciently utilize the resources so that no wastage occurs.
In the case of soil moisture sensors, excess watering and scarcity of water in
the soil can be easily monitored and can be controlled. The variability of soil type across
one's property will aect the number of units required. If we are placing the soil moisture
sensors at dierent levels, then the growth of the root of the plant can be monitored by
constantly monitoring the moisture content in dierent levels.
Similarly in the case of wind speed detection, If two anemometers are put at
dierent heights on the same mast can provide useful additional information about the
wind shear - the dierence in wind speed at dierent heights. It can also provide useful
information about the intensity of any wind turbulence at the site.We can also measure
wind direction. We can do the above by using a separate weathervane (also called a wind
vane or direction indicator) although some anemometers include a direction indicator.
In the case of rain sensors, as the shield is provided , rain water harvesting
technique could be eectively utilized as the conserved water could be utilized for irrigation
methods in the later stages.
In the communication section, we can use a GSM modem to send essential
information to our mobile phones and if we are using a transceiver, we can send the
control signals from the computer to the controlling section. As a part of reducing the
cost of the project, we did it using a RF transmitter and receiver.

35

Chapter 7
APPENDIX
The program used for temperature sensor-exhaust fan,soil moisture sensor-valve and
anemometer-window is shown below.
sbit LCD_RS at RD2_bit;
sbit LCD_EN at RD3_bit;
sbit LCD_D4 at RD4_bit;
sbit LCD_D5 at RD5_bit;
sbit LCD_D6 at RD6_bit;
sbit LCD_D7 at RD7_bit;
sbit LCD_RS_Direction at TRISD2_bit;
sbit LCD_EN_Direction at TRISD3_bit;
sbit LCD_D4_Direction at TRISD4_bit;
sbit LCD_D5_Direction at TRISD5_bit;
sbit LCD_D6_Direction at TRISD6_bit;
sbit LCD_D7_Direction at TRISD7_bit;
unsigned char ch;
unsigned int adc_rd; // Declare variables
char *text,*low="moisture low",*med="moisture medium",*high="moisture high";
long tlong;
unsigned short DD0, DD1, DD2, DD3;
unsigned short pulserate,pulsecount;
long int t=0,ag=0;
void main(){
uart1_init(2400);
while(1){
INTCON = 0; // All interrupts disabled
TRISC = 0x00;
PORTC = 0X00;
36

TRISA = 0x04;
Lcd_Init(); // LCD display initialization
Lcd_Cmd(_LCD_CURSOR_OFF); // LCD command (cursor o)
Lcd_Cmd(_LCD_CLEAR); // LCD command (clear LCD)
text = "temperature sensor";
Lcd_Out(1,1,text);
text = "temperature:";
Lcd_Out(2,1,text);
uart1_write_text(" Temperature ");
ADCON1 = 0x82; // A/D voltage reference is VCC
TRISA = 0xFF; // All port A pins are congured as inputs
Delay_ms(2000);
text = "temp:";
adc_rd = ADC_Read(2);
Lcd_Out(2,1,text);
tlong = (long)adc_rd * 5000; // Convert the result in millivolts
tlong = tlong / 1023; // 0..1023 -> 0-5000mV
ch = tlong / 1000; // Extract volts (thousands of millivolts)
uart1_write(48+ch); // from result
Lcd_Chr_cp(48+ch); // Write result in ASCII format
ch = (tlong / 100)
Lcd_Chr_CP(48+ch); // Write result in ASCII format
uart1_write(48+ch);
ch = (tlong / 10)
uart1_write(48+ch);
Lcd_Chr_CP(48+ch); // Write result in ASCII format
Lcd_Chr_CP('.');
uart1_write('.');
ch = tlong
uart1_write(48+ch);
Lcd_Chr_CP(48+ch); // Write result in ASCII format
Lcd_Chr_CP('C');
uart1_write('C');
uart1_write_text("");
Delay_ms(500);
37

if(tlong >= 320)


{

PORTC.F0=1;
}

else
{

PORTC.F0=0;
}

delay_ms(5000);
Lcd_Init(); // LCD display initialization
Lcd_Cmd(_LCD_CURSOR_OFF); // LCD command (cursor o)
Lcd_Cmd(_LCD_CLEAR); // LCD command (clear LCD)

text = "moisture sensor";


Lcd_Out(1,1,text);
uart1_write_text(text); // display moisture sensor on lcd
text = "moisture:";
Lcd_Out(2,1,text); // display "moisture: " on lcd
ADCON1 = 0x82; // A/D voltage reference is VCC
TRISA = 0xFF; // All port A pins are congured as inputs

adc_rd = ADC_Read(3); // ADC PROCESS TO


tlong = (long)adc_rd * 5000; // GET ANALOG OUTPUT FROM
tlong = tlong / 1023; // SENSOR
Delay_ms(1);
text = "moisture sensor";
Lcd_Out(1,1,text);
delay_ms(2000);
uart1_write_text(text);
if(tlong <= 1666) // IF MOISTURE LOW
{

Lcd_Cmd(_LCD_CLEAR);
text = " moisture: low"; // DISPLAY " MOISTURE LOW"
lcd_out(2,1,text);
38

uart1_write_text(text);
PORTC.F1=1; // VALVE ON
Delay_ms(5000); // 3S DELAY
PORTC.F1 = 0;
Delay_ms(2000);
}

else if(tlong>=1667 tlong <= 3766)


{

Lcd_Cmd(_LCD_CLEAR);
text = "moisture sensor";
Lcd_Out(1,1,text);
text = " moisture: medium";
lcd_out(2,1,text);
uart1_write_text(text);
PORTC.F1 = 1;
DELAY_MS(2000);
PORTC.F1 = 0;
Delay_ms(5000);
}

else
{

text = " moisture : high ";


lcd_out(2,1,text);
uart1_write_text(text);
PORTC.F1 = 0;
delay_ms(3000);
}

PORTA = 0; // Reset port A


TRISA = 0xFF; // All portA pins are congured as inputs
TRISB = 0X00;
Lcd_Init(); // LCD display initialization
Lcd_Cmd(_LCD_CURSOR_OFF); // LCD command (cursor o)
Lcd_Cmd(_LCD_CLEAR); // LCD command (clear LCD)
text = "ANEMOMETER";
39

Lcd_Out(1,1,text);
text = "RPM : ";
uart1_write_text(text);
OPTION_REG.F5 = 1; // Counter TMR0 receives pulses through the RA4 pin
OPTION_REG.F3 = 1; // Prescaler rate is 1:1
text = " WIND RPM";
Lcd_Out(1,1,text);
text = " RPM : ";
Lcd_Out(2,1,text);
TMR0 = 0; // Reset timer/counter TMR0
delay_ms(5000);
text = " RPM : ";
delay_ms(5000);

uart1_write_text(text);
pulsecount = TMR0;
pulserate = pulsecount*4;
DD0 = pulserate
DD1 = (pulserate/10)
DD2 = pulserate/100;
Lcd_Chr_CP(48+DD2);
Lcd_Chr_CP(48+DD1);
Lcd_Chr_CP(48+DD0);
uart1_write(48+DD2);
uart1_write(48+DD1);
uart1_write(48+DD0);
uart1_write(4);
delay_ms(2000);
if(pulserate>=20)
{ t=1;
portc.f2=0;
portc.f3 =1;
delay_ms(200);
portc.f2=0;
portc.f3=0;
}

else if(t==1 pulserate<20)


{

t=0;
40

portc.f2=1;
portc.f3=0;
delay_ms(200);
if(portb.f3 == 1){
ag =1;
portc.f4 = 1;
}

else if(portb.f3 == 0 ag == 1){


portc.f5 = 1;
ag = 0; }
}
}
}

The program used for sun tracker working is shown below.


SUN TRACKER PROGRAM
int k;
void main() {
while(1) {
TRISD = 0X00;
PORTD = 0X00;
for(k = 0;k<6;k++)
{

PORTD.F0 = 1;
PORTD.F1 = 0;
Delay_ms(500);
PORTD = 0X00;
Delay_ms(2000);
}

PORTD.F0 = 0;
PORTD.F1 = 1;
Delay_ms(3000);
PORTD = 0X00;
delay_ms(2000);
}}

41

A pinout diagram of the PIC 16F877A is shown below.

Figure 7.1: PIC 16F877A

42

References
[1] Yang Shulian, Zhang Yu-"Wireless Measurement and Control System for Environmental Parameters in Greenhouse"-2010 International Conference on Measuring
Technology and Mechatronics Automation
[2] Yunseop (James) Kim, Member, IEEE, Robert G. Evans, and William M. Iversen"Remote Sensing and Control of an Irrigation System "Using a Distributed Wireless
Sensor Network"-IEEE TRANSACTIONS ON INSTRUMENTATION AND MEA-

SUREMENT, VOL. 57, NO. 7, JULY 2008


[3] "Wind speed measurement and use of cup anmometry"- IEEE edition 1999
[4] www.makezine.com
[5] www.nationalstemcenter.com
[6] www.engineersgarage.com
[7] www.cytrontechnologies.com

43

Potrebbero piacerti anche