Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
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
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
21
22
22
23
24
24
24
25
25
26
27
28
28
28
29
30
30
30
30
31
5 RESULT
32
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
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
5
9
10
11
12
12
14
15
16
17
18
19
20
21
22
23
23
26
27
28
30
31
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
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
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.
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
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
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.
4.1.3
Principle of operation
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.
10
4.1.4
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
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
13
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
4.3.2
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
4.3.4
Problems faced
of time.
16
4.4
Components
LM 35
Exhaust fan
PIC
17
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
The ow chart of the program for temperature conrol is given in g 4.11
4.4.4
Problems faced
the sensors. Due to over heating, sometimes the LCD display didn't show any
output.
19
4.4.5
20
4.5
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.
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.
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
started.
Counting started.
23
The count value is multiplied by 4 to get the rotations per minute value and it is
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
Components
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
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
27
4.7
RF MODULE
4.7.1
Transmitter
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
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.
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.
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
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)
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);
}
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
{
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;
}
t=0;
40
portc.f2=1;
portc.f3=0;
delay_ms(200);
if(portb.f3 == 1){
ag =1;
portc.f4 = 1;
}
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
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-
43