scieee AI-readable full text Open interactive document viewer

Development of a Small-Scale Smart Greenhouse with Microclimate Monitoring and Control for Indoor Agriculture

Iyaomolere, B.A.; Akinsade, A.; Akinbola, O.P.

Abstract

Greenhouse cultivation supports stable crop production but most smart greenhouse systems depend on natural sunlight and are unsuitable for fully indoor environments where all microclimatic variables must be artificially regulated. This study addresses this gap by developing a compact, low-cost indoor smart greenhouse equipped with temperature, humidity, soil moisture, and motion sensors integrated with an ESP32 microcontroller to enable real-time monitoring and automated control of ventilation, irrigation, and ultraviolet (UV)-enabled grow lighting. A wooden-acrylic enclosure was constructed, and a unified control algorithm was implemented to maintain optimal indoor conditions based on sensor feedback. Functional evaluation confirmed reliable sensing performance, stable data synchronisation, and accurate actuation. The system was further assessed using a 10-day cowpea (Vigna unguiculata) growth experiment, during which plants grown inside the greenhouse exhibited healthier early-stage development than those grown outdoors. Quantitative analysis showed a mean absolute percentage error of 37.66% and a root mean square error of 3.27 cm between the greenhouse and natural growth curves, indicating a substantial improvement in growth consistency under controlled indoor conditions. These results demonstrate that it is possible to fully regulate the indoor microclimate to enhance early-stage crop growth, supporting the application of low-cost smart greenhouses in indoor agriculture.

Full text

608 Nigerian Research Journal of Engineering and Environmental Sciences 10(2) 2025 pp. 608-620 p ISSN: 2635-3342; e ISSN: 2635-3350 Original Research Article Development of a Small-Scale Smart Greenhouse with Microclimate Monitoring and Control for Indoor Agriculture *1Iyaomolere, B.A., 2Akinsade, A. and 1Akinbola, O.P. 1Department of Electrical and Electronics Engineering, Olusegun Agagu University of Science and Technology, Okitipupa, Ondo State, Nigeria. 2Department of Mechanical Engineering, Olusegun Agagu University of Science and Technology, Okitipupa, Ondo State, Nigeria. *[email protected] http://doi.org/10.5281/zenodo.18062056 ARTICLE INFORMATION ABSTRACT Article history: Received 04 Nov. 2025 Revised 28 Nov. 2025 Accepted 13 Dec. 2025 Available online 30 Dec. 2025 Greenhouse cultivation supports stable crop production but most smart greenhouse systems depend on natural sunlight and are unsuitable for fully indoor environments where all microclimatic variables must be artificially regulated. This study addresses this gap by developing a compact, low-cost indoor smart greenhouse equipped with temperature, humidity, soil moisture, and motion sensors integrated with an ESP32 microcontroller to enable realtime monitoring and automated control of ventilation, irrigation, and ultraviolet (UV)-enabled grow lighting. A wooden-acrylic enclosure was constructed, and a unified control algorithm was implemented to maintain optimal indoor conditions based on sensor feedback. Functional evaluation confirmed reliable sensing performance, stable data synchronisation, and accurate actuation. The system was further assessed using a 10-day cowpea (Vigna unguiculata) growth experiment, during which plants grown inside the greenhouse exhibited healthier earlystage development than those grown outdoors. Quantitative analysis showed a mean absolute percentage error of 37.66% and a root mean square error of 3.27 cm between the greenhouse and natural growth curves, indicating a substantial improvement in growth consistency under controlled indoor conditions. These results demonstrate that it is possible to fully regulate the indoor microclimate to enhance early-stage crop growth, supporting the application of low-cost smart greenhouses in indoor agriculture. © 2025 RJEES. All rights reserved. Keywords: Smart greenhouse Indoor agriculture Microclimate control Automated irrigation UV grow light Web-based Mobile App 1. INTRODUCTION Greenhouse systems are generally associated with the development of a controlled environment that maximises crop productivity and stabilises crop growth, especially in areas with highly fluctuating 609 B.A. Iyaomolere et al. / Nigerian Research Journal of Engineering and Environmental Sciences 10(2) 2025 pp. 608-620 climates and resource constraints that limit agricultural output (Badu, 2023; Argento et al., 2024). Traditional greenhouse systems are commonly reliant on manual control of temperature, humidity, irrigation, and lighting, which in turn usually leads to inconsistent microclimatic conditions and suboptimal crop performance (Bhujel et al., 2020; Ghiasi et al., 2023). Automatic sensing and smart environmental control have therefore become critical in contemporary protected cultivation. However, most available systems are optimised to operate outdoors or in semi-outdoor settings and partially depend on natural light, which limits their applicability to fully enclosed indoor environments where all environmental factors must be artificially controlled (Jung and Arar, 2023; Rampinelli et al., 2024). These limitations serve as a motivation for the development of small, self-contained greenhouse designs capable of maintaining optimal growth conditions independently of sunlight. The latest achievements in the development of Internet of Things (IoT)-based monitoring devices have significantly increased the degree of automation that can be attained in the greenhouse setting because they allow the acquisition of environmental parameters in a continuous manner and enable the microclimate to be controlled more accurately (Maraveas and Bartzanas, 2021). The existing research has demonstrated that the combination of sensors, embedded controllers, and communication modules can contribute greatly to the control of temperature, humidity, and soil-moisture dynamics (Vimal and Shivaprakasha, 2017; Singh et al., 2024). Additionally, automated ventilation systems and sensorcontrolled irrigation systems have also been described as a way to reduce the variability of the environment and provide more stable conditions in which optimal plant growth can occur (Ardiansah et al., 2020; Bhujel et al., 2020). The relevance of wireless connectivity and low-cost embedded systems to enhance the availability and dependability of automation in greenhouses has been demonstrated in complementary studies (Nyaga et al., 2023; Alsayaydeh et al., 2023). Altogether, these findings confirm the technical feasibility of IoT-based greenhouse systems, but they do not provide much insight into fully indoor, small-scale cultivating settings where natural light is completely excluded and complete environmental control is necessary. The use of artificial lighting has been made a necessity in controlled greenhouse setups, especially where the use of natural sunlight is not accessible or insufficient. Additionally, Light Emitting Diode (LED) systems have extensively been shown to adjust the morphology of crops, promote photosynthetic capability, as well as overall vegetative functionality. As an example, the production of crops in protected cultivation systems under LED light has been demonstrated to excel with high quality and yield (Rahman et al., 2021). The yield, quality of the fruits, and water-use efficiency of greenhouse tomatoes can also be greatly affected by the spatial configuration of LED arrays (Zhao et al., 2025). Moreover, Fang et al. (2021) established that the different LED light spectra significantly influence the plant growth and photosynthetic properties of soybean seedlings, whereas Yan et al. (2022) found that the use of both white and blue LED lighting positively impacts the physiological reactions and even growth in cucumber seedlings. Even with these developments, most of the current research is on largescale and medium-sized greenhouse systems and usually presupposes some natural or ambient light input, particularly where smaller-scale systems or systems that are entirely closed have not been well researched. Hence, this study focuses on developing a fully indoor, miniature, and low-cost smart greenhouse that operates without natural sunlight and incorporates built-in monitoring and closed-loop control systems. The specific objectives of the research are to: (i) build a compact enclosure equipped with temperature, humidity, soil-moisture, and motion sensors; (ii) implement a microcontroller-based algorithm controlling ventilation, irrigation, and UV-enabled lighting; and (iii) evaluate performance through functional testing and a cowpea growth experiment conducted under fully artificial indoor conditions. The study contributes to controlled-environment indoor agriculture and demonstrates the feasibility of early-stage crop production in fully enclosed artificial environments. 610 B.A. Iyaomolere et al. / Nigerian Research Journal of Engineering and Environmental Sciences 10(2) 2025 pp. 608-620 2. MATERIALS AND METHODS 2.1. System Overview The small-scale smart greenhouse was designed as an integrated platform for continuous microclimate monitoring and automated environmental regulation. As illustrated in Figure 1, the system comprises four major functional units: the sensor unit, the microcontroller unit (MCU), the actuator unit, and the power unit. The sensor unit includes a temperature and humidity sensor, soil moisture sensors, and a passive infrared motion sensor that collectively provide real time measurements of environmental variables within the greenhouse. These data are transmitted to the MCU, which evaluates the readings against predefined thresholds and determines the adjustments required to maintain favourable conditions for plant growth. Figure 1: System architecture of the smart greenhouse system The system operates through a closed-loop control process that enables timely responses to changes in the greenhouse environment. When corrective action is required, the microcontroller activates the appropriate actuator, which may include the cooling fan, the water pump, or the grow light. System updates can be viewed locally through an LCD display or accessed remotely through wireless communication via a mobile application. This architectural configuration offers a compact, reliable, and responsive solution suitable for small-scale controlled-environment agriculture, where maintaining stable microclimatic conditions is essential for improving crop productivity. 2.2. Hardware Components The hardware configuration of the small-scale smart greenhouse system consists of the sensing unit, controller unit, actuation unit, display unit, and power supply unit. These components collectively enable continuous environmental monitoring and automated microclimate regulation. Table 1 summarises all hardware components and their primary functions. The following subsections describe the technical properties of each component and the reasons for their selection. 2.2.1. Sensor unit The sensor unit comprises a DHT22 temperature and humidity sensor, YL–69 soil moisture sensors with analog interface boards, and a passive infrared (PIR) motion sensor. The DHT22 was selected because it provides accurate digital readings with a temperature precision of ±0.5 °C, humidity accuracy of ±2 %, and an operational range of −40 to 80 °C, making it suitable for continuous IoT-based environmental monitoring (Ahmad et al., 2021). The YL–69 soil moisture sensors were chosen due to their sensitivity to changes in volumetric soil water content and compatibility with the analog input pins of the ESP32 controller (Sharma et al., 2025). The PIR sensor, operating typically at 3.3 V with low standby current, was included for its reliable detection of human presence and its value in basic system security (Saeed et al., 2019). Together, these sensors provide the essential real time data required for automated control of the greenhouse environment. 611 B.A. Iyaomolere et al. / Nigerian Research Journal of Engineering and Environmental Sciences 10(2) 2025 pp. 608-620 2.2.2. Controller unit The ESP32 microcontroller serves as the central processing and communication unit of the system. It was selected because it integrates a dual core 32–bit processor, built in Wi-Fi (IEEE 802.11 b/g/n), Bluetooth capability, and an operating voltage of 3.3 V. These features enable efficient real-time data acquisition, control execution, and wireless interaction with the user interface (Iyaomolere et al., 2025). The ESP32 provides multiple GPIO channels that support both analog and digital interfacing, facilitating seamless integration of sensors and actuators. Its compatibility with the Arduino development environment and low power consumption further justify its use in IoT-based agricultural automation. Table 1: List of components used with their functions Component Model / Specification Function Temperature and Humidity Sensor DHT22 Measures internal air temperature and relative humidity for microclimate regulation. Soil Moisture Sensors YL–69 with analog interface board Monitors volumetric soil water content to support automatic irrigation control. Motion Sensor Passive Infrared (PIR) Sensor Detects human presence for security and system awareness. Microcontroller ESP32 (Dual-core 32-bit, Wi-Fi enabled) Performs data acquisition, processing, automated control, and wireless communication. Water Pump 12 V, 1.5 A mini pump Provides irrigation by supplying water to the plant bed when soil moisture is low. Cooling Fan 5 V DC fan Enhances air circulation and helps maintain internal temperature stability. Grow Light 5 V LED grow light Provides supplemental illumination when natural light is insufficient. Relay Module 4-channel relay board Enables safe switching between the microcontroller and higher power actuators. Display Unit 20 × 4 LCD with I²C interface Displays real-time temperature, humidity, soil moisture, and actuator status. Battery 12 V, 15 Ah lithium-ion battery Serves as the primary energy source for the system. Battery Management System 60 A BMS Protects the battery from overcharge, overdischarge, and thermal stress. DC-DC Buck Converters LM2596 Regulate voltage supply for actuators, controller, sensors, and display. Greenhouse Structure Wooden base and acrylic mini greenhouse Provides the physical enclosure for the controlledenvironment system. Irrigation Tubing Flexible rubber microtubing Delivers water from the pump to the plant bed. 2.2.3. Actuation unit The actuation unit includes a 12 V water pump, a 5 V cooling fan, and a 5 V grow light, all of which are controlled through a 4-channel relay module. The water pump, rated at approximately 1.5 A, was selected for its adequate hydraulic performance and suitability for small-scale irrigation in enclosed systems. The 5 V cooling fan was chosen because it improves air circulation and contributes to temperature stabilisation within the greenhouse. The 5 V UV-enabled grow light provides illumination for the indoor greenhouse and supports uniform plant development. The relay module ensures safe switching by isolating the control signals from the higher current demands of the actuators, thereby protecting the microcontroller from electrical stress. 612 B.A. Iyaomolere et al. / Nigerian Research Journal of Engineering and Environmental Sciences 10(2) 2025 pp. 608-620 2.2.4. Display unit A 20 × 4 liquid crystal display operating on an I²C interface was integrated for local presentation of temperature, humidity, soil moisture levels, and actuator status. The display requires only two communication lines, which reduces wiring complexity and supports efficient hardware integration. Its low power consumption, clear alphanumeric output, and stable visibility make it appropriate for continuous indoor monitoring in small-scale IoT systems. 2.2.5. Power supply unit The power supply unit consists of a 12 V, 15 Ah lithium-ion battery, a 60 A battery management system, and two DC-DC buck converters. The lithium-ion battery was selected due to its high energy density, low self-discharge rate, and ability to sustain prolonged system operation. The battery management system protects the battery against overcharging, over discharging, overcurrent, and thermal stress, ensuring safe and reliable operation. Two buck converters were employed: one steps the 12 V supply down to a regulated 5 V for the ESP32, sensors, relay board, cooling fan, grow light, and display; the second provides a stable 3.3 V supply for components that require a lower operating voltage. This configuration ensures uninterrupted and efficient power delivery to both low power electronics and higher current actuators. 2.3. Software and Control Algorithm The software for the small-scale smart greenhouse system was developed on the ESP32 using the Arduino integrated development environment. The firmware handles periodic sensor data acquisition, execution of the automated control algorithm, mode management, and communication with the web-based mobile interface. The main program loop continuously reads temperature, humidity, soil moisture, and motion status, updates internal variables, and applies corresponding actuator commands. The automated decision strategy is summarised in Algorithm 1, which computes the average soil moisture from the four YL–69 sensors, evaluates it against a predefined threshold, and activates the pump for a fixed duration if automatic pump mode is enabled and the irrigation interval has elapsed. Temperature and humidity regulation follow a similar rule-based structure, while lighting control is governed by an internal schedule when light auto mode is selected. Algorithm 1: Automated control algorithm 01: Begin 02: automatedControl (now, T, H, soil [1...4], PIR_state) 03: avgSoil ← AVERAGE (soil [1...4]) 04: IF pumpAuto AND (now − lastPumpCheckTime ≥ PUMP_INTERVAL) AND 05: avgSoil < PUMP_THRESHOLD THEN 06: ACTIVATE_PUMP_FOR(PUMP_DURATION); lastPumpCheckTime ← now 07: END IF 08: IF fanAuto AND (T > TEMP_MAX OR H > HUM_MAX) THEN 09: fanOn ← TRUE 10: ELSE fanOn ← FALSE 11: IF lightAuto THEN 12: lightOn ← WITHIN_LIGHT_SCHEDULE(now) 13: END IF 14: IF pirEnabled AND PIR_state = DETECTED THEN 15: warningOn ← TRUE; lastMotionTime ← now 613 B.A. Iyaomolere et al. / Nigerian Research Journal of Engineering and Environmental Sciences 10(2) 2025 pp. 608-620 16: IF warningOn AND (now − lastMotionTime > WARNING_DURATION) THEN 17: warningOn ← FALSE 18: END IF 19: APPLY_OUTPUT_STATES (fanOn, lightOn, warningOn) 20: End The operational sequence implemented in the firmware is illustrated in Figure 2, which shows the flow from system initialisation through data acquisition, condition evaluation, and actuation. For motion detection, the controller monitors the passive infrared sensor to determine whether movement has occurred; if motion is detected and the feature is enabled, a warning state is activated and maintained for a specified duration before being cleared. Manual override is supported by reading user inputs from physical buttons and the web interface, which allows each actuator to be switched between automatic and manual operation. This ensures both autonomous microclimate regulation and user flexibility for intervention when required. Figure 2: Flowchart of the smart greenhouse operation In addition to the embedded control algorithm, the ESP32 hosts a lightweight web server that provides a responsive mobile application interface, shown in Figure 3. The interface displays real time temperature, humidity, individual soil moisture readings, the computed average soil moisture, and motion status. It also provides actuator controls with ON, OFF, and AUTO options, as well as settings for enabling or disabling motion-based warnings. Communication occurs over Wi Fi through standard HTTP requests, allowing users to monitor system performance and modify control parameters from any compatible device. Together, the control algorithm, flow structure, and web interface constitute a compact and efficient software framework for closed-loop microclimate management in the smart greenhouse system. 614 B.A. Iyaomolere et al. / Nigerian Research Journal of Engineering and Environmental Sciences 10(2) 2025 pp. 608-620 Figure 3: User interface of the web-based mobile app 2.4. System Integration The small-scale greenhouse structure was designed to provide a compact and stable enclosure suitable for controlled-environment cultivation. The greenhouse measures approximately 50 cm in length, 40 cm in width, and 50 cm in height, offering sufficient internal space for sensor placement, airflow circulation, and crop development during testing. The base was constructed from treated wooden panels, selected for their structural rigidity, ease of machining, and ability to support mounted components without warping. The side walls and roof were fabricated from transparent acrylic sheets, chosen for their high optical clarity, low weight, moisture resistance, and suitability for small-scale agricultural experiments. This combination of materials creates a lightweight yet durable enclosure capable of maintaining a consistent microclimate. The electrical integration of the system is illustrated in Figure 4, which shows the interconnection between the sensors, controller, actuators, display, and power supply modules. The ESP32 microcontroller interfaces with the DHT22, YL–69 soil moisture sensors, and the passive infrared sensor through dedicated generalpurpose input and output pins, while all actuators are controlled through a four-channel relay module to ensure safe electrical isolation. Two DC–DC buck converters provide regulated 5 V and 3.3 V outputs from the 12 V battery to power the respective system components. The wiring layout was arranged to minimise signal interference, maintain voltage stability, and support efficient power and data distribution across the greenhouse. The fully assembled system is presented in Figure 5, which depicts the placement of the controller housing, sensors, actuators, LCD unit, and irrigation components within the greenhouse structure. The temperature and humidity sensor was positioned near the upper region of the enclosure to capture representative air conditions, while the soil moisture sensors were inserted at distributed points in the growing medium. The cooling fan and grow light were mounted on the acrylic frame to optimise airflow and illumination, and the water pump was connected to micro tubing extending across the plant bed. This integrated arrangement ensures coordinated operation of all hardware units and supports reliable real time monitoring and automated microclimate control within the greenhouse environment. 615 B.A. Iyaomolere et al. / Nigerian Research Journal of Engineering and Environmental Sciences 10(2) 2025 pp. 608-620 Figure 4: Circuit diagram of the smart greenhouse system ` Figure 5: The developed smart greenhouse system 2.5. Experimental Setup The experimental evaluation involved cultivating cowpea (Vigna unguiculata) inside the greenhouse to assess how effectively the system supported suitable growing conditions. Cowpea was selected because its development depends strongly on temperature, humidity, soil moisture, and lighting, which correspond directly to the variables monitored and controlled by the system. The experiment was conducted over a 10day period due to the small size of the greenhouse. The soil bed was prepared with a uniform medium, the seeds were planted at equal spacing, and the four YL–69 soil moisture sensors were placed at distributed points to obtain representative readings. The DHT22 sensor was positioned in the upper region to measure ambient air conditions. The environmental requirements for cowpea growth (Mohammed et al., 2021) and the configuration thresholds used in the automated control logic are summarised in Table 2, which guided the system’s irrigation, ventilation, and lighting responses. Functional tests were carried out in addition to the crop-based assessment to verify the performance of the sensing and actuation processes. These included checking soil moisture sensor responsiveness under different watering levels, validating temperature and humidity readings, and confirming that the pump and fan activated at the configured thresholds in Table 2. The grow light schedule was tested for correct switching 616 B.A. Iyaomolere et al. / Nigerian Research Journal of Engineering and Environmental Sciences 10(2) 2025 pp. 608-620 behaviour, and PIR motion detection was examined to ensure reliable activation and clearing of the warning state. After these validations, the system operated continuously in automatic mode while daily plant height, germination time, and visual growth characteristics were recorded and compared with a control sample grown under natural conditions. Table 2: Environmental conditions for cowpea growth and control parameters Parameter Optimal Range Configured Threshold Control Action Temperature 18–27 °C Fan triggers at > 35 °C Activate cooling fan Relative Humidity 50–70 % Fan triggers at > 75 % Activate cooling fan Soil Moisture Moderately moist, nonwaterlogged Pump activates when average moisture < 40 % Activate water pump for fixed duration Light Requirement 8–10 hours daily Automated light schedule (12hour cycle) Turn grow light ON/OFF Airflow Moderate Based on fan state Improve ventilation Motion Response Not crop-specific Based on PIR detection Trigger warning indicator 3. RESULTS AND DISCUSSION 3.1. System Functional Assessment The initial evaluation of the smart greenhouse system focused on validating the performance of its sensing, processing, and actuation components. The functional testing outcomes are presented in Table 3, all of which indicate that the system operated as expected. The soil moisture sensors produced consistent variations corresponding to changes in soil water content, while the DHT22 accurately measured temperature and humidity relative to reference readings. The PIR sensor reliably detected human motion, and the relay module switched the fan, pump, and grow light without delays. The LCD display presented real-time measurements correctly, and the manual control buttons responded without latency. Successful data synchronisation among the sensors, microcontroller, LCD, and mobile interface was further confirmed by the results in Figure 6, demonstrating stable communication and proper updating of sensor values across all system components. Table 3: Summary of functional testing results Component Expected Output Observed Output Status Soil Moisture Sensors Detect varying soil moisture levels Output varied consistently with moisture Pass DHT22 Sensor Measure temperature and humidity Accurate readings of temperature and humidity Pass PIR Motion Sensor Detect human or animal movement LED indicator triggered on detection Pass Relay Module Switch fan, pump, and light ON/OFF Devices switched reliably Pass LCD Display Display sensor readings and device status Displayed accurate, real-time data Pass Manual Control Buttons Toggle actuators and manual mode Worked as designed without delays Pass The functional evaluation showed that the smart greenhouse system performed reliably, with all sensing and actuation components responding correctly to environmental conditions. The accurate behaviour of the DHT22 and soil moisture sensors, together with the stable switching of the pump, fan, and grow light, indicates that the system maintained a consistent feedback loop for environmental regulation. The synchronisation observed across the ESP32 controller, LCD display, and mobile interface (Figure 6)