Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
INTRODUCTION
1.1 INTRODUCTION
Our aim is to improve the control of indoor climate key parameters of greenhouse
using fuzzy system to achieve significant result.
The indoor climate control system is based on fuzzy controllers that manage the
various decisions to achieve an optimal greenhouse climate depending on weather,
meteorological data and user instructions.
The existing system is implemented for remote monitoring and control of greenhouse
parameters with the help of sensors and GSM communication. It overcomes the
disadvantages of wired constraints such as complicated wiring, difficult maintenance and
distance, to monitor and control the applications. The application will have embedded system
which consists of ARM7 microcontroller, real time operating system, sensors, GSM modem
and control devices to monitor the environmental parameters condition namely temperature,
humidity, CO2 concentration and light intensity in greenhouse. The threshold levels of the
sensors will be set with the help of push button keys or remotely via GSM communication
mode.
1
1.3 SHORTCOMING OF EXISTING SYSTEM
In the existing system automatic controlling process takes place by fully based on
ARM7 microcontroller circuit. In this process the user have to send the monitoring and
control commands to control the parameters of greenhouse each and every time. The quick
and frequent responses are not possible. When compared to fuzzy based system control
decision making level in ARM7 microcontroller is not precise and fast.
1.5 OBJECTIVE
The main objective of our project is to monitor and control the indoor climate
of greenhouse using fuzzy as shown in Figure1.1.
To reduce the complexity, cost and energy consumption. And to resemble the
human decision making ability and to get precise solutions.
2
1.6 LITERATURE SURVEY
1. Nagesh Kumar D.N designed a system using ARM microcontroller. In this method,
the user has to send command message to the controller.
The thesis is organised in a way that it contain five chapters followed by references and
appendix.
3
CHAPTER 2
4
2.2 EXPLANATION OF BLOCK DIAGRAM
Green house (Polyhouse) farming is farming under full controlled condition, temperature,
humidity, water, fertilizers everything is automated. Vegetables and flowers are the normal
corps cultivated in a Polyhouse. Mostly with flower cultivation you can make lakhs of profit.
2.2.2 Sensors
Sensors used in this project are DHT11, LDR , MQ7. DHT11 sensor is used get humidity
and temperature values. MQ7 is used here to get the CO2 data. LDR is used to get the light
data. Humidity and temperature data are digital type. CO2 and light data are analog type.
2.2.3 Arduino
Need for Arduino in this project is to transmit the acquired data in the green house to the
control computer via ZigBee and to receive the output values of the fuzzy via ZigBee.
2.2.4 XBee
It is used to transmit the sensor output values to the control computer and receive the input
values for the output devices from control computer.
Control computer is used to set the optimum range for temperature, humidity, CO 2,
illuminations using fuzzy logic using MATLAB.
Output devices used here are 5V DC fan (2 numbers). One fan is used to control humidity
and temperature. Another fan is used for controlling CO2 level. Another incandescent is used
for light illumination level.
5
CHAPTER 3
HARDWARE IMPLEMENTATION
6
3.2 ARDUINO HARDWARE
Over the years Arduino has been the brain of thousands of projects, from everyday
objects to complex scientific instruments. A worldwide community of makers - students,
hobbyists, artists, programmers, and professionals - has gathered around this open-source
platform, their contributions have added up to an incredible amount of accessible
knowledge that can be of great help to novices and experts alike.
There are many other microcontrollers and microcontroller platforms available for
physical computing. Parallax Basic Stamp, Netmedia's BX-24, Phidgets, MIT's Handyboard,
and many others offer similar functionality. All of these tools take the messy details of
microcontroller programming and wrap it up in an easy-to-use package. Arduino also
simplifies the process of working with microcontrollers, but it offers some advantage for
teachers, students, and interested amateurs over other systems:
Cross-platform - The Arduino Software (IDE) runs on Windows, Macintosh OSX, and Linux
operating systems. Most microcontroller systems are limited to Windows.
Simple, clear programming environment - The Arduino Software (IDE) is easy-to-use for
beginners, yet flexible enough for advanced users to take advantage of as well. For teachers,
it's conveniently based on the Processing programming environment, so students learning to
program in that environment will be familiar with how the Arduino IDE works.
Open source and extensible software - The Arduino software is published as open source
tools, available for extension by experienced programmers. The language can be expanded
through C++ libraries, and people wanting to understand the technical details can make the
7
leap from Arduino to the AVR C programming language on which it's based. Similarly, you
can add AVR-C code directly into your Arduino programs if you want to.
Open source and extensible hardware - The plans of the Arduino boards are published under
a Creative Commons license, so experienced circuit designers can make their own version of
the module, extending it and improving it. Even relatively inexperienced users can build
the breadboard version of the module in order to understand how it works and save money.
Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data. On the
Arduino Diecimila, these pins are connected to the corresponding pins of the FTDI USB-to-
TTL Serial chip. On the Arduino BT, they are connected to the corresponding pins of
the WT11 Bluetooth module. On the Arduino Mini and LilyPad Arduino, they are intended
for use with an external TTL serial module (e.g. the Mini-USB Adapter).
External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on a low
value, a rising or falling edge, or a change in value.
8
PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite() function. On
boards with an ATmega8, PWM output is available only on pins 9, 10, and 11.
BT Reset: 7. (Arduino BT-only) Connected to the reset line of the bluetooth module.
SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication,
which, although provided by the underlying hardware, is not currently included in the
Arduino language.
LED: 13. On the Diecimila and LilyPad, there is a built-in LED connected to digital pin 13.
When the pin is HIGH value, the LED is on, when the pin is LOW, it's off.
The analog input pins support 10-bit analog-to-digital conversion (ADC) using
the analogRead() function. Most of the analog inputs can also be used as digital pins: analog
input 0 as digital pin 14 through analog input 5 as digital pin 19. Analog inputs 6 and 7
(present on the Mini and BT) cannot be used as digital pins.
I2C: 4 (SDA) and 5 (SCL). Support I2C (TWI) communication using the Wire
library (documentation on the Wiring website).
VIN :(sometimes labelled "9V"). The input voltage to the Arduino board when it's using an
external power source (as opposed to 5 volts from the USB connection or other regulated
power source). You can supply voltage through this pin, or, if supplying voltage via the
power jack, access it through this pin. Note that different boards accept different input
voltages ranges, please see the documentation for your board. Also note that the LilyPad has
no VIN pin and accepts only a regulated input.
o 5V. The regulated power supply used to power the microcontroller and other
components on the board. This can come either from VIN via an on-board
regulator, or be supplied by USB or another regulated 5V supply.
o 3.3V (Diecimila-only) A 3.3 volt supply generated by the on-board FTDI chip.
GND: Ground pins.
Other pins:
AREF. Reference voltage for the analog inputs. Used with analogReference().
9
Reset. (Diecimila-only) Bring this line LOW to reset the microcontroller. Typically used to
add a reset button to shields which block the one on the board.
This DHT11 Temperature & Humidity Sensor features a temperature & humidity
sensor complex with a calibrated digital signal output. By using the exclusive digital-signal-
acquisition technique and temperature & humidity sensing technology, it ensures high
reliability and excellent long-term stability. This sensor includes a resistive-type humidity
measurement component and an NTC temperature measurement component, and connects to
a highperformance 8-bit microcontroller, offering excellent quality, fast response, anti-
interference ability and cost-effectiveness. Each DHT11 element is strictly calibrated in the
laboratory that is extremely accurate on humidity calibration. The calibration coefficients are
stored as programmes in the OTP memory, which are used by the sensor’s internal signal
detecting process. The single-wire serial interface makes system integration quick and easy.
Its small size, low power consumption and up-to-20 meter signal transmission making it the
best choice for various applications, including those most demanding ones. The component is
4-pin single row pin package. It is convenient to connect and special packages can be
provided according to users’ request.
10
3.3.1. Technical Specifications
Power and Pin DHT11’s power supply is 3-5.5V DC. When power is supplied to the
sensor, do not send any instruction to the sensor in within one second in order to pass the
unstable status. One capacitor valued 100nF can be added between VDD and GND for power
filtering. 5. Communication Process: Serial Interface (Single-Wire Two-Way) Single-bus
data format is used for communication and synchronization between MCU and DHT11
sensor. One communication process is about 4ms. Data consists of decimal and integral parts.
A complete data transmission is 40bit, and the sensor sends higher data bit first.
Data format: 8bit integral RH data + 8bit decimal RH data + 8bit integral T data +
8bit decimal T data + 8bit check sum. If the data transmission is right, the check-sum should
be the last 8bit of "8bit integral RH data + 8bit decimal RH data + 8bit integral T data + 8bit
decimal T data".
When light is incident on a photocell it usually takes about 8 to 12 ms for the change
in resistance to take place, while it takes one or more seconds for the resistance to rise back
again to its initial value after removal of light. This phenomenon is called as resistance
recovery rate. This property is used in audio compressors. Also, LDR’s are less sensitive than
11
photo diodes and photo transistor. (A photo diode and a photocell (LDR) are not the same, a
photo-diode is a p-n junction semiconductor device that converts light to electricity, whereas
a photocell is a passive device, there is no p-n junction in this nor it “converts” light to
electricity). Types of Light Dependent Resistors: Based on the materials used they are
classified as:
1. Intrinsic photo resistors (Un doped semiconductor): These are made of pure
semiconductor materials such as silicon or germanium. Electrons get excited from
valance band to conduction band when photons of enough energy fall on it and
number charge carriers is increased.
2. Extrinsic photo resistors: These are semiconductor materials doped with impurities
which are called as dopants. Theses dopants create new energy bands above the
valence band which are filled with electrons.
3. Hence this reduces the band gap and less energy is required in exciting them.
Extrinsic photo resistors are generally used for long wavelengths.
LDR’s have low cost and simple structure. They are often used as light sensors. They
are used when there is a need to detect absences or presences of light like in a camera light
meter. Used in street lamps, alarm clock, burglar alarm circuits, light intensity meters, for
counting the packages moving on a conveyor belt, etc.
12
3.5 MQ-7 CO SENSOR
The MQ-7 is a Carbon Monoxide (CO) sensor suitable for sensing CO concentrations
in the air. It can detect CO-gas concentrations anywhere from 20 to 2000 ppm.It make
detection by method of cycle high and low temperature, and detect CO at low temperature.It
is widely used in domestic CO gas leakage alarm, industrial CO gas alarm and portable CO
gas detector.
3.5.1 Specifications
Vcc to 5V
GND to GND
A0 to Analog0
13
3.6 L293D
L293D is a typical Motor driver or Motor Driver IC which allows DC motor to drive
on either direction. L293D is a 16-pin IC which can control a set of two DC motors
simultaneously in any direction. It means that you can control two DC motor with a single
L293D IC. Dual H-bridge Motor Driver integrated circuit (IC).
It works on the concept of H-bridge. H-bridge is a circuit which allows the voltage to
be flown in either direction. As you know voltage need to change its direction for being able
to rotate the motor in clockwise or anticlockwise direction, Hence H-bridge IC are ideal for
driving a DC motor.
In a single L293D chip there are two h-Bridge circuit inside the IC which can rotate
two dc motor independently. Due its size it is very much used in robotic application for
controlling DC motors. Figure 3.6 shows the pin diagram of a L293D motor controller.
There are two Enable pins on l293d. Pin 1 and pin 9, for being able to drive the motor,
the pin 1 and 9 need to be high. For driving the motor with left H-bridge you need to enable
pin 1 to high. And for right H-Bridge you need to make the pin 9 to high. If anyone of the
either pin1 or pin9 goes low then the motor in the corresponding section will suspend
working. It’s like a switch.
14
3.7 TEMPERATURE CONTROLLERS
There are three primary cooling devices in most greenhouses. These are the vent
system, exhaust fan, swamp cooler. Some greenhouses may make use of air conditioners and
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 full fresh
air in through the rear vent. They are 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 temperature will continue to rise.
15
3.8 CONTROLLING ILLUMINATION
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 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 colours but cool-white lamps are the most common. High intensity(1500ma)
fluorescent tubes that require higher wattage are also commonly used to reach 2000
foot candles.
Incandescent lamps 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.
16
CHAPTER 4
SOFTWARE IMPLEMENTATION
The Arduino Software (IDE) allows you to write programs and upload them to your
board. The popularity of Arduino is steadily increasing and it is fast becoming the
microcontroller of choice for students, hobbyists and smaller companies. The Arduino
website offers free resources and tutorials as well as a language reference to help you
understand the code and syntax. All the Arduino (and most of the clone boards) can use the
Arduino software.
The Arduino interface is pretty “bare-bones”. When you load the software, the first
screen you will see is a white window shown in Figure1. Arduino projects are called
“sketches” and when you start a new sketch, several additional files are also created.
The main headings are “File” “Edit” “Sketch” “Tools” “Help” and several shortcut
icons beneath “Verify”, “Upload”, “New”, “Open”, “Save”, and at the far right, the “Serial
Monitor”. Note that all these icons are also available from the main menus.
17
4.1.2 Procedure to connect to the board
18
4.2.1 Functions
When creating a MATLAB function, the name of the file should match the name of
the first function in the file. Valid function names begin with an alphabetic character, and
can contain letters, numbers, or underscores. Functions are also often case sensitive. An
anonymous function is like an inline function in traditional programming languages,
defined within a single MATLAB statement. It consists of a single MATLAB expression
and any number of input and output arguments. You can define an anonymous function
right at the MATLAB command line or within a function or script.
Creating script
Highlight commands from the Command History, right-click, and select Create Script.
Click the New Script button on the Home tab.
Use the edit function. For example, edit new_file_name creates (if the file does not
exist) and opens the file new_file_name.
19
4.3 ZIGBEE MODULE
The technology defined by the ZigBee specification is intended to be simpler and less
expensive than other wireless personal area networks (WPANs), such as Bluetooth or Wi-Fi.
Applications include wireless light switches, electrical meters with in-home-displays, traffic
management systems, and other consumer and industrial equipment that require short-range
low-rate wireless data transfer.
Its low power consumption limits transmission distances to 10–100 meters line-of-
sight, depending on power output and environmental characteristics. ZigBee devices can
transmit data over long distances by passing data through a mesh network of intermediate
devices to reach more distant ones. ZigBee is typically used in low data rate applications that
require long battery life and secure networking (ZigBee networks are secured by 128 bit
symmetric encryption keys.) ZigBee has a defined rate of 250 kbit/s, best suited for
intermittent data transmissions from a sensor or input device.
ZigBee is a low-cost, low-power, wireless mesh network standard targeted at the wide
development of long battery life devices in wireless control and monitoring applications.
Zigbee devices have low latency, which further reduces average current. ZigBee chips are
typically integrated with radios and with microcontrollers that have between 60-256 KB of
flash memory. ZigBee operates in the industrial, scientific and medical (ISM) radio bands:
2.4 GHz in most jurisdictions worldwide; 784 MHz in China, 868 MHz in Europe and 915
20
MHz in the USA and Australia. Data rates vary from 20 kbit/s (868 MHz band) to 250 kbit/s
(2.4 GHz band).
The ZigBee network layer natively supports both star and tree networks, and generic
mesh networking. Every network must have one coordinator device, tasked with its creation,
the control of its parameters and basic maintenance. Within star networks, the coordinator
must be the central node. Both trees and meshes allow the use of ZigBee routers to extend
communication at the network level.
ZigBee builds on the physical layer and media access control defined in IEEE
standard 802.15.4 for low-rate WPANs. The specification includes four additional key
components: network layer, application layer, ZigBee device objects (ZDOs) and
manufacturer-defined application objects which allow for customization and favour total
integration. ZDOs are responsible for some tasks, including keeping track of device roles,
managing requests to join a network, as well as device discovery and security.
ZigBee Coordinator (ZC) The most capable device, the Coordinator forms the root
of the network tree and might bridge to other networks. There is precisely one ZigBee
Coordinator in each network since it is the device that started the network originally (the
ZigBee Light Link specification also allows operation without a ZigBee Coordinator, making
it more usable for over-the-shelf home products). It stores information about the network,
including acting as the Trust Centre & repository for security keys.
ZigBee Router (ZR) As well as running an application function, a Router can act as
an intermediate router, passing on data from other devices.
21
ZigBee End Device (ZED) Contains just enough functionality to talk to the parent
node (either the Coordinator or a Router); it cannot relay data from other devices. This
relationship allows the node to be asleep a significant amount of the time thereby giving long
battery life. A ZED requires the least amount of memory, and, therefore, can be less
expensive to manufacture than a ZR or ZC.
The current ZigBee protocols support beacon and non-beacon enabled networks. In
non-beacon-enabled networks, an unslotted CSMA/CA channel access mechanism is used. In
this type of network, ZigBee Routers typically have their receivers continuously active,
requiring a more robust power supply. However, this allows for heterogeneous networks in
which some devices receive continuously while others only transmit when an external
stimulus is detected. The typical example of a heterogeneous network is a wireless light
switch: The ZigBee node at the lamp may constantly receive, since it is connected to the
mains supply, while a battery-powered light switch would remain asleep until the switch is
thrown. The switch then wakes up, sends a command to the lamp, receives an
acknowledgment, and returns to sleep. In such a network the lamp node will be at least a
ZigBee Router, if not the ZigBee Coordinator; the switch node is typically a ZigBee End
Device.
In general, the ZigBee protocols minimize the time the radio is on, so as to reduce
power use. In beaconing networks, nodes only need to be active while a beacon is being
transmitted. In non-beacon-enabled networks, power consumption is decidedly asymmetrical.
Some devices are always active while others spend most of their time sleeping.
Except for the Smart Energy Profile 2.0, ZigBee devices are required to conform to
the IEEE 802.15.4-2003 Low-Rate Wireless Personal Area Network (LR-WPAN) standard.
The standard specifies the lower protocol layers—the physical layer (PHY), and the Media
Access Control portion of the data link layer (DLL). The basic channel access mode is
22
"carrier sense, multiple access/collision avoidance" (CSMA/CA). That is, the nodes talk in
the same way that humans converse; they briefly check to see that no one is talking before he
or she start, with three notable exceptions. Beacons are sent on a fixed timing schedule and
do not use CSMA. Message acknowledgments also do not use CSMA. Finally, devices in
beacon-enabled networks that have low latency real-time requirements may also use
Guaranteed Time Slots (GTS), which by definition do not use CSMA.
XCTU
XCTU is a free, multi-platform application compatible with Windows, MacOS and Linux. It
provides graphical network view for simple wireless network configuration and architecture.
API Frame Builder is a simple development tool for quickly building XBee API frames.
Firmware Release Notes Viewer allows users to explore and read firmware release notes.
Installing XCTU
Once XCTU has been downloaded, the next step is to install the program. When the program
asks for updating from Digi, we must answer ‘yes’ so as to download all the firmware
versions for all the XBee modules.
Configuring XCTU
When XCTU has been properly installed, the Waspmote Gateway can be connected to the
computer. It will be recognized as a ‘USB Serial Port’. We have to know the COM number
given to this device in order to specify it in the XCTU.
23
Finally, we launch XCTU and the program will start. A window like the one below will
appear, showing the different functions and the different COM ports detected.
Place the XBee you need to configure in the Gateway. Then connect the Gateway to a
USB port in your PC.
Run the XCTU application, press the button “Discover radio modules connected”, select
the appropriate communication port and configure it as shown below in figure 4.4
,4.5,4.6,4.7,4.8,4.9,4.10,4.11,4.12,4.13,4.14.
24
Figure 4.4 Discovering devices-1
25
The application will start to look for different devices connected and will deliver a
message similar to this one:
It is possible that XCTU asks you to do a reset of the XBee in this step (or in the next steps).
To do that, just press the button “RST” in your Gateway for 1 or 2 seconds.
26
Then go to the Configuration Working mode and click to select the device. We must
check each parameter first.
27
The PAN ID (ID):
28
The KY parameter (if needed). It must be set as hexadecimal key:
29
The API options:
1. If you set to 1 the JV parameter (in ZigBee End Devices/Routers) and write it, after
rebooting the radio module, it will verify the Coordinator (if it has been configured) is
on its operating channel when joining or coming up from a power cycle. If a
coordinator is not detected, the router will leave its current channel and attempt to join
a new PAN. This feature can be useful when several ZigBee End Device or Router
have not been configured yet; this way you can get them connected to an existing
network in a semi-automatic way. If JV=0, the router will continue operating on its
current channel even if a coordinator is not detected.
2. If you need to change your XBees configuration to the values by default set by Digi
(NOT the same values by default that Libelium sets), you can do it in XCTU. Note it
is risky since you could let the XBee without communication. You can just press the
button ‘Tools’, then ‘XBee Recovery’, select the product family of your device and
after that you will probably have to reset the XBee. You can read again to check the
change.
30
4.3.3 Arduino serial communication with ZigBee module
4.3.4 ZigBee to pc
ZigBee connected to PC via a standard USB cable forms the receiving circuit.The schematic
of zigBee with usb-plug in is shown in figure 4.16.
31
4.4 INTRODUCTION TO FUZZY EXPERT SYSTEM
A fuzzy interface system(FIS) is a system that uses fuzzy set theory to map
inputs(features in the case of fuzzy classification) to outputs (classes in the case of fuzzy
classification).
4.4.1 Fuzzification
The purpose of fuzzification is to map the inputs from a set of sensors (or features of
those sensors such as amplitude or spectrum) to values from 0 to 1 using a set of input
membership functions. In the example shown in Figure 4.17, there are two inputs, x0 and
y0 shown at the lower left corner. These inputs are mapped into fuzzy numbers by drawing a
line up from the inputs to the input membership functions above and marking the intersection
point.
Figure 4.17 A two input, two rule Mamdani FIS with crisp inputs
32
energy coming from the back of the forearm. The membership functions could then represent
"large" amounts of tension coming from a muscle or "small" amounts of tension. When
choosing the input membership functions, the definition of what we mean by "large" and
"small" may be different for each input.
Fuzzy interference system consists of two parts i.e. rule base and knowledge
base.Knowledge Base contains relationship between input and output variables.Rule base
contains relationship between input and output variables.Rule base contains relationship
between input and output expressed as if-then statement.
Fuzzy rules are a collection of linguistic statements that describe how the FIS should
make a decision regarding classifying an input or controlling an output. Fuzzy rules are
always written in the following form:
There would have to be membership functions that define what we mean by high
temperature (input1), high humidity (input2) and a hot room (output1). This process of taking
an input such as temperature and processing it through a membership function to determine
what we mean by "high" temperature is called fuzzification. Also we must define what we
mean by "and" / "or" in the fuzzy rule. This is called fuzzy combination. Combining outputs
into an output Distribution
The outputs of all of the fuzzy rules must now be combined to obtain one fuzzy output
distribution. This is usually, but not always, done by using the fuzzy "or".
33
Consequence
1. Computing the rule strength by combining the fuzzified inputs using the fuzzy combination
process
Fuzzy Inputs
Figure 4.18 shows a modification of the Mamdani FIS where the input y0 is fuzzy, not crisp.
This can be used to model inaccuracies in the measurement. For example, we may be
measuring the output of a pressure sensor. Even with the exact same pressure applied, the
sensor is measured to have slightly different voltages. The fuzzy input membership function
models this uncertainty. The input fuzzy function is combined with the rule input
membership function by using the fuzzy "and" as shown in Figure 4.18.
Figure 4.18 A two Input, two rule Mamdani FIS with a fuzzy input
34
4.4.3 Defuzzification of Output Distribution
In many instances, it is desired to come up with a single crisp output from a FIS. For
example, if one was trying to classify a letter drawn by hand on a drawing tablet, ultimately
the FIS would have to come up with a crisp number to tell the computer which letter was
drawn. This crisp number is obtained in a process known as defuzzification. There are two
common techniques for defuzzifying.
1. Center of mass This technique takes the output distribution and finds its center of mass to
come up with one crisp number. This is computed as follows:
where z is the center of mass and uc is the membership in class c at value zj. An example
outcome of this computation is shown in Figure 4.19.
35
2. Mean of maximum This technique takes the output distribution and finds its mean of
maxima to come up with one crisp number. This is computed as follows:
where z is the mean of maximum, zj is the point at which the membership function is
maximum, and l is the number of times the output distribution reaches the maximum level.
An example outcome of this computation is shown in Figure 4.20.
In this system we use mamdani interface system in fuzzy logic. The input parameters
are temperature, humidity, CO2 level and light level. The output of fuzzy are speed of the
vent, brightness of illumination and speed of cooling fan. These data is corresponding to a
greenhouse cultivating tomato as its crop inside.
36
Figure 4.21 Fuzzy toobbox
The rules are designed in such a way that the optimum conditions for plant growth is
ensured. The given rules and input an output of fuzzy are stored in a .FIS file. This file is then
evaluated in MATLAB script.
37
4.5 ALGORITHM
38
4.6 FLOW CHART
39
CHAPTER 5
5.1 CONCLUSION
In this work, a smart fuzzy based greenhouse monitoring and control was
developed.
The fuzzy logic system were involved to manage the indoor climate with
particular attention to the effectiveness, the energy use and production costs.
This, allows a real time data access, reduce the complexity.
Future enhancement is part of all products life cycles. This list our some missing
things in the current system. It also indicates adding more features to the system. Some of
them are listed below
40