0% found this document useful (0 votes)
110 views78 pages

Mini Project Greenhouse1.1

The document discusses the design and implementation of a greenhouse monitoring and control system using an Arduino microcontroller. It collects data on environmental parameters like temperature, humidity, light, and soil moisture from various sensors. The Arduino then processes this data to automatically control and maintain the greenhouse conditions within an optimal range.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
110 views78 pages

Mini Project Greenhouse1.1

The document discusses the design and implementation of a greenhouse monitoring and control system using an Arduino microcontroller. It collects data on environmental parameters like temperature, humidity, light, and soil moisture from various sensors. The Arduino then processes this data to automatically control and maintain the greenhouse conditions within an optimal range.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 78

IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

CHAPTER 1
INTRODUCTION

This study designed and implemented a microcontroller-based system that


automatically monitors and controls greenhouse parameters and maintains them within the
predefined optimum range.

Greenhouses have become essential in modern agriculture, enabling farmers to


overcome the limitation imposed by natural climatic conditions and optimize crop production.
However, maintaining the ideal environment within a greenhouse is crucial for achieving
optimal plant growth, preventing diseases, and ensuring high-quality yields. To address this
challenge, advanced monitoring and controlling systems are essential to provide real-time data
and automated adjustments. In recent years, the emergence of low-cost microcontroller
platforms, such as Arduino, has revolutionized the field of automation and control. Arduino
offers a versatile and user-friendly platform that enables the integration of sensors, actuators,
and intelligent algorithms to create effective monitoring and controlling systems. This project
aims to leverage the capabilities of Arduino in the context of greenhouse management. The
goal of this project is to design a greenhouse monitoring and controlling system that utilizes
Arduino as the central control unit. By integrating various sensors, the system can collect data
on critical environmental parameters within the greenhouse, including temperature, humidity,
light intensity, and soil moisture. The Arduino microcontroller then processes and analyses this
data to make informed decisions regarding the adjustment of greenhouse conditions. The
proposed system offers several advantages over traditional manual greenhouse management. It
provides real-time monitoring capabilities, allowing farmers to remotely access and monitor
the greenhouse's environmental data. By visualizing this information through a user-friendly
interface, they can gain insights into the current conditions and identify potential issues before
they escalate. By implementing this Arduino-based greenhouse monitoring and controlling
system, farmers can achieve better resource management, reduce labour requirements, and
enhance overall crop yield and quality. The system's automation capabilities allow for timely
interventions, even in the absence of farmers, ensuring continuous monitoring and adjustment
of the greenhouse environment.

Dept. of EEE SICET Page | 1


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

1.1 BACKGROUND OF THE STUDY

Greenhouses could be automated by utilizing microcontroller-based systems.


These systems would monitor and control greenhouse parameters such as pH of soil, soil
moisture, light intensity, relative humidity and temperature. The microcontroller would keep
them at optimum levels on a continuous 24-hour basis.

To monitor the environment inside the greenhouse different parameters have been
considered such as light, temperature, humidity, soil moisture, etc. using different sensors like
DHT22 temperature and humidity Sensor, LDR, grove-moisture sensor, etc.

The project is primarily aimed at improving current agricultural practices by


providing a smart and automatic system. To always sustain a suitable climate inside the
greenhouse, conditions like temperature, humidity, soil moisture and illumination are
monitored using sensors and regulated using mechanical devices.

1.2 STATEMENT OF THE PROBLEM


In this study, the aforementioned issues were addressed by developing a
microcontroller based system that automates the greenhouse monitoring and controlling
processes using sensors. This will maximize the crop yields, minimize maintenance cost and
save time. In modern agriculture, the effective cultivation of crops within greenhouses has
become crucial for maximizing yield and resource efficiency. However, the lack of an
intelligent and automated control monitoring system poses significant challenges. Existing
greenhouse systems often rely on manual intervention and static control mechanisms, leading
to suboptimal resource utilization, energy wastage, and potential crop losses. The need for a
dynamic, adaptive, and technologically advanced greenhouse control monitoring system is
evident to enhance the precision, efficiency, and sustainability of greenhouse farming. This
system should integrate real-time environmental data, automation, and data analytics to
optimize parameters such as temperature, humidity, light, and irrigation. The challenge is to
design and implement a robust greenhouse control monitoring system that not only ensures
optimal conditions for plant growth but also minimizes resource consumption, promotes energy
efficiency, and facilitates remote monitoring for timely intervention and decision-making.

Dept. of EEE SICET Page | 2


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

1.3 TYPES OF GREENHOUSE CONTROL MONITORING SYSTEM:

Greenhouse control monitoring systems vary in complexity and features,


catering to different needs and scales of greenhouse operations.

Here are several types of greenhouse control monitoring systems:

1.Basic Environmental Control System:

• Monitors and controls essential environmental parameters such as temperature,


humidity, and ventilation.
• Often includes basic sensors and actuators for maintaining optimal conditions.

2.Climate Control System:

• Expands on basic systems by incorporating additional sensors for monitoring factors


like CO2 levels, air circulation, and soil moisture.
• Provides more precise control over the greenhouse climate.

3.Irrigation Control System:

• Focuses specifically on monitoring and automating irrigation processes.


• Includes soil moisture sensors, drip systems, and automated irrigation schedules.

4.Lighting Control System:

• Manages artificial lighting within the greenhouse.


• Integrates with natural light sensors and adjusts artificial lighting based on plant needs
and time of day.

5.Nutrient Management System:

• Monitors and controls the nutrient levels in the soil or hydroponic systems.
• May include sensors for measuring pH levels and nutrient concentrations.

6.Integrated Greenhouse Management System:

• Comprehensive system that combines various control and monitoring aspects.


• Integrates environmental controls, irrigation, lighting, and nutrient management into a
unified platform.
• Often includes data analytics and reporting features for decision support.

Dept. of EEE SICET Page | 3


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

7.Wireless Sensor Network Systems:

• Relies on a network of wireless sensors distributed throughout the greenhouse.


• Enables real-time data collection and remote monitoring.

8.Precision Agriculture System:

• Utilizes advanced technologies such as IoT (Internet of Things) and AI for precise
control and monitoring.
• Incorporates machine learning algorithms for predictive analysis and dynamic control
adjustments.

9.Remote Monitoring and Control Systems:

• Allows users to monitor and control greenhouse conditions remotely.


• Enables alerts and notifications for immediate response to critical events.

10.Energy Management Systems:

• Focuses on optimizing energy consumption within the greenhouse.


• Integrates with HVAC (Heating, Ventilation, and Air Conditioning) systems for energy-
efficient climate control.

11.Greenhouse Automation Systems:

• Fully automates various processes within the greenhouse.


• Integrates with robotics and automation equipment for tasks such as planting,
harvesting, and packaging.
➢ The choice of a specific type of greenhouse control monitoring system depends on
factors such as the type of crops grown, the size of the greenhouse, available resources,
and the desired level of automation and control.

1.4 ADVANTAGES AND DISADVANTAGES

Advantages:

1.Optimized Environmental Conditions:

• Maintains precise control over temperature, humidity, light, and other environmental
factors, creating ideal conditions for plant growth.

Dept. of EEE SICET Page | 4


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

2.Increased Crop Yield:

• Provides an environment conducive to year-round cultivation, leading to multiple crop


cycles and increased overall yield.

3.Resource Efficiency:

• Reduces resource wastage by optimizing water and nutrient usage through intelligent
monitoring and automation.

4.Energy Savings:

• Enables energy-efficient practices, such as using natural light when available and
regulating heating and cooling systems based on real-time conditions.

5.Remote Monitoring and Management:

• Allows farmers to monitor and control greenhouse conditions remotely, enhancing


flexibility and enabling timely responses to issues.

6.Precision Agriculture:

• Facilitates precision farming by tailoring environmental conditions and resource


allocation to the specific needs of different crops.

7.Reduced Environmental Impact:

• Minimizes the environmental impact of agriculture by reducing the need for excessive
water, fertilizers, and pesticides.

8.Improved Crop Quality:

• Enhances the quality of crops through precise control of growing conditions, resulting
in better taste, texture, and nutritional value.

9.Data-Driven Decision Making:

• Provides valuable data through sensors and analytics, allowing farmers to make
informed decisions and optimize farming practices.

10.Automation and Labor Savings:

Dept. of EEE SICET Page | 5


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

• Automates routine tasks such as irrigation and climate control, reducing the need for
manual labour and allowing workers to focus on more complex tasks.

Disadvantages:

1.High Initial Costs:

Implementing a sophisticated greenhouse control monitoring system can involve significant


upfront costs for equipment, sensors, and automation technology.

2.Technical Complexity:

• Complex systems may require specialized knowledge for installation, maintenance, and
troubleshooting, posing a challenge for some farmers.

3.Dependency on Technology:

• Reliance on technology makes the system vulnerable to technical failures, power


outages, or cyber threats, which could disrupt operations.

4.Limited Adaptability for Small-Scale Farms:

• Some advanced systems may be more suitable for large-scale commercial operations,
making them less adaptable for smaller farms with limited resources.

5.Maintenance Challenges:

• Regular maintenance is crucial, and technical issues may arise, requiring prompt
attention to prevent disruptions in greenhouse operations.

6.Overreliance on Automation:

• Excessive reliance on automation may lead to a reduced human presence in the


greenhouse, potentially hindering the ability to respond to unforeseen issues.

7.Initial Learning Curve:

• Farmers may face a learning curve when adopting new technologies, requiring training
to effectively use and manage the system.

8.Environmental Concerns:

Dept. of EEE SICET Page | 6


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

• The production and disposal of electronic components in monitoring systems may


contribute to electronic waste, posing environmental challenges.

9.Data Security and Privacy Risks:

• Collecting and storing sensitive data about crops and farming practices may raise
concerns about data security and privacy.

10.Risk of System Obsolescence:

• Rapid advancements in technology may lead to the risk of system obsolescence,


requiring periodic updates or replacements to stay current.

While greenhouse control monitoring systems offer numerous advantages in terms of


efficiency and productivity, it's essential for farmers to carefully assess their specific needs,
resources, and technical capabilities before implementing such systems.

1.5 APPLICATIONS

Greenhouse control monitoring systems find applications across various sectors


of agriculture, horticulture, and plant research. Here are some key applications:

1.Commercial Greenhouse Farming:

• Large-scale commercial greenhouse operations use control monitoring systems to


optimize environmental conditions, manage irrigation, control lighting, and automate
tasks, leading to increased crop yields and improved quality.

2.Precision Agriculture:

• Greenhouse control systems are integral to precision agriculture, allowing for precise
control of environmental parameters, nutrient delivery, and irrigation, tailored to the
specific needs of different crops.

3.Research and Development:

• Plant researchers and scientists use greenhouse control monitoring systems to create
controlled environments for experiments, studying plant responses to different
conditions and conducting breeding programs.

Dept. of EEE SICET Page | 7


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

4.Urban Agriculture and Vertical Farming:

• In urban environments and vertical farms, where space is limited, greenhouse control
systems enable efficient use of available space and resources to cultivate crops year-
round.

5.Nursery and Seedling Production:

• Greenhouses are often used for the propagation of seedlings and the cultivation of
young plants. Control monitoring systems ensure optimal conditions for germination,
growth, and early development.

6.Floriculture:

• Greenhouse systems are employed in floriculture to grow flowers and ornamental


plants. The precise control of conditions ensures the production of high-quality and
visually appealing blooms.

7.Aquaponics and Hydroponics:

• Greenhouse control systems are crucial in aquaponic and hydroponic systems,


managing nutrient levels, water quality, and environmental conditions for soilless
cultivation.

8.Year-Round Crop Production:

• Control monitoring systems enable farmers to extend growing seasons, allowing for
year-round production of crops regardless of external weather conditions.

9.Growth of Specialty Crops:

• Specialty crops, such as exotic fruits, herbs, and medicinal plants, benefit from
controlled environments provided by greenhouse systems, meeting specific growth
requirements.

10.Climate-Responsive Crop Cultivation:

• Greenhouse control systems are essential in regions with extreme climates or


unpredictable weather, providing a stable and controlled environment for crops.

Dept. of EEE SICET Page | 8


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

11.Smart Agriculture and IoT Integration:

• Integration with the Internet of Things (IoT) allows for real-time monitoring and
control, enabling smart agriculture practices and facilitating data-driven decision-
making.

12.Teaching and Education:

• Educational institutions use greenhouse control monitoring systems to provide hands-


on experience for students studying agriculture, horticulture, and environmental
science.

13.Organic Farming:

• Greenhouse systems support organic farming practices by minimizing the need for
synthetic pesticides and fertilizers through the precise control of environmental
conditions.

14.Energy-Efficient Farming:

• Advanced greenhouse control systems incorporate energy-efficient technologies,


optimizing the use of natural light, regulating heating and cooling systems, and
reducing overall energy consumption.

15.Disease and Pest Management:

• Monitoring systems help in early detection of diseases and pests, allowing for timely
intervention and reducing the need for chemical treatments.

These applications highlight the versatility and importance of greenhouse control


monitoring systems in modern agriculture, addressing the challenges of resource optimization,
sustainability, and year-round crop production.

1.6 PRINCIPLE OF GREENHOUSE CONTROL MONITORING


SYSTEM:

The principle of a greenhouse control monitoring system revolves around


creating and maintaining an optimal environment for plant growth within a greenhouse. The
system relies on sensors, actuators, and controllers to continuously monitor environmental

Dept. of EEE SICET Page | 9


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

conditions and adjust various parameters to meet the specific requirements of the cultivated
plants. Here are the key principles of a greenhouse control monitoring system:

1.Sensor Integration:

• Installation of various sensors throughout the greenhouse to monitor crucial


environmental parameters. Common sensors include temperature sensors, humidity
sensors, light sensors, soil moisture sensors, CO2 sensors, and more.

2.Data Collection:

• Continuous collection of data from the sensors to provide real-time information about
the conditions inside and outside the greenhouse. This data serves as the basis for
decision-making.

3.Control Algorithms:

• Implementation of control algorithms that process the collected data and determine the
necessary adjustments to maintain optimal growing conditions. These algorithms take
into account predefined setpoints and specific crop requirements.

4.Automated Actuation:

• Use of actuators to implement changes based on the decisions made by the control
algorithms. Actuators control various elements within the greenhouse, such as
ventilation systems, heating systems, cooling systems, irrigation systems, and artificial
lighting.

5.Climate Control:

• Regulation of temperature, humidity, and ventilation to create a stable and suitable


climate for plant growth. This includes adjusting heating and cooling systems, opening
and closing vents, and controlling air circulation.

6.Irrigation Management:

• Monitoring and controlling soil moisture levels to ensure proper hydration for plants.
Automated irrigation systems, such as drip irrigation or misting systems, can be
adjusted based on real-time soil moisture data.

Dept. of EEE SICET Page | 10


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

7.Lighting Control:

• Management of natural and artificial lighting to provide the appropriate light intensity
and duration for photosynthesis. This involves adjusting shades, curtains, or artificial
lighting systems based on the natural light levels and time of day.

8.Nutrient Management:

• Monitoring and controlling nutrient levels in soil or hydroponic systems. This includes
adjusting nutrient solutions to meet the specific needs of the crops.

9.Remote Monitoring and Control:

• Integration of remote monitoring capabilities, allowing farmers to access real-time data


and control the greenhouse environment remotely through web-based interfaces or
mobile applications.

10.Data Logging and Analysis:

• Logging and storing historical data for analysis and decision support. Data analysis
helps in identifying trends, making informed adjustments to the control algorithms, and
optimizing the overall system performance.

11.Alarm Systems:

• Implementation of alarm systems to alert farmers or operators in case of critical


deviations from the desired environmental conditions. This allows for prompt
intervention to prevent damage to crops.

12.Energy Efficiency:

• Incorporation of energy-efficient technologies to optimize resource consumption. This


may include using natural ventilation and light when possible and regulating energy-
intensive systems based on real-time needs.

By adhering to these principles, greenhouse control monitoring systems enable the


creation of a controlled and efficient environment, fostering optimal plant growth, maximizing
crop yield, and promoting sustainable agricultural practices.

Dept. of EEE SICET Page | 11


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

CHAPTER 2

LITERATURE REVIEW

2.1 INTRODUCTION

This chapter gives a general review on researches in the greenhouse systems that
have been implemented in the attempt to automate greenhouse management processes. It
outlines literature relevant to the project in areas of greenhouse technology, technologies for
greenhouse automation processes and existing greenhouse control and monitoring systems.

2.2 GREENHOUSE TECHNOLOGY

As opposed to open land, a greenhouse has many advantages some of which are:
offers longer growing season since greenhouse retains heat hence growing of crops can extend
even in cold seasons, one can farm even in bad weathers since crops are covered, a wide variety
of crops can be grown even exotic plants that are not grown locally, plants are protected from
predators and pest since crops are enclosed, one can grow crops without dangerous pesticide
and greenhouse can be customized to ones needs, keeps inside insects like ladybugs that are
beneficial to crop, and ensures growing of food all year round which allows one to enjoy lower
food bills advantages.

Greenhouse technology should be embraced as a way of minimizing food insecurity in the


country as it plays a key role in shifting from rain-fed farming to greenhouse for growing crops
like vegetables and flowers under controlled environmental conditions. These environmental
conditions are not easy to control by manual methods inside a greenhouse and hence there is
need for an automatic system.

Dept. of EEE SICET Page | 12


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

2.3 TECHNOLOGIES FOR GREENHOUSE AUTOMATION PROCESS

Greenhouse control systems have become more automated in recent times. The
means of automating the greenhouse can be broadly classified into wired and wireless
technologies. There are several existing Wireless Technologies which are in use today.

2.4 EXISTINGREENHOUSE ELECTRONIC MANAGEMENT SYSTEMS

The existing greenhouse electronic management systems varies in terms of


sensing technology, monitoring technology and software design as discussed in the following
works;

Designed and accomplished a climatic information collection network for


greenhouse based on PIC6C71 and 87C592 microcontrollers. The system used data acquisition
stations which were connected to solar panels and linked to a central station by a radio
frequency link. The solar panels powered a 6 V, 600 mAh NiCd batteries for backup at night
period. The system used LM35DS temperature sensor, MiniCap2 air relative humidity sensors,
TSL230 light sensors and soil waters sensors. The base station main function was to control
the data acquisition stations and store data collected by them. The data acquisition stations
communicated with central station using RF links based on SIRLX-418F receiver and TXM-
418F transmitter from a radio station. The data received by central station (based on 87C592
microcontroller) was sent to a PC through an RF link or CAN bus. Since communication was
done through by RF, the system was cheap, flexible and could be operated wirelessly. There
was no interference with normal operations in the greenhouse since no cables were used in the
network. Solar panels have a problem of power in case there is heavy cloud cover this is
challenge for this design.

Designed and implemented an integrated network, for greenhouse


management, that linked several communication techniques. The central personal computer
provided user interface, gave updates on control measures and availed report on sensors and
actuators. The network that interconnected all the sensors was based on radio frequency
technique. Each acquisition station worked as remote data collector and used 80C592
microcontroller. The network that interconnected all the actuators was based on radio frequency
technique forming controller area network. The RF drivers used was a 10 mW transceiver

Dept. of EEE SICET Page | 13


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

(BIM-433-F at 433.092 MHz) for data communication to a radius of 400 m. CAN and RS-232
through cables provided an alternative to the RF links because transceivers were affected by
lightning during rainy weather due to power surge. This system set up was expensive to set
up.

Developed a programmable environment controller for the greenhouse environment


using personal computers (PCs). The input part comprised of sensors for measuring water,
temperature and humidity levels. The output comprised of actuators namely dripper for
supplying water, two fans one for inflow and the other for out flow of air to enable ventilation
of the system. Signal processing was facilitated by multiplexers, amplifiers, ADC and interface
card. Greenhouse environmental controller (GEC) program was compiled under disc operating
system. The program was such that the working of control could be manual or automatic and
parameters could be adjusted to any desired levels. Humidity range was set as 80% to 95%
while temperature range as 30Oc to 33Oc otherwise relevant actuators were activated
automatically. The set ranges of parameters exceeded the set lower limits due to delay of the
response time of the controller and the sensors. For this reason the lower limits were set a little
bit higher and lower limits a little bit lower

Designed and implemented a rice seedling greenhouse structure based on a


wireless local area network. The environmental data hub comprised of two weather sensors,
four Soil sensors, three pyrheliometer, two net pyrradiometer and a Camera linked by WLAN
to a data logger. The actuators were pump for water supply and motor for opening and closing
windows. The main wireless LAN operated at 2.4GHz, with signal rate of 2 Mbit/s and
transmission range of a radius of 5 Km.

Designed and fabricated a greenhouse electronic system Based on the Z80


microprocessor. The hardware consisted of a Z80 CPU, two 8255 PIA‟s, a 2716 EEPROM, a
6116 RAM, an HIH-4000 humidity sensor, an LM-35 temperature sensor and two ADC 0804
analogue to digital converters, a clock and reset circuitry and 7segment displays and LEDs.
The software was coded in the Z80 assembly language. This system monitored temperature,
humidity and light illuminance on a continuous basis. It measured and displayed these
parameters and activated appropriate devices whenever these variables fall outside
predetermined ranges. Relative humidity was controlled by a water sprinkler, temperature by a
fan and heater and light illuminance by a lighting system. The system had one major problem;
it had no remote monitoring station.

Dept. of EEE SICET Page | 14


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

Designed and tested a C805F020 microcontroller based automatic greenhouse


prototype. The sensing unit comprised of sensors such as SHT75 for measuring humidity and
temperature, NORP12, TGS4161 for measuring CO2

THERM200 for mastering soil temperature and VG400 for measuring soil
moisture. The central unit comprised of a personal computer, USB cable and 19200 baud 2.4
GhzXStream RF modem. The central unit collected data, processed data, controlled greenhouse
climate and displayed information to the user. The coordinator unit comprised of C805F020
microcontroller, Xbee module, 19200 baud 2.4 GhzXStream

RF modem, relay interface point and power supply provided by LM2594M power
regulator. The actuator unit comprised of bulbs, CO2 injector, exhaust fan, sprinkler, heater and
a thermal shade.

Designed and implemented a wireless greenhouse management system. The


system architecture comprised of a control station and three sensor stations. The sensor stations
(nodes) comprised of Xbee modules and three sensors. Each node measured temperature, light
and humidity, and periodically sent the data to the central computer. The Xbee modules
supported ZigBee S2 links which were set to read sensors analogue values and send them as
packets of data. The central control station comprised of Xbee module linked to a computer via
universal serial bus (USB). The sensor nodes measured the green house parameters, converted
the values to digital form, and then relayed them wirelessly to the central control station.

Developed a GSM-based greenhouse system for agricultural field. The


controlling unit comprised of ARM7LPC2148 microcontroller. The input comprised various
wireless sensors to measure light intensity, humidity and temperature levels. The output unit
comprised of LCD, personal computer, GSM and actuators. The measured values were
displayed on the LCD and as well as GPRS webpage on a central personal computer. The
program for the system was developed in C language using Keil software. The system lacked
mobile monitoring system.

Fabricated a greenhouse monitoring system using on the Arduino uno board and
computer. The hardware comprised of data acquisition card, Arduino board, personal computer
and sensors. In the greenhouse multiple sensors were used to measure the parameters. They
used DHT11 sensor, soil hygrometer sensor, CO2 sensor and light sensor. Graphical user
interface (GUI) was used via labVIEW. The sensor measured values were transmitted to the

Dept. of EEE SICET Page | 15


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

personal computer where by, through 16abVIEW simulations, monitoring of greenhouse


parameters was possible. This design lacked actuation unit.

Designed an intelligent greenhouse system based on LPC2148 controller. It had two


nodes each node had LPC2148 microcontroller, MCP2515 controller and
MCP2551transrecever. The first node comprised of sensors for soil moisture, temperature and
humidity. The second node interfaced LCD and buzzer. The project was implemented using
advanced CAN protocol and a microcontroller. Different parameters were monitored in these
nodes and updated. Node 1 collected sensors values and sent them to the second node via CAN
bus. The second node controlled alarm system according to the received data. The CAN
protocol was implemented using SPI lines of ARM7.

Designed an embedded system for greenhouse management. The hardware


comprised of the controller PIC18F452, sensors, Graphical LCD, EEPROM, Real time clock
(RTC), and relays. Five sensors were used namely; LM35D for temperature measurement,
NORP-12-RS for measurement of light, FC-28-D for measurement of soil moisture, and SY-
HS-220 for measurement of humidity. RTC provided date and time to the controller while
EEPROM stored the monitored information. For control action purpose the relays were utilized
to ON and OFF the actuators. Graphical LCD displayed real time parameters and the graphs
for analysis.

Controllers’ UART transmitted data from EEPROM to a personal computer for


viewing via UART USB module. The actuators were cooling fan and heater to regulate
temperature, light-bulb to increase light, and small heater to raise humidity. This system could
not be monitored or controlled from a distance.

Developed and implemented a prototype to monitor and control greenhouse


climate using wireless sensors network (WSN) and internet of things (IOT). It consisted of the
sensing unit, controlling part, monitoring part and message sending and receiving part. In the
sensing part, the sensors included were LM35 temperature sensor, MQ-5 toxic gas sensor and
fire sensor. The sensors detected various parameters and displayed them on the LCD. The
sensors were connected to P89V51RD2 microcontroller which was the controlling part. The
analogue sensors were connected through ADC. The microcontroller was then connected to a
pump, buzzer and a GSM module through MAX 232. When the moisture was less than the
preset values microcontroller would turn on the pump to sprinkle water. If fire was detected,

Dept. of EEE SICET Page | 16


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

then the buzzer would be turned on to notify the user. A message sending part was a GSM
module which sent the values of greenhouse parameters to a predefined number. The receiver
was a smart phone with an android application that played a predefined audio sound.

From the research works discussed in this section, it is clear that most existing
greenhouse systems lack mobility during the monitoring process. Our designed GSM and
Bluetooth based remote wireless automatic monitoring system provides mobility during the
monitoring process. The control and monitoring are instant and the system is programmable by
the user.

Dept. of EEE SICET Page | 17


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

CHAPTER 3

RESEARCH METHODOLOGY

3.1 INTRODUCTION

This chapter focuses on hardware, schematic and software designs of the


automatic greenhouse prototype. First, the chapter discusses in details the LDR sensor, the
DHT11 sensor, the ATmega328 microcontroller, the LCD, and the soil moisture sensor, and
the Fan and the 5 V 1 channel relay. Secondly, the chapter discusses in details the prototype
schematic design to demonstrate how each component was interfaced to the microcontroller to
up come with the expected prototype design. Lastly, the chapter gives an overview on Arduino
programming kit in the effort to design the system software in C programming language.

3.2 HARDWARE DESIGN

Figure 3.2 shows a flow diagram of the designed greenhouse prototype. The
designed prototype has the following units: sensing, processing and storing, displaying and
indicating, wireless communication, power supply, and actuation. The system comprises of
microcontroller chip, LCD, GSM, Bluetooth, sensors, relays and actuators. The microcontroller
was interfaced with two sensors to measure different greenhouse parameters such as heat levels,
light luminance, and relative humidity. The analog data obtained from the light sensor was
digitized via onboard ADC. The digital data was fed to the microcontroller which made
decisions and activated the relevant actuators according to the installed program. The LCD
displayed sensor readings and the status of the actuators. The data provided by the sensors was
recorded in EEPROM which sent it to the microcontroller for analysis on request. The
microcontroller communicated with the GSM module by AT Commands, which were used to
send and receive short messages.

Dept. of EEE SICET Page | 18


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

Figure 3.1 Block diagram of Greenhouse

Dept. of EEE SICET Page | 19


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

Explanation of Blocks:

1.Environmental Sensors:

• These sensors measure various parameters such as temperature, humidity, light


intensity, CO2 levels, and soil moisture within the greenhouse.

2.Microcontroller or PLC:

• The microcontroller or Programmable Logic Controller (PLC) processes the data from
environmental sensors and makes decisions based on predefined setpoints and control
algorithms.

3.Actuators:

• Actuators receive control signals from the microcontroller or PLC and perform actions
to regulate the greenhouse environment. Examples include controlling ventilation
systems, adjusting heating or cooling systems, managing irrigation, and controlling
lighting.

4.Data Logging and Analysis System (Optional):

• This component records and stores historical data for analysis and trend identification.
It is optional but can be valuable for optimizing the system and identifying patterns
over time.

5.User Interface:

• The user interface can be a web or mobile application that allows users (farmers or
operators) to monitor real-time data, receive alerts, and manually adjust control
parameters if needed.

This block diagram provides a high-level overview of the greenhouse control


system, illustrating the flow of information and control within the system. Depending on the
complexity and specific requirements, additional components or subsystems may be included
in a more detailed diagram.

Dept. of EEE SICET Page | 20


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

3.3 SENSING UNIT

According to Instrument Society of America, a sensor is a subsystem which


produces a meaningful electrical signal when subjected to a physical condition, characteristic
or quantity being measured. The role of a sensor is to react to an input mechanical property and
to change it into an electrical pulse consistent with electronic circuits.

Sensors are of two categories; analogue sensors and digital sensors. Digital sensors
generate output in steps of 0 and 1, which translates to voltage range of the sensor. Analogue
sensors give continuous values in the range of it voltages. Its output voltage varies depending
on the sensor reading. Digital sensors give output in terms of ‘ON’ corresponding to 5 V or
‘OFF’ corresponding to 0 V. An analogue sensor is used to make measurement of analogue
numerical values where precision is needed, for example speed or temperature. An analogue
sensor is able to produce an infinite number of values. The output of a sensor is interfaced to
the input pin of a microcontroller and data is changed to digital signal.

Some sensors such as digital humidity and temperature sensor (DHT11 sensor)
have onboard ADC so that their output is digital. Those sensors, for example LDR sensor, do
not have an onboard ADC, the analogue data is converted to digital form by the microcontroller
onboard ADC. After the data is digitised, it can be processed by the microcontroller. In this
project, the sensors used to measure greenhouse parameters are the DHT11 sensor and the
LDR sensor.

3.3.1 DHT11 SENSOR MODULE

To measure temperature and humidity in the prototype, this research utilized the
DHT11 sensor. Figure 3.2 shows the diagram of the DHT11 sensor module. The key
specifications the sensor has that attracted its choice for this project include: low operating
voltage of 3 to 5 V at 2.5 mA and 150 µA in standby mode, wide humidity measurement range
of 20% to 90% with an error of ±5% and temperature range of 0 to 50 οC with an error of ±2
οC. It weighs 2.7 g and has dimensions of 15.5 mm × 12 mm × 5.5 mm hence suitable for
embedded systems.

The sensor system comprises of a temperature and humidity sensors


combined and gives out a calibrated digital signal. The sensor system uses excellent digital

Dept. of EEE SICET Page | 21


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

signal acquiring and humidity versus temperature measuring technologies, hence it is highly
reliable and very stable. The sensor has a component for measuring humidity which is basically
resistive material and a component for measuring temperature which is a resistor with negative
temperature coefficient (NTC). These two components are connected to a high-speed
microcontroller, thus giving high standards, cheap and quick response.

The DHT11 sensing components are calibrated in laboratories that are very
accurate in calibration of humidity (Tianlong, 2010). The calibration coefficients are kept as a
software in the memory (one time memory-OTP), which is utilized by the internal detecting
protocols of the sensor. The use of single wire interfacing makes integration easy (Han and
Zhao, 2011). In addition, the power consumption is low and signals can be transmitted for a
long distance up to a maximum length of 20 m. The DHT11 contains 4 pins in one row.

Figure 3.2: DHT11 Sensor

In this study, the sensor was placed inside the greenhouse then connected to the
microcontroller. Any variation in temperature or humidity in the greenhouse made the sensor
to produce a digital signal that is proportional to the temperature or humidity upon it. The
output signal was fed to the microcontroller and this was used to trigger the fans or heater in
case the temperature was above or below the pre-set values and sprinkler or fans in case
humidity was above or below the pre-set value. Figure 3.3.1.1 shows the components of the
DHT11 sensor. They include, a component to detect humidity, a thermistor and a
microcontroller to calibrate the digitized signal coming out the sensor.

Dept. of EEE SICET Page | 22


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

Figure 3.3: Components of DHT11 Sensor

3.3.2 FUNCTIONING OF DHT11 SENSOR

The DHT11 sensor is a commonly used sensor for measuring temperature and
humidity in various electronic projects. It is a low-cost digital sensor that provides reliable and
accurate readings. Here's a brief overview of the functioning of the DHT11 sensor:

1.Sensor Construction:

• The DHT11 sensor typically consists of a resistive humidity sensing component and a
negative temperature coefficient (NTC) thermistor for temperature measurement. These
components are encapsulated in a plastic housing along with the necessary electronics.

2.Digital Signal Output:

• The DHT11 sensor produces a digital signal that can be easily read by a microcontroller
or other digital devices. It communicates using a single-wire digital protocol.

3.Signal Timing:

• Communication with the DHT11 sensor involves a specific timing protocol. To request
data from the sensor, the microcontroller sends a start signal, followed by a signal to
initiate data transmission. The DHT11 then responds by sending a sequence of bits
containing temperature and humidity information.

Dept. of EEE SICET Page | 23


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

Figure 3.4: Introduction of DHT11 Sensor

4.Temperature Measurement:

• The NTC thermistor in the sensor measures the ambient temperature. The resistance of
the NTC thermistor changes with temperature, and the sensor converts this resistance
into a digital temperature value.

5.Humidity Measurement:

• The humidity sensing component in the DHT11 measures the moisture in the air.
Changes in humidity cause the resistance of this component to vary, and the sensor
converts this resistance into a digital humidity value.

6.Checksum Verification:

• The DHT11 sensor includes a checksum in its data transmission to ensure the integrity
of the received data. The microcontroller performs a checksum calculation to verify the
accuracy of the received temperature and humidity values.

7.Data Transmission:

• The DHT11 sends the temperature and humidity data as a 40-bit data stream. The
microcontroller reads and decodes this data stream to obtain the actual temperature and
humidity values.

Dept. of EEE SICET Page | 24


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

8.Calibration:

• The DHT11 sensor is calibrated during the manufacturing process, and the calibration
parameters are stored in the sensor's memory. This calibration ensures accurate readings
under normal operating conditions.

9.Limitations:

• While the DHT11 is a cost-effective sensor, it has some limitations. It may have a
relatively slow response time, and its accuracy may not be as high as more expensive
sensors. Additionally, it may not be suitable for extreme temperature or humidity
conditions.

In summary, the DHT11 sensor functions by using a combination of a thermistor


and a humidity-sensing component to measure temperature and humidity, respectively. It
converts these measurements into digital signals that can be easily processed by a
microcontroller for various applications, such as climate monitoring in a greenhouse or weather
station.

3.4 HUMIDITY SENSOR


Humidity sensors, also known as hygrometers, are devices designed to measure the
moisture content or relative humidity in the air. These sensors find applications in various
fields, including weather monitoring, industrial processes, HVAC systems, and agriculture.
Here's an overview of humidity sensors:

Figure 3.5: Block diagram of humidity sensor

Dept. of EEE SICET Page | 25


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

Types of Humidity Sensors:

1.Capacitive Humidity Sensors:

• Principle: Measure humidity by changes in capacitance caused by the absorption or


desorption of water molecules on a capacitive material.
• Advantages: Fast response time, high accuracy, and wide operating range.
• Applications: Weather stations, HVAC systems, industrial processes.

2.Resistive Humidity Sensors (Hygroresistive):

• Principle: Measure humidity by changes in electrical resistance of a hygroscopic


material.
• Advantages: Simple design, cost-effective.
• Applications: Residential hygrometers, some industrial applications.

3.Thermal Humidity Sensors (Hygrometric Thermocouples or Psychrometers):

• Principle: Measure humidity by detecting changes in temperature caused by the


evaporation of moisture from a wet bulb.
• Advantages: Suitable for a wide range of humidity levels.
• Applications: Meteorology, industrial processes.

4.Optical Humidity Sensors:

• Principle: Measure humidity by detecting changes in the optical properties of materials


(e.g., absorption, reflection, or refraction) influenced by humidity.
• Advantages: Can be highly sensitive and accurate.
• Applications: Laboratory instruments, specific industrial environments.

5.Piezoelectric Humidity Sensors:

• Principle: Measure humidity by changes in resonance frequency or mechanical


properties of a piezoelectric material.
• Advantages: Compact size, low power consumption.
• Applications: Industrial processes, meteorology.

Key Features and Considerations:

Dept. of EEE SICET Page | 26


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

1.Accuracy:

• Accuracy is a critical factor, especially in applications where precise humidity control


is essential, such as in laboratories or manufacturing processes.

2.Response Time:

• The speed at which a humidity sensor can detect changes in humidity is important in
applications where rapid adjustments are necessary.

3.Calibration:

• Regular calibration may be required to maintain accuracy, and some sensors may come
pre-calibrated.

4.Operating Range:

• Different sensors may have specific operating ranges, and users should choose sensors
suitable for their intended environments.

5.Maintenance:

• Some humidity sensors may require minimal maintenance, while others may need more
attention to ensure accurate readings over time.

6.Environmental Considerations:

• Some sensors may be more suitable for harsh environments, while others are designed
for specific temperature and humidity conditions.

7.Output Signal:

• Humidity sensors can provide analog or digital output signals, depending on the type
and model. Digital sensors often interface well with microcontrollers.

8.Cost:

• The cost of humidity sensors can vary based on the technology used, accuracy, and
additional features.

Dept. of EEE SICET Page | 27


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

Applications:

• Weather Monitoring: Humidity sensors are used in weather stations to measure and
report humidity levels, providing valuable data for forecasting.
• HVAC Systems: Humidity control is crucial for maintaining comfort and preventing
issues like mold growth. Humidity sensors are integrated into heating, ventilation, and
air conditioning (HVAC) systems.
• Industrial Processes: Various manufacturing processes may require precise humidity
control for optimal product quality and consistency.
• Agriculture and Greenhouses: Humidity sensors contribute to creating optimal growing
conditions for crops in controlled environments.
• Consumer Electronics: Humidity sensors are found in items like home thermostats,
dehumidifiers, and smart home devices.
• Medical Devices: In some medical applications, humidity sensors are used to monitor
and control conditions in environments like incubators or respiratory devices.

Humidity sensors play a vital role in maintaining the desired environmental conditions in a
wide range of applications, contributing to both comfort and efficiency in various industries.

3.4.1 FUNCTIONING OF HUMIDITY SENSOR

The humidity sensing component is made up of two conductors carrying a


moisture absorbing material to form a bridge as shown in figure 3.4. When there is change in
humidity, the resistance of the moisture absorbing material changes. When water vapor is
absorbed by the substrate, ions are released by the substrate which increases the conductivity
between the electrodes. The change in resistance between the two electrodes is proportional to
the relative humidity.

Figure 3.6: Humidity Sensing Component (www.howtomechatronics.com)

Dept. of EEE SICET Page | 28


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

Higher relative humidity decreases the resistance between the electrodes while
lower relative humidity increases the resistance between the electrodes. Therefore, the sensor
produces a potential difference against the relative humidity (RH) change that is proportional
to the power supply. This implies that, the point at which the power supply changes, the sensor
produces a voltage in the same proportion. This variation is detected, amplified and processed
by the sensor microcontroller, which makes it readable by the system microcontroller. It
operates on the voltage range of 4 to 5 V.

5 V and room temperature, output voltage ranges is 0.8 – 3.9 V as humidity


varies from 0 % to 100 %. Sensor output voltages for humidity sensing component can be taken
into account according to Eq. 3.1 (voltage output first order curve at 25ºC):

VOUT = (VCC){0.0062(%RH)} + 0.16 (3.1) Where: VOUT = the sensor output


voltage; VCC = the supply voltage; and %RH = the sensor relative humidity. The constant
0.0062 is the gradient of the first order equation and 0.16 is the out voltage at no supply voltage
to the sensor.

3.5 SOIL MOISTURE SENSOR

Soil moisture sensors are devices designed to measure the volumetric water content in
the soil. These sensors are valuable tools in agriculture, horticulture, and environmental
monitoring, providing crucial information about the moisture levels in the soil. Here's an
overview of soil moisture sensors:

Dept. of EEE SICET Page | 29


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

Figure 3.7: circuit diagram of soil moisture sensor

Types of Soil Moisture Sensors:

1.Resistance-Based Soil Moisture Sensors:

• Principle: Measure soil moisture by assessing the electrical resistance between two or
more electrodes in contact with the soil.
• Advantages: Simple design, cost-effective.
• Considerations: Calibration may be necessary as soil properties can affect the readings.

2.Capacitance-Based Soil Moisture Sensors:

• Principle: Measure soil moisture by analysing the capacitance between electrodes


embedded in the soil.
• Advantages: Generally more accurate than resistance-based sensors, less affected by
soil salinity.
• Considerations: Calibration may still be required for different soil types.

3.Time Domain Reflectometry (TDR) Sensors:

• Principle: Measure soil moisture by analyzing the time it takes for an electromagnetic
pulse to travel along a probe inserted into the soil.
• Advantages: Provides accurate readings and is less sensitive to soil salinity.
• Considerations: More expensive than some other sensor types.

Dept. of EEE SICET Page | 30


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

4.Frequency Domain Reflectometry (FDR) Sensors:

• Principle: Measure soil moisture by assessing the dielectric permittivity of the soil.
• Advantages: High accuracy and less affected by soil salinity.
• Considerations: Generally more expensive than resistance-based sensors.

Key Features and Considerations:

1.Depth of Measurement:

• Some sensors measure soil moisture at specific depths, providing insights into the
moisture profile of the soil.

2.Accuracy:

• Accuracy is crucial, especially in precision agriculture where precise irrigation


management is essential.

3.Installation and Ease of Use:

• Consider the ease of installation and whether the sensor is suitable for the intended
soil type.

4.Calibration:

• Some sensors may require calibration to account for variations in soil type and other
factors.

5.Power Consumption:

• Power consumption is a consideration, especially for sensors that are part of wireless
sensor networks or remote monitoring systems.

6.Data Output:

• Soil moisture sensors can provide analog or digital output signals. Digital sensors are
often preferred for integration with microcontrollers and data logging systems.

7.Durability and Weather Resistance:

• Sensors should be durable and weather-resistant, especially if they will be exposed to


outdoor conditions.

Dept. of EEE SICET Page | 31


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

8.Integration with Irrigation Systems:

• Some sensors can be integrated with irrigation systems to enable automatic and
optimized watering based on real-time soil moisture data.

Applications:

• Agriculture: Soil moisture sensors help farmers optimize irrigation practices,


preventing overwatering or underwatering and promoting efficient water use.
• Horticulture: Used in landscaping and garden management to ensure plants receive
adequate moisture for healthy growth.
• Environmental Monitoring: Applied in ecological studies to monitor soil moisture
levels in natural ecosystems and assess the impact on flora and fauna.
• Research: Utilized in scientific research to study the effects of soil moisture on plant
growth and to develop models for predicting water availability in different soil types.
• Construction and Civil Engineering: Soil moisture sensors are used to monitor the
moisture content of soil during construction projects to ensure stable foundations.
• Land Reclamation: Applied in projects to restore degraded land by monitoring and
managing soil moisture levels for successful revegetation.

Soil moisture sensors play a crucial role in optimizing water management practices,
improving agricultural productivity, and supporting sustainable land use. Their application
is diverse, ranging from large-scale farming operations to environmental research and
ecosystem monitoring.

3.5.1 FUNCTIONING OF SOIL MOISTURE SENSOR

The functioning of soil moisture sensors varies depending on the type of sensor
technology used. Here, I'll provide a general overview of the principles commonly employed
by soil moisture sensors:

1. Resistance-Based Soil Moisture Sensors:

➢ Principle:
• These sensors typically consist of two or more electrodes embedded in the soil. The
electrical resistance between these electrodes changes with variations in soil moisture.

Dept. of EEE SICET Page | 32


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

• As soil moisture increases, the conductivity of the soil improves, leading to a decrease
in resistance. Conversely, dry soil results in higher resistance.

Figure 3.8: soil moisture sensor

Functioning:

• The sensor applies a low-voltage electrical current across the electrodes.


• The resistance between the electrodes is measured.
• The resistance value is then correlated to soil moisture levels.

2. Capacitance-Based Soil Moisture Sensors:

Principle:

• Capacitance sensors use the principle that the dielectric constant of soil changes with
moisture content.
• The sensor has two plates (electrodes), and the soil acts as a dielectric material between
them.

Dept. of EEE SICET Page | 33


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

Functioning:

• An oscillating electrical current is applied between the plates.


• The dielectric constant of the soil affects the capacitance, which is measured.
• The capacitance value is then correlated to soil moisture levels.

3. Time Domain Reflectometry (TDR) Sensors:

Principle:

• TDR sensors operate on the principle that the dielectric constant of the soil affects the
propagation speed of electromagnetic pulses.

Functioning:

• The sensor sends a short electromagnetic pulse down a probe inserted into the soil.
• The time taken for the pulse to return is measured.
• The time delay is related to the soil moisture content, and this information is used to
determine volumetric water content.

4. Frequency Domain Reflectometry (FDR) Sensors:

Principle:

• Similar to TDR sensors, FDR sensors measure the dielectric constant of the soil to
determine soil moisture.

Functioning:

• The sensor sends an electromagnetic wave at a specific frequency into the soil.
• The reflected signal is analysed, and changes in frequency are correlated to changes in
soil moisture.

Important Considerations:

1.Calibration:

• Many soil moisture sensors require calibration to account for variations in soil type,
temperature, and sensor aging.

2.Installation Depth:

Dept. of EEE SICET Page | 34


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

• The depth at which the sensor is installed affects the readings. Different sensors may
be suitable for different soil depths.

3.Soil Type:

• Soil composition can impact sensor accuracy. Calibration may be needed for different
soil types.

4.Temperature Compensation:

• Some sensors include temperature sensors to compensate for the influence of


temperature on soil moisture readings.

5.Power Supply:

• Depending on the type, soil moisture sensors may be battery-powered or connected to


a power source.

6.Data Output:

• Sensors can provide analog or digital output. Digital sensors are often preferred for
integration with microcontrollers or data loggers.

Applications:

• Agriculture: Optimize irrigation practices.


• Environmental Monitoring: Assess soil moisture in natural ecosystems.
• Research: Study plant responses to varying soil moisture levels.
• Land Reclamation: Monitor soil moisture for successful revegetation.

Understanding the functioning and considerations of soil moisture sensors is crucial for
accurate and effective use in various applications, particularly in optimizing water management
in agriculture and environmental monitoring.

3.5.2 FUNCTIONING OF TEMPERATURE SENSOR

The sensor utilizes a thermistor to detect temperature shown in figure 3.5. It is a


resistor whose resistance changes with variation in temperature. The sensor is made by
sintering of semiconductor substance so as to produce higher variations in the resistance with
minute changes of temperature.

Dept. of EEE SICET Page | 35


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

Figure 3.9 : Temperature sensing component

3.6 FAN SENSOR

Figure 3.10: Fan Sensor

Fans in a greenhouse control monitoring system play a crucial role in managing the
environmental conditions within the greenhouse. The use of fans is especially important for

Dept. of EEE SICET Page | 36


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

controlling temperature, humidity, and air circulation. Here are key aspects of fans in a
greenhouse control system:

1. Temperature Control:

Function: Fans help regulate the temperature inside the greenhouse by facilitating air
movement. This is essential for preventing temperature extremes, especially during periods of
high heat.

Operation: During hot periods, fans can be used to exhaust hot air, allowing cooler air to replace
it. This process is known as ventilation and helps maintain an optimal temperature for plant
growth.

2. Humidity Control:

Function: Fans contribute to humidity control by promoting air circulation. Improved airflow
helps prevent the buildup of stagnant air, which can lead to high humidity and conditions
conducive to disease.

Operation: Proper ventilation through fans aids in moisture evaporation and prevents the
formation of localized high-humidity zones.

3. Air Circulation:

Function: Fans are critical for ensuring uniform air circulation throughout the greenhouse. This
helps distribute heat, humidity, and CO2 evenly, creating a more consistent growing
environment for plants.

Operation: Fans can be strategically placed to create a continuous flow of air, preventing the
formation of microclimates within the greenhouse.

4. Condensation Prevention:

Function: Fans assist in preventing condensation on plants and greenhouse surfaces. Adequate
air circulation helps maintain surface temperatures, reducing the likelihood of water vapor
condensing into droplets.

Operation: By maintaining a balance of temperature and humidity through ventilation, fans


minimize the risk of water condensation on plant surfaces.

5. Integrated with Control Systems:

Dept. of EEE SICET Page | 37


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

Function: Fans can be integrated into the overall greenhouse control monitoring system,
allowing them to be controlled automatically based on real-time environmental data.

Operation: Temperature and humidity sensors, along with the greenhouse control system, can
trigger the operation of fans as needed to maintain optimal conditions.

6. Variable Speed Operation:

Function: Some greenhouse control systems allow for variable speed operation of fans. This
feature enables more precise control over air circulation and temperature.

Operation: By adjusting the speed of the fans, the system can respond to changing
environmental conditions with greater flexibility.

7. Energy Efficiency:

Function: Energy-efficient fan systems contribute to sustainable greenhouse operations by


minimizing power consumption.

Operation: Some greenhouse control systems may include sensors and algorithms to optimize
fan operation, reducing energy usage while maintaining optimal growing conditions.

8. Backup Systems:

Function: Backup fan systems can be incorporated into greenhouse control systems to ensure
continued ventilation in the event of primary fan failures.

Operation: Redundant fan configurations or automated alerts can be part of the system to
address mechanical issues promptly.

The proper integration and operation of fans within a greenhouse control monitoring system
contribute significantly to creating a controlled environment that promotes healthy plant
growth, maximizes yields, and enhances overall efficiency in greenhouse farming.

3.7 PROCESSING UNIT

The sensing unit, the displaying and indicating unit, the communication unit and the
actuation unit require a central processing unit in order to perform various tasks such as data
acquisition and data processing. Therefore a microcontroller was integrated into the system.
Microcontroller is an integrated chip that consists of all components including programmable
peripherals, input/output ports, central processing unit, timers and program (Augarten, 1983).

Dept. of EEE SICET Page | 38


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

This research utilized ATmega328 microcontroller to analyse the input signals from the sensors
and subsequently instructing the actuators, the Bluetooth module and the GSM module
accordingly.

3.7.1 ATmega328 MICROCONTROLLER CHIP

The ATMega328 microcontroller chip (manufactured by microchip Technology


Company) consumes low voltage and has improved design of high performance. It is 8 bit
microcontroller with a processor that operates on the AVR Harvard architecture. The key
parameters of ATmega328 are outlined as follows:

• 28 pins (as illustrated on figure 3.10. The table in Appendix B describes function(s) of
each of the pin) and 23 lines of programmable input/output (I/O).
• Three communication interface; Serial Interface, Programmable Serial USART and
Two-wire Master/Slave SPI.
• Operating temperature range of - 40 to + 105 °C and Operating Voltage range of

+ 1.8 to + 5.5 V.

• Six program based power save modes; Noise Reduction mode, Idle mode, Extended
Standby mode, Power-down mode, Standby mode and Power-save mode.
• Programmable Watchdog Timer with internal separate Oscillator.
• Kbytes EEPROM and 2 Kbytes Internal SRAM with CPU Speed 1 MIPS for 1 MHz.
Program or Flash memory 32 Kbytes (10000 write/erase cycles).
• 4 External Oscillator: 0 - 4 MHz at 1.8 to 5.5 V, 0-10 MHz at 2.7 to 5.5 V and 0

- 20 MHz at 4.5 to 5.5 V.

• 8 MHz Calibrated Internal Oscillator and six PWM channels.


• Two 8-bit counters having inbuilt Prescaler plus compare mode, One 16-bit counter
with inbuilt Prescaler plus compare and capture modes.
• 6 channels 10-bit ADC and 1 Analog Comparator (pins 12, 13).

Dept. of EEE SICET Page | 39


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

Figure 3.11: ATmega 328 Microcontroller Pins

ATmega328 was chosen for this project work because of its cost effectiveness, its
excellent features and the fact that Arduino boards are designed on this controller. ATmega328
has many applications due to it 32 Kbytes program memory and with six program selectable
power save modes it can operates on movable electronic devices. The watchdog timer enables
the resetting of the controller in case of an error thus it can be utilized on devices with minimum
or no human involvement. The execution of the program is quick AVR Harvard architecture.
The chip has a sensor for controlling temperature meaning it can be operated on extreme
temperature levels. The microcontroller is designed to operate on low voltage (Howard, 1991)
and required about 5 V which was provided by voltage regulator discussed in section 3.6.3.

3.4.2 Internal Architecture of the ATmega328 Microcontroller

The structure of the internal components of the ATmega328. The data buses,
memories, analogue to digital converter, central processing unit and other key parts are very

Dept. of EEE SICET Page | 40


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

well shown. The CPU is the “think tank” of ATmega328 chip that controls the software
implementation.

Figure 3.12: ATmega328 CPU Harvard Architecture

For data and program are distinct). For this reason the CPU carries
mathematical calculations, deals with interrupts, reaches memories and manages peripherals.
The diagram in figure 3.11 shows the central processing unit. For maximum performance in
accessing data and program, ATmega328 employs Harvard architecture (the bus and memories

In the program memory, instructions are executed in such a way that as one
instruction is being performed, the next instruction is pre-fetched from the memory (Single
level pipelining). This implies that instruction are executed in each and every cycle. The
reprogrammable flash memory is the custodian of the program memory. The access register
has 32 general purpose working registers which have one clock cycle access time, this enables
one arithmetic and logic unit cycle operation.

Dept. of EEE SICET Page | 41


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

In one clock cycle the ALU comprises of two operands from the register; the
operation is done and the outcome is left in the register. For effective calculation of addresses,
6 registers in the 32 registers serves as 6-bit indirect register pointer to facilitate spacing of the
data addressing. One out of the 3 address pointers monitors tables in the flash memory hence
it is an address pointer.

The ALU performs the arithmetic and logic exercises between a register and
another or between a register and a constant. Operations of one register can also be performed
in in the ALU. Status register is updated to show information on the result of the operation after
an arithmetic operation. Conditional and unconditional jumps and call for instructions enable
the program to flow smoothly. The ATmega328 has one 16-bit word pattern instructions hence
each memory of program has an instruction bit of 16/32-bit.

Program flash memory is made up of two parts; the boot part and the program
application part, both having write and read or write protection lock bits. Boot program
memory is the custodian of program memory that that writes the applications in the flash
memory.

The stack is the custodian of the return program counter during subroutines and
interrupt calls. Its allocation is the data memory (SRAM) and thus limited to SRAM space and
use of SRAM. The static pointer must be initialized by all programs that are in use at any given
time and can be accessed through input/output space. The data memory can be accessed
through the 5 addressing modes in the architecture of ATmega328. The ATmega328 memory
spaces are all linear with regular memory maps.

Flexible interrupts contains control registers inside input/output space and its
control register contains an extra interrupt bit. In the interrupt vector table all interrupts have a
unique interrupt vector and they are accessed according to their position. The lower the address
of the interrupt vector the higher the chance. The input/output has 64 central processing unit
addresses for peripheral functions such as serial peripheral interface, control registers, and
other input/output roles. The access to the input/output memories can be direct, or as data space
locations followed by register file. In addition ATmega328 contains extended input/output
space in the SRAM for storage of special instructions.

Dept. of EEE SICET Page | 42


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

3.8 ARDUINO MICROCONTROLLER BOARD

The Arduino uno microcontroller board, is a single board microcontroller board


that uses the ATmega328 microcontroller (Arduino Corporation, 2013). To program the
ATmega328 microcontroller, the microcontroller was first mounted on the board and the board
powered through power interfaces. Figure 3.8 shows how the microcontroller was mounted on
the board during programming while figure 3.8.1 shows the arduino uno board schematic
diagram.

Figure 3.13: Arduino Uno Board

The Arduino board has three sets of pins; 14 digital I/O pins, 16 analog I/O pins and 7
power pins. The 6 out 14 digital pins can generate pulse width modulated signal (PWM). Table
3.8 shows digital pins names and their descriptions.

Dept. of EEE SICET Page | 43


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

For serial communication, the D0 and D1 pins were interfaced to RX and TX pins
respectively on the Atmega8U2 USB to serial chip, while for serial peripheral interface
communication, the board used the D10, D11, D12 and D13 pins. The D2 and D3 pins provided
external interrupts when configured to trigger interrupts on value change or low value or
fluctuating edge. The board inbuilt LED was operated by pin 13 hence the LED was on when
the pin value was high and vice versa. A serial library in addition to digital pins D0 and D1
facilitated serial communication on the digital pins. To send a pulse width modulated signal to
the relays the six digital pins were used as output. Signal from light sensor entered the board
through the analogue pins.

Table 3.8 shows the Arduino board analog input pins and their descriptions. A4 and
A5 pins supports TWI data transmission via wire library. The onboard quartz crystal produced
a 16 MHz synchronizing pulse.

Table 1: Arduino Analog Pins

Pin
No. Name Second Function Explanation
0 A0
1 A1
2 A2
3 A3
4 A4 SDA I2C Data Out
5 A5 SCL I2C Clock

To power the Arduino board, we used the USB interface or the external power
supply jack. The grounding of all pins was done through the GND pin. The 5 V pin supplied a
voltage of 5 V from the external voltage regulator to the board while the 𝐕𝐢𝐧 pin enabled the
voltage from external source to power the Arduino board. The Arduino uno board regulator
generated 3.3 V at a maximum current of 50 mA. This voltage was accessed through 3V3 pin.
The analog input reference voltage was accessed through 𝐀𝐑𝐄𝐅 pin and to reset the controller
RESET pin line was brought low. The range of operating external power was 6-20 V, when
powered with less than 7 V, the board was not stable and on using power greater than 12 V, the
regulator over heated hence damaging the board. This was in agreement with manufacturers
recommended range of 7 to 12 V. Textual data was sent to and from the board via serial monitor

Dept. of EEE SICET Page | 44


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

of the Arduino software (IDE). The D0 and D1 pins LEDs flushed when the data was in
transmission process through USB interface to the laptop the USB to serial chip. Instead of
pressing physically to the reset button prior to uploading the program, the Arduino design
allows resetting by it software via the connected laptop.

Table 2: Arduino Digital Pins

Pin
No. Name Second Function Explanation
0 D0 RX UART Receiver
1 D1 TX UART Transmitter
2 D2 INTO Interrupt
3 D3 INT1 Interrupt
4 D4
5 D5
6 D6
7 D7
8 D8
9 D9
10 D10 SS SPI SS
11 D11 MOSI SPI MOSI
12 D12 MISO SPI MISO
13 D13 SCK SPI Clock

The data-terminal-ready (DTR) of the ATmega8U2 was interfaced to ATmega328 reset


line through a 100 nF capacitor. When DTR was taken low, the reset line on the chip fell down.
This modification on the Arduino software allowed uploading of a program by pressing the
interface button on the IDE tool bar. The falling of the DTR was coordinated to the start of the
uploading process; hence boot loader timeout was shorter.

Dept. of EEE SICET Page | 45


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

Figure 3.14: Arduino Uno Board Schematic

3.9 ACTUATION UNIT

3.9.1 RELAY MODULE

A relay is a switch that by electronic or mechanical means opens and closes a


circuit. By opening and closing contacts in another circuit, relays are able to control other
electrical devices. There exists an open contact (when the relay contact is normally open) and
a closed contact (when the relay contact is normally closed) when the relay is not powered.

This project made use of the 5 volt 1 channel relay module shown in figure which
is an electromechanical relay. As can be seen in the relay schematic diagram in figure the relay
comprises of a coil of copper wire, movable contact and a return spring.

A drive circuit is incorporated between relays and the interface circuit to sense the
levels of the input and command the relays accordingly. For this reason a relay can operate
high power devices like motors and even low power devices like light bulbs.

Dept. of EEE SICET Page | 46


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

Figure 3.15: 1 Channel 5v Relay Module for Arduino

The input connections of relay module comprise of Logic GND which is


connected to GND of the microcontroller, Digital Pins IN 1, which is connected to digital pins
of microcontroller or left unconnected if not in use and Logic VCC which is connected to the
5 V pin of the microcontroller to power the relay module.

Figure 3.16: Relay Module

The output connections of relay module comprise of normally open (NO), common
connection (COM) and normally closed (NC). COM which is used in both NO and NC is the
center terminal of relay. NO normally open behaves like a switch. Before the relay is activated

Dept. of EEE SICET Page | 47


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

an open connection, hence no contact between COM and NO. But when the relay is activated,
it gets connected to the COM and supplies voltage to the load. Thus the circuit will initially be
in open state until the state is triggered. NC always remains in contact with COM and when the
relay is triggered it opens the circuit. Relay 1 (K1) connect one end of the load to the COM and
the other end to NO. Connections for K2, K3 AND K4 are the same.

Figure 3.17: Pin out of relay module

3.10 ACTUATORS

An actuator is a machine component that moves and controls a system. It


requires a control signal and a source of energy. The control signal has low energy which may
be voltage or electric. The main source of energy is electric current, fluid pressure or pneumatic
pressure. Upon receiving a control signal an actuator converts it into mechanical motion. The
designed unit includes the following actuators:

Dept. of EEE SICET Page | 48


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

a. Ventilation fans: Two direct current fans determined the rate of air flowing inside and
outside the greenhouse prototype hence providing ventilation.

b. Heat flow: Consisted of a 220 V heater positioned inside the greenhouse prototype to
provide heat when necessary.

c. Water Pump: Pump provided the means for moving water through the system at usable
working pressures for the sprinkler.

d. Lighting system: Bulb provided means of lighting the system when day light is dim or at
night.

In this study, the heater, bulb, fans, and water pump received commands from
the central processing unit via relays to control the greenhouse climatic parameters such as
temperature levels, humidity levels and light illuminance inside the greenhouse prototype.
Relative humidity was controlled by a water sprinkler and a fan, temperature by a fan and
heater and light illuminance by a lighting system (Appendix P). The DHT11 sensor was
positioned at the centre to measure temperature and humidity in the system. Also one light
sensor was placed in the same position for sensing light intensity. A sprinkler was placed inside
the greenhouse and attached to the pump from a water source.

3.11 PROTOTYPE GREENHOUSE SCHEMATIC DESIGN

To make a microcontroller an independent computer, a 10 KΩ resistor was


connected to +5 V from pin1. This prevented the microcontroller from resetting during
operations. Then pin 7 was connected to +5 V, pin 8 and pin 22 to the ground, pin 22 to +5 V
analogue reference. The ATmega 328 runs at 16 MHz clock speed. Therefore, a 16 MHz
external oscillator was added between pin 9 and 10 with two 22 pF capacitors grounded from
these pins (Appendix O).

3.11.1 DHT11 Sensor Interface to ATmega328 Microcontroller

Figure 3.26 and 3.27 shows the DHT11 interface to the ATmega328
microcontroller and pin configuration for the DHT11, respectively. DHT11’s power supply was
provided by 5 V adapter of the system. For power filter one capacitor valued 104 nF was
interfaced at Vcc and grounded. The sensor uses serial interface communication technique. For
data transfer and synchronization process between the sensor and the microcontroller, single

Dept. of EEE SICET Page | 49


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

wire data technique is used, this lowers the cost and increases the length. To send data through
a bus, description on the manner in which the data is transferred (protocol) is important, this
enables the transmitters and receivers to be in harmony. The one wire line is connected via a
resistor to the power source. So the line is equal to 5 V if there is no charge. Communication
pattern is in three stage: request, respond, and read. A complete data flow has 40 bit, and higher
data bit is sent first. The format is, 8 bit RH + 8 bit RH + 8 bit T + 8 bit T + 8 bit SUM. If the
data transmission is correct, the sum is equal the last 8 bit of "8 bit RH + 8 bit RH + 8 bit T +
8 bit T ", where RH and T are relative humidity and temperature respectively.

Figure 3.18: DHT11 Sensor Interface to ATmega328 Microcontroller

Figure 3.19: Pin Configuration for DHT11 Sensor

Dept. of EEE SICET Page | 50


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

3.11.2 Relay Module Interface to ATmega328 Microcontroller

Figure 3.11 shows how the 5 V 1 channel relays board was interface to ATmega328
microcontroller.

Figure 3.20: Relays Interface to ATmega328 Microcontroller

The Pin 2, pin 3, pin 4 and pin 5 of the relays interface board were connect to pin 23,
pin 24, pin 25 and pin 26 of the microcontroller respectively while the Pin 1 and pin 6 were
interfaced to power source and ground respectively.

3.12 PRINTED CIRCUIT BOARD

The printed circuit board (PCB) mechanically supported and electrically connected
the electronic components of the project using conductive trucks, pads, and other features
etched from copper sheets laminated onto nonconductive substrate. Figure 3.30 shows a
screenshot of the project PCB design on eagle software PCB view during designing process.

The PCB design was made by converting our schematic design diagram into PCB
layout using eagle PCB software. A laser printer was used to make a printout of the PCB layout.
A copper plate measuring 16 by 22 was cut using a cutter. The copper side was scratched with
steel wool to remove the oxide and photo resist layer, The PCB was transferred to copper plate
and the circuit ironed from the paper onto PCB plate. Then, the PCB was dipped in warm water
for 15 minutes to dissolve and removed gently. Finally the plate was etched and cleaned. Final

Dept. of EEE SICET Page | 51


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

touches included: Drilling vias, mounting pads and leads on the board for mounting electronic
devices and soldering the components on the PCB to prevent short circuiting them.

Figure 3.21: PCB Circuit Maker

3.13 SOFTWARE DESIGN

3.13.1 Introduction

In microcontrollers and computers, programming refers to writing a sequence of


directives, executable by the processor in a given order to carry out preset task. It involves
debugging, and troubleshooting instructions and instruction sequences to ensure collect task
implementation. There are certain words, grammar and rules for programming languages

There are three types of programming languages for microcontrollers depending on


closeness of statements in the language resemblance of the operations done by the controller.

Dept. of EEE SICET Page | 52


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

The three levels of programming languages are: machine code, assembly language and high
level language.

In machine code instructions are written in binary form (digits 0 and 1), stored as

‘LOW’ and ‘HIGH’ voltages. It is the lowest level of programming language and
microcontrollers understand this language. The assembly language is the English
representation of the machine code – it is based on mnemonics and hexadecimals codes.
Architecture knowledge of the microcontroller is crucial in this language. The high level
language uses words and statements easily understood by human. Examples of high level
languages are BASIC, Pascal, C++ and Java. A program called compiler enables conversion of
the programs in high level language to binary form (digits 0 and 1) which can be uploaded to
computer memory for execution. High level languages are easy to work with, however,
assembly languages have the following merits;

a. Their programs are faster to execute and require less memory space.

b. Enable direct exploitation of the features of microcontrollers.

C. Enhance direct and accurate control of microcontroller resources such as


RAM,Ports etc.

d. They have less rules and restrictions.

3.11.2 System Program

In order to develop a program to upload to the ATmega328 to operate the automatic


greenhouse prototype, the following steps was applied:

i. Start: Reset the ATmega328 ready to execute the instructions.

‘‘Welcome. System switched on’’.

ii. Read the DHT11 and LDR sensors.

iii. If the temperature is within the optimum range, the software maintains status quo. If the
temperature is greater than the maximum set temperature, the software checks status of the
heater. If the heater is off it turns on the fans. If heater is on it turns off the heater then turn on
the fan.

Dept. of EEE SICET Page | 53


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

iv. If the temperature is less than the minimum set temperature, the software checks the status
of the fan. If the fan is off it turns on the heater. If the fan is on it turns off the fan then turn on
the heater.

v. If the humidity is within the optimum range, the software maintains. If the humidity is
greater than the maximum set humidity, the software checks status of the pump. If the pump is
off it turns on the fans. If pump is on it turns off the pump then turn on the fan.

vi. If the humidity is less than the minimum set humidity the software checks status of the fan.
If the fan is off it turns on the pump. If fan is on it turn off the fan then turns on the pump.

vii. If light is minimum it turns on the lamp otherwise it turns off the lamp. ix. If an error occurs
during the execution process go to step ii. Otherwise, it sends a message to the user on the
greenhouse parameters and go to step iii.

x. End.

The flow chart in appendix A describes the above algorithms.

3.13.3 Program Development

The program was developed in Arduino IDE, converted to machine code and
uploaded to the ATmega328 microcontroller. Figure 3.31 shows the Arduino IDE during the
program development. This process involved the following procedure:

i. Creating new file. ii. Designing a sketch. iii. Compiling the sketch code. iv. Combining of
the sketch code with the Arduino libraries.

v. Uploading the sketch code.

Dept. of EEE SICET Page | 54


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

Figure 3.22: Arduino Environment

3.13.4 Software Structure

In Arduino programming there are two main functions, these are; the setup() and the loop().

START

SETUP()
YES

NO
LOOP() Powered

YES
Reset
Button

NO

END

Figure 3.23: Arduino Software Flowchart

Dept. of EEE SICET Page | 55


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

The Setup() function is only operated once when device is booted up, it is mostly
used to perform the initiation settings. The Loop() is ran after the setup() function has finished,
the loop() function runs repeatedly until the power is put off or the reset button is pushed
(Figure 3.32). The Arduino programming is supported by a large number of libraries.

Before writing any code it is important to begin with comment section which contain the
general description of what the code does. The second section is the variable section which
declared the variables used in the program and could be called in any of the sections that
followed.

#include "DHT.h"

#include <LiquidCrystal.h>

#include <SoftwareSerial.h>

#include <EEPROM.h>

#include <avr/pgmspace.h>

#include <string.h>

#define DHTPIN 6

SoftwareSerial mySerial(3,4); // RX, TX LiquidCrystal lcd(8, 9, 10, 11, 12, 13); const char
config_delimeter[2] = "#"; char number[15] = "+254724593277";

The third section is the “void setup()” which defined which pins were input or output and any
other parameter in the program.

void setup() {

Serial.begin(9600); mySerial.begin(9600); lcd. Begin(16, 2); pinMode(ldr_pin, INPUT);


pinMode(light_pin, OUTPUT); pinMode(fan_pin, OUTPUT); pinMode(heater_pin,
OUTPUT); pinMode(sprinkler_pin, OUTPUT); digitalWrite(light_pin,HIGH);
digitalWrite(fan_pin,HIGH); digitalWrite(heater_pin,HIGH);

digitalWrite(sprinkler_pin,HIGH);

Dept. of EEE SICET Page | 56


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

Last section is the “Void loop()” The microcontroller functions were written here. Any
action that needed reading or writing values from pins or computation of different variables
was done here.

void loop() {

while (Serial.available() > 0)

{ sms_rx[index] = Serial.read(); mySerial.print(sms_rx[index]); index++;

data_received = true;

if (data_received) { sms_rx[index] = '\0'; data_received = false;

process_txt(sms_rx);

for (int j = 0; j <= sizeof(sms_rx); j++)

sms_rx[j] = '\0';

} index = 0;

The code to operate the ATmega328 microcontroller in this prototype was


contained in this section. This section is important as it performed the same function repeatedly.
It enabled the microcontroller read the DHT11 sensor, the LDR sensor, HC05 bluetooth device
and GSM SIM800L; and triggered the fans, the heater, the water pump and the bulb. It also
checked the prototype status and updated the user through messages at regular intervals.

The code extract below demonstrates how this function sent a message any time the user
requested the greenhouse parameters.

void process_txt(char *txt)

Dept. of EEE SICET Page | 57


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

{if (strcasestr_P(txt, PSTR("config")) != 0)

if (strcasestr_P(txt, PSTR("data")) != 0)

send_data_text();

if (strcasestr_P(txt, PSTR("manual")) != 0)

auto_mode = false;

send_text(number, manual_activated_string);

if (strcasestr_P(txt, PSTR("auto")) != 0)

auto_mode = true;

send_text(number, auto_activated_string);

Dept. of EEE SICET Page | 58


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

CHAPTER 4

RESULTS AND DISCUSSIONS

4.1 INTRODUCTION

This chapter presents the experimental tests and results obtained on each
component in the process of designing the greenhouse prototype. It also gives in details the
experimental results on testing the performance of the designed prototype of greenhouse
system. First the experiments were carried out on the LDR sensor, the DHT11 sensor, the
HD44780U LCD module, the HCO5 Bluetooth module, the GSM SIM800L module, the 5 V 4
channels relay module and the LM2596 power regulator. Then after each of the parts was tested
on breadboard, all the parts were assembled on the PCB to form the desired greenhouse system.
Finally the performance of the designed system was tested and the results obtained.

4.1.1 Testing the DHT11 Sensor

This research used the PCB mounted DHT11sensor, from Sunrom Company. Figure

4.3 shows how the DHT11 was interfaced to the Arduino during testing process. The DHT11
library files were installed from the arduino libraries and included in the sketch. To output the
humidity and temperature readings, a program to control the DHT11 sensor was uploaded to
the Arduino ATmega328 microcontroller.

Figure 4.1: Interfacing the DHT11 to Arduino

Dept. of EEE SICET Page | 59


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

Figure 4.2: DHT11 Data Output on Arduino Monitor

Figure 4.2shows the Arduino serial monitor indicating the values of temperature and
humidity as measured by the DHT11 sensor.

To study the performance characteristics of the DHT11 sensor: the DHT11 sensor,
hygrometer and mercury thermometer were simultaneously exposed to three different
conditions. The first test was done inside Kenyatta University Physics research laboratory. The
second test was done inside a wooden box placed in the Kenyatta University Physics research
laboratory. The third test was done outside the Kenyatta University Physics research laboratory.
The data was taken at five minutes intervals for a period of 60 minutes. Table 4.2 shows the
humidity and temperature measurements for the data taken inside the laboratory.

Dept. of EEE SICET Page | 60


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

Table 3: Humidity and temperature Data inside the laboratory

From the table it is evident that the DHT11 sensor compared well with the hygrometer
and the thermometer in measuring the humidity and temperature in an ordinary environment
with average humidity and temperatures. Figure 4.5 shows humidity and temperature graph
plotted against time for the data in table 4.2.

Figure 4.3: Comparisons of Humidity and Temperature inside Laboratory

Dept. of EEE SICET Page | 61


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

4.1.2 Testing the 4 Channel 5 V Relay Module

Figure 4.4 shows how the relay module was interfaced with Arduino during testing.

The program to control the relays (Appendix J) was uploaded to the Arduino to test
the module. When the relay module was turned, the four LEDs turned on one by one repeatedly
meaning that the module was working well.

4.2 PROGRAM TEST

In this research; to test the functioning of the sensors, the GSM module, the Bluetooth
module, the LCD module, and the relay modules, separate programs were designed, developed
and implemented. Several simulations and tests were conducted on the devices and after
confirmation of each program proper working, all these programs were integrated to form one
comprehensive program to operate the whole greenhouse prototype. The comprehensive
program was simulated on the Arduino serial monitor before uploading to the ATmega328
microcontroller to ascertain it workability. The software uploading to the ATmega328
controller, was done by first housing the chip to the Arduino board and then configuring the
board and the ports as shown on figure

4.17. After uploading the program, the microcontroller was dismantled from the

Arduino board and plugged in the designed PCB system to operate the system.

Dept. of EEE SICET Page | 62


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

Figure 4.5: Configuring the Arduino Ports

4.3 INPUTS AND OUTPUTS


A greenhouse control and monitoring system typically involves various inputs and
outputs to efficiently regulate the environment within a greenhouse. The goal is to create
optimal conditions for plant growth, ensuring factors like temperature, humidity, light, and
ventilation are within specified ranges. Here's an overview of the inputs and outputs commonly
associated with a greenhouse control and monitoring system:

Inputs:

1.Temperature Sensors:

• Temperature is a critical parameter in a greenhouse. Sensors, such as thermocouples or


thermistors, measure the temperature at different locations within the greenhouse.

2.Humidity Sensors:

• Humidity levels can impact plant health. Humidity sensors measure the moisture
content in the air, helping to maintain the desired humidity range.

3.Light Sensors:

Dept. of EEE SICET Page | 63


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

• To optimize plant growth, light levels need to be monitored. Light sensors measure the
intensity of natural and artificial light in the greenhouse.

4.Soil Moisture Sensors:

• These sensors measure the moisture content of the soil, providing information about
the need for irrigation.

5.CO2 Sensors:

• Carbon dioxide levels are crucial for photosynthesis. CO2 sensors monitor the
concentration of carbon dioxide in the greenhouse air.

6.Ventilation System Feedback:

• Sensors that monitor the state of ventilation systems, including the position of vents
and fans, ensuring proper air circulation.

7.Weather Station Data:

• External weather conditions, obtained from a weather station, can influence the control
system. Data such as outside temperature, humidity, and sunlight can be considered in
the control algorithms.

Figure 4.6: Arduino Uno

Dept. of EEE SICET Page | 64


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

Figure 4.7: Inserting of Arduino Uno Inputs

Outputs:

1.Heating System:

• Based on temperature readings, the control system may activate heating systems to
maintain the desired temperature.

2.Cooling and Ventilation Systems:

• Fans, vents, and other ventilation systems are controlled to regulate temperature and
humidity.

3.Irrigation Systems:

• Controlled watering systems are activated based on soil moisture sensor readings,
ensuring plants receive the appropriate amount of water.

4.Shading Systems:

• Automated shading systems can be adjusted to control the amount of light reaching the
plants.

5.Lighting Systems:

Dept. of EEE SICET Page | 65


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

• Artificial lighting, such as grow lights, can be adjusted based on natural light levels and
the needs of the plants.

6.CO2 Injection Systems:

• If CO2 levels are below optimal, CO2 injection systems can supplement the greenhouse
atmosphere.

7.Alarm Systems:

• Alarms or notifications can be triggered if any of the monitored parameters fall outside
acceptable ranges, alerting greenhouse operators to potential issues.

8.Data Logging and Reporting:

• The system may log data over time and generate reports for analysis. This historical
data can help optimize greenhouse conditions and identify trends.

The combination of these inputs and outputs creates a closed-loop system where the
greenhouse environment is continuously monitored, and adjustments are made in real-time to
create the ideal conditions for plant growth. Advanced systems may also incorporate remote
monitoring and control capabilities, allowing operators to manage the greenhouse environment
from a distance.

Figure 4.8: Output of Greenhouse control monitoring system

Dept. of EEE SICET Page | 66


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

CHAPTER 5

CONCLUSIONS AND FUTURE SCOPE

5.1 CONCLUSIONS

In this work, design and implementation of a microcontroller-based system to


monitor and control greenhouse parameters using sensors, SMS technology and Bluetooth
signals has been achieved. Specifically, the following research objectives were achieved:

(i)The light dependent resistor (LDR) sensor was utilized to measure light intensity and the
DHT11 sensor was utilized to measure humidity and temperature in greenhouse.

(ii) The sensors, the relays, the LCD, the GSM and the Bluetooth were interfaced to the
microcontroller.

(iii) A program in C language was developed and uploaded to the ATmega328 microcontroller
to control the greenhouse prototype.

(iv)The prototype greenhouse system is able to: Measure the temperature levels, the humidity
levels and the light illuminance values in the greenhouse, display the values on the LCD,
transmit it to the owner’s phone via the Bluetooth or the GSM modules and keep these
parameters at optimum levels by use of the fans, the heater, the bulb and the sprinkler.

5.2 FUTURE SCOPE

The future scope of greenhouse control and monitoring systems


is promising and aligned with the growing importance of sustainable agriculture, precision
farming, and environmental conservation. Here are some key areas where advancements and
opportunities may emerge:

1.Integration of IoT and Sensors:

• Continued integration of Internet of Things (IoT) devices and sensors for real-time
monitoring and control. These sensors can provide data on temperature, humidity, soil
moisture, light intensity, and more, allowing for precise adjustments to create optimal
growing conditions.

Dept. of EEE SICET Page | 67


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

2.Data Analytics and Machine Learning:

• Implementation of advanced data analytics and machine learning algorithms to analyze


the vast amount of data collected. This can help in predicting optimal conditions for
plant growth, identifying patterns, and making data-driven decisions to enhance
productivity.

3.Automation and Robotics:

• Increased use of automation and robotics for tasks such as planting, harvesting, and
maintenance. Automated systems can be programmed to respond to environmental
changes, ensuring a more efficient and consistent crop production process.

4.Energy Efficiency and Sustainability:

• Focus on energy-efficient technologies and sustainable practices within greenhouse


systems. This includes the use of renewable energy sources, efficient heating and
cooling systems, and water-saving irrigation methods.

5.Remote Monitoring and Control:

• Advancements in remote monitoring and control systems, allowing farmers to manage


their greenhouse operations from anywhere using mobile apps or web-based platforms.
This can improve efficiency and reduce the need for physical presence on-site.

6.Smart Greenhouses:

• Development of smart greenhouses equipped with automated systems that can respond
to environmental changes in real-time. This includes smart ventilation, shading, and
irrigation systems that adapt to the specific needs of the plants.

7.Blockchain for Supply Chain Transparency:

• Implementation of blockchain technology to ensure transparency in the supply chain.


This can help track the entire lifecycle of agricultural products, from planting to
distribution, providing consumers with information about the origin and quality of the
produce.

Dept. of EEE SICET Page | 68


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

8.Hydroponics and Vertical Farming:

• Integration of hydroponic and vertical farming systems within greenhouses to


maximize space utilization and increase crop yields. These methods are resource-
efficient and can be particularly beneficial in urban areas with limited space.

9.Collaboration with AgTech Companies:

• Collaboration between greenhouse operators and AgTech companies for the


development and implementation of innovative technologies. This can lead to the
creation of customized solutions that address specific challenges in greenhouse
farming.

10.Government Initiatives and Incentives:

• Growing support from governments and agricultural organizations, offering incentives


and support for the adoption of advanced greenhouse technologies. This can accelerate
the integration of modern systems into traditional farming practices.

As technology continues to advance, the future of greenhouse control and


monitoring systems holds great potential for improving agricultural efficiency, sustainability,
and overall crop yield.

Dept. of EEE SICET Page | 69


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

REFERENCES

Arduino Corporation. (2013). Arduino:Arduino Corporation. Retrieved July 17,


2013, from Arduino Corporation Web site: http://arduino.cc/en/Main/ArduinoBoardUno

Augarten, S. (1983). The Most Widely Used Computer on a Chip: The TMS 1000. State of the
Art: A Photographic History of the Integrated Circuit. New York: Ticknor & Fields.

Dabadi, H. (2003). Techonology Transfer:Capacity building and the Private Sector of Nepal.
New York: United Nations.

Fraden, J. (2010). Handbook of Modern Sensors: Physics, Designs, and Applications. . Pringer
Science & Business Media.

Guraiah, B., and Nagaswetha, G. (2014). GSM Based Greenhouse Monitoring System for
Agriculture Field. International Journal of Professional Engineering Studies, 3(3).

Han, M., and Zhao, P. (2011). Design of temperature humidity wireless sensor network node
based on DHT11. Journal of Jinggangshan University (Natural Science), 32: 6770.

Howard, A. (1991). Data Acquisition Techniques Using Personal Computers. San Diego:
Academic Press.

Huho, J., and Kosonei, R. (2010). Understanding Extreme Climatic Events for Economic
Development in Kenya. International Organization of Scientific Research Journal of
Environmental Science, Toxicology and Food Technology, 8: 14-25.

Karvinen, T., and Karvinen, K. (2014). Getting Started with Sensors: Measure the World with
Electronics, Arduino, and Raspberry Pi. Maker Media, Inc.

Marhaento, B., and Singh, H. (2002). Development of a Computer Based Greenhouse


Environment Controller. Proceedings of the World Congress of Computers in Agriculture and
Natural Resources, (pp. 13-15). Retrieved December 23, 2018, from American Society of
Agriculture and Biological Engineers: http;//www.asabe.org

Mizunuma, S., Katoh, T., and Hata, S. (2003). Applying IT to farm fields—a wireless LAN.
Journal of Nippon Telegraph and Telephone Technical Corporation Review, 2: 56–60.

Dept. of EEE SICET Page | 70


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

Morais, R., Cunha, J., Cordeiro, M., Serodio, C., Salgado, P., and Couto, C. (1996). Solar data
acquisition wireless network for agricultural applications. Proceedings of the 19th IEEE
Convention of Electrical and Electronics Engineers in Israel, (pp. 527–530). Jerusalem, Israeli.

Narasaiah, M. (2007). Energy and food security. New Suchin: Delhi.

Obanda, W. (2010). Design and fabrication of an electronic system for monitoring and
controlling temperature, light illuminance and humidity in a greenhouse. Master's
thesis,Kenyatta University,Kenya.

Paavola, M. (2007). Wireless Technologies in Process Automation - A Review and an


Application Example. Oulu,Finland: University of Oulu.

Plaksina, O., & Raush, T. (2005). Development of a KNX Based Greenhouse Climate Control.
Journal of Vienna University of Technology, Institute of Computer Technologies, 27-29.

Pushkar, M., and Amey, D. (2016). PIC Microcontroller Based Greenhouse Monitoring and
Control System. International Journal of Advanced Research in Electrical, Electronics and
Instrumentation Engineering, 5(9).

Quan, M. (2011). Automated Wireless Greenhouse Management System. New Zealand:


Massey University.

Rana, H., Ali, F., and Moofed, T. (2013). Wireless Monitor and Control system for greenhouse.
International Journal of Computer Science and Mobile Computing, 2 (12): 69-87.

Remya, K., Yaseen, M., Nisil, M., and Ajay, M. (2016). Greenhouse Monitoring and Control
Based on IOT Using WSN. ITSI Transactions on Electrical and Electronics Engineering(ITSI-
TEEE), 4 (3): 2320-8945.

Dept. of EEE SICET Page | 71


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

APPENDIXES

APPENDIX A: GREENHOUSE PROGRAM

Writing a complete program for a greenhouse control monitoring system involves


various components and complexities that may go beyond the scope of a single response.
However, I can provide you with a basic example using Embedded C for a simplified
greenhouse temperature control system. This example assumes that you have a microcontroller
with analog-to-digital converter (ADC) capabilities and digital output pins for controlling
devices like heaters and fans.

#include <avr/io.h>

#include <util/delay.h>

// Define ADC channel for temperature sensor

#define TEMP_SENSOR_CHANNEL 0

// Define threshold temperatures

#define UPPER_TEMP_THRESHOLD 30 // Example upper temperature limit

#define LOWER_TEMP_THRESHOLD 20 // Example lower temperature limit

// Define digital output pins

#define HEATER_PIN PB0

#define FAN_PIN PB1

// Function to initialize ADC

void init_ADC() {

// Set AVCC as reference voltage, enable ADC, and set prescaler to 128 (for example)

ADMUX |= (1 << REFS0);

ADCSRA |= (1 << ADEN) | (1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0);

// Function to read temperature from sensor

Dept. of EEE SICET Page | 72


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

uint16_t read_temperature() {

// Start ADC conversion

ADCSRA |= (1 << ADSC);

// Wait for conversion to complete

while (ADCSRA & (1 << ADSC));

// Return ADC result

return ADC;

// Function to control heater and fan based on temperature

void control_temperature(uint16_t temperature) {

if (temperature > UPPER_TEMP_THRESHOLD) {

// Temperature is too high, turn on fan and turn off heater

PORTB |= (1 << FAN_PIN);

PORTB &= ~(1 << HEATER_PIN);

} else if (temperature < LOWER_TEMP_THRESHOLD) {

// Temperature is too low, turn on heater and turn off fan

PORTB |= (1 << HEATER_PIN);

PORTB &= ~(1 << FAN_PIN);

} else {

// Temperature is within the desired range, turn off both heater and fan

PORTB &= ~((1 << HEATER_PIN) | (1 << FAN_PIN));

int main(void) {

Dept. of EEE SICET Page | 73


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

// Initialize digital output pins for heater and fan

DDRB |= (1 << HEATER_PIN) | (1 << FAN_PIN);

// Initialize ADC

init_ADC();

while (1) {

// Read temperature from sensor

uint16_t temperature = read_temperature();

// Control temperature based on the read value

control_temperature(temperature);

// Add a delay to avoid rapid changes in control state

_delay_ms(1000);

return 0;

This is a simple example that reads the temperature from an analog sensor using
an ADC, and based on the temperature readings, it controls a heater and a fan. You may need
to adapt this example to your specific microcontroller and sensor interfaces. Additionally, for
a complete greenhouse control system, you would need to integrate other sensors, actuators,
and control algorithms based on the requirements of your greenhouse environment.

Dept. of EEE SICET Page | 74


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

APPENDIX B: FLOWA:
APPENDIX CHART OF THE
Flow Chart ofPROTOTYPE
the PrototypeGREENHOUSE PROGRAM
Greenhouse Progr

Dept. of EEE SICET Page | 75


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

Dept. of EEE SICET Page | 76


IMPLEMENTATION OF GREEN HOUSE CONTROL AND MONITORING SYSTEM

APPENDIX C: ATmega3281PINS CONFIGURATION

Pin Pin Description Secondary Function


Name

1 PC6 Pin 6 of PORTC RESET pin

2 PD0 Pin 0 of PORTD RXD for USART

3 PD1 Pin 1 of PORTD TXD for USART

External Interrupt 2 Input

4 PD2 Pin 2 of PORTD External Interrupt source 0

5 PD3 Pin 3 of PORTD External Interrupt source1

PWM - Timer/Counter2 Output

6 PD4 Pin 4 of PORTD Timer0 External Counter Input


USART External Clock I/O

7 VCC Positive voltage connection

8 GND Ground connection

9 PB6 Pin 6 of PORTB Clock Oscillator pin 1 Timer


Oscillator pin 1

10 PB7 Pin 7 of PORTB Clock Oscillator pin 2 Timer


Oscillator pin 2

11 PD5 Pin 5 of PORTD Timer1 External Counter Input

PWM Counter0 Output B Compare

12 PD6 Pin 6 of PORTD Analog Comparator Positive I/P

PWM Counter0 Output A Compare

13 PD7 Pin 7 of PORTD Analog Comparator Negative I/P

14 PB0 Pin 0 of PORTB Counter1 Input Capture Pin

15 PB1 Pin 1 of PORTB Counter1 Output Compare A Output

16 PB2 Pin 2 of PORTB SPI Slave Select Input

Counter1 Output Compare A Output

Dept. of EEE SICET Page | 77


IMPLEMENTATION OF GREEN HOUSE
1 CONTROL AND MONITORING SYSTEM

16 PB2 Pin 2 of PORTB SPI Slave Select Input

Counter1 Output Compare A Output

17 PB3 Pin 3 of PORTB MOSl input

SPI for programming

Counter2 Output Compare B Output

18 PB4 Pin 4 of PORTB MISO

SPI for programming

19 PB5 Pin 5 of PORTB SPI Bus Serial Clock SPI for


programming

20 AVCC Power for Internal ADC

21 AREF ADC Analog Reference Pin

22 GND GROUND

23 PC0 Pin 0 of PORTC ADC Input Channel 0

24 PC1 Pin 1 of PORTC ADC Input Channel 1

25 PC2 Pin 2 of PORTC ADC Input Channel 2

26 PC3 Pin 3 of PORTC ADC Input Channel 3

27 PC4 Pin 4 of PORTC ADC Input Channel 4

2-wire Serial Bus Data I/O

28 PC5 Pin 5 of PORTC ADC Input Channel 5

Two-wire Serial Bus Clock Line

Dept. of EEE SICET Page | 78

You might also like