Agro Intelligence Research Press Agro Intelligence Research Press

An Intelligent IoT-Based Oyster Mushroom Farming System for Remote Environmental Monitoring and Control

Original Research | Open access | Published: 15 September 2024
Volume 3, article number 104, (2024) Cite this article
You have full access to this open access article.
Download PDF
, , ,
  1. Department of IoT for Oyster Mushroom Farming, Faculty of Agriculture, University of Barcelona, Barcelona, Spain
  2. Department of Remote Environmental Monitoring for Mushrooms, Faculty of Agricultural Sciences, University of Lisbon, Lisbon, Portugal
  3. Department of Intelligent Control for Mushroom Cultivation, Faculty of Agriculture, University of Porto, Porto, Portugal
113 Accesses

Abstract

Fungi represent a highly nutritious dietary staple that can be essential for supplying cost-effective protein, vitamins, and minerals to populations around the globe; however, their successful cultivation requires extensive training and specialized knowledge to carefully calibrate a range of environmental variables. Internally displaced populations located in Northern Syria depend on extremely limited traditional oyster mushroom farming, which falls short of meeting local consumption requirements. Numerous international and local non-governmental organizations (NGOs) supporting Syrian refugees run mushroom-farming programs. They have encountered considerable difficulties and obstacles in mushroom farming among the intended participants. Thus, the two core questions steering this investigation are: (1) How might organic mushroom farming be advanced via a reliable and low-cost intelligent cultivation system? (2) In what ways can organic mushroom farming methods be streamlined to assist internally displaced persons and Syrian refugees? This investigation examines the mechanization of mushroom farming by designing and implementing an intelligent oyster (Pleurotus ostreatus) cultivation system for remote surveillance and adjustment of environmental conditions—temperature, humidity, air quality, and light—within the growing space. Additionally, ready-made and purpose-built, intuitive web interfaces were created to enable growers to survey and operate their farms via the Internet remotely. Consequently, a trustworthy and economically viable intelligent oyster mushroom cultivation system was designed and successfully implemented in this study. The system encompasses remote surveillance and operation via intuitive interfaces. This makes mushroom farming more straightforward not only for displaced populations and refugees but also for mushroom growers in nations with limited financial resources. This research can aid in the elimination of poverty and hunger, in accordance with the United Nations Sustainable Development Goals one and two.

Explore related subjects
Discover the latest articles in related subjects:

Introduction

Mushrooms constitute a significant food resource, abundant in proteins, dietary fibre, antioxidants, and an array of vitamins and minerals. Nevertheless, their cultivation requires comprehensive training and substantial relevant knowledge to fine-tune multiple environmental parameters [1]. These include temperature, moisture, light exposure, and air circulation, all of which must be precisely regulated to achieve successful yields. If not, the harvest becomes vulnerable to contamination or reduced output. Syria's devastating conflict over the past ten years triggered the displacement of numerous experienced agricultural workers and the extensive destruction of arable land. Moreover, the COVID-19 outbreak and the subsequent global economic disruptions, including supply chain breakdowns, have worsened these already dire circumstances, placing food security and adequate nutritional supplies under severe threat.

A considerable number of Syrian refugees in adjacent countries are engaged in agricultural work and participate in small- to medium-scale mushroom enterprises. As an illustration, a multitude of mushroom farms are run by Syrian refugees in Turkey, where the nation's overall mushroom output reached 55,455 tons in 2020 [2]. An 85 m² oyster mushroom greenhouse/farm in Turkey, with a capacity of 1000 × 10-kg bags, can yield roughly 2700–3000 kg of mushrooms per cycle. Conversely, internally displaced Syrians in Northern Syria rely on extremely modest traditional mushroom farming, which is insufficient to meet local needs. For instance, a typical 3 × 4 m² oyster mushroom farm in these areas might yield around 300–400 kg per cycle. Furthermore, imported mushrooms are neither readily available nor cost-effective. To the best of our knowledge, no precise statistics are available for the Syrian mushroom sector.

Several international and local Non-Governmental Organizations (NGOs), including the International Agricultural Cooperation Organization (IACO) and Shafak, that serve Syrian refugees, operate mushroom farming initiatives. They have noted marked difficulties and obstacles in mushroom cultivation among the target participants, predominantly housewives, even after the provision of materials and basic training, owing to the intricacies of environmental regulation [3]. These obstacles lead to higher failure rates among cultivators lacking sufficient experience as they attempt to manage the numerous overlapping environmental factors that impact and contaminate the mushrooms.

These factors provided the impetus for this investigation, aiming to engineer and deploy an intelligent, economically accessible mushroom farming system that streamlines the production workflow for organic mushroom growers, with a particular emphasis on internally displaced persons and Syrian refugees.

Broadly speaking, smart farming employs diverse information and communication technologies (ICT) [4] to advance sustainable agricultural practices, conserve resources, and boost both efficiency and yield through remote monitoring and management [5]. Several recent reviews [6-8] have surveyed the techniques, prospects, and challenges of smart agriculture across various crop types and farming systems. In the context of mushroom production, conventional practices have long prevailed. Yet, the integration of cutting-edge technologies for monitoring and controlling the growing process has only recently been explored.

Smart technologies were brought into mushroom farming relatively recently, particularly for small- and medium-scale operations. Angral and Thakur [9] sorted existing mushroom-growing setups into PLC-based, microcontroller-based, and IoT-based categories. That paper, however, did not detail the specific IoT platform or the data acquisition instruments used in the study. Thong-un and Wongsaroj [10] adopted a smart, wireless industrial PLC for cordless observation, control, and data transmission to a database, aiming to boost oyster mushroom productivity in Thailand. The wireless PLC node captures various environmental conditions, such as temperature and humidity, via sensors to control misting, sprinklers, and ventilation fans. Both on-location and distant observation and regulation of the mushroom cultivation system were facilitated through on-site human-machine interface (HMI) displays or web-based applications. The architecture, constituent parts, and operational methodology of the system are thoroughly detailed and depicted. Yet, the study did not address the impact of carbon dioxide (CO₂) and overall air quality within the mushroom farm. A comparable system was engineered in Malaysia by Ten et al. [11] for an automated controlled environment mushroom house (CEMH) employing a remote terminal unit, ADAM-3600, Internet of Things (IoT) technologies, and assorted sensors for temperature, humidity, light, and CO₂. Both systems have demonstrated reliability as industrial solutions, but their price points remain comparatively high. Equivalent industrial systems for automating a single-room mushroom farm could range from approximately $1,500 to $2,000 in Turkey, excluding installation and web-based software costs.

Alternative budget-conscious approaches employing low-cost microcontrollers and sensors are likewise obtainable. A subset of these systems [12-15] was designated solely for farm observation, whereas others [1, 16] furnished remote surveillance coupled with farm administration and regulation. Economical, commercially available sensors were deployed for moisture, temperature, CO₂, and light measurements, including DHT11, DHT22, LM35, MQ135, and BH1750. The NodeMCU (ESP8266) was predominantly selected for internet connectivity, while Arduino boards were chiefly used as the central controllers. Pre-existing software platforms, notably Blynk and ThingSpeak, were most frequently employed for remote access and data visualization. The principal drawback of such low-cost arrangements, which might total roughly $100-$150, is their reliability, as most of these proposed systems lacked validation in actual operational settings.

In contrast, He et al. [17] not only assembled the remote monitoring and management (RMM) infrastructure but also the entire mushroom growing facility within a purpose-built container measuring 3 m × 3 m × 9 m. They established a Controlled Environment Agriculture (CEA) system intended to supply fresh produce in metropolitan areas. Yet they overlooked the financial implications and production output of this type of container-based farm.

Recently, advanced tools from computer vision (CV) and machine learning (ML) have been adopted in mushroom farming for a variety of tasks, including grading spawn quality [18] and measuring mushroom caps [19]. Yin et al. [20] conducted a review of different CV and ML techniques applied across the mushroom industry, covering studies published between 1991 and 2021. In a more recent study [16], researchers built an automated mushroom system featuring a BME260 humidity and temperature sensor module, an ESP8266 for wireless communication, and an ESP32 SoC as the central controller that reads environmental conditions from the sensor unit to manage farm automation. They also incorporated a camera module alongside ML algorithms running on a Raspberry Pi to distinguish poisonous mushrooms.

As a result, the options currently available for mushroom cultivation consist either of high-priced industrial setups or low-cost but untrustworthy alternatives. At the same time, CV and ML techniques have demonstrated potential in intelligent mushroom farming. They could unlock additional features—such as disease identification, harvest forecasting, growth tracking, and energy/cost optimization—if edge computing (EC) and digital twinning were integrated to create an affordable yet dependable cultivation platform that offers complete remote access and oversight [20].

Against this background, the present work sets out to apply the latest IoT and Artificial Intelligence (AI) methods to capture and process data from multiple sensors and cameras, enabling remote observation and adjustment of the conditions inside the mushroom house, while also preparing the ground for future studies on growth analysis and disease detection. The primary contributions reported here are the design and construction of three separate sensing node variants spanning different budget levels, along with two distinct control nodes, making the solution financially accessible for diverse mushroom growers. Additionally, straightforward, easy-to-use web and desktop interfaces were built to streamline off-site farm supervision and control. The paper also presents an analysis of the sensor data collected and the results obtained.

Materials and Methods

The proposed cultivation system can be conceptually split into three main tiers, as shown in Figure 1. The bottom tier is the physical monitoring and control layer, which contains sensors to capture environmental variables—temperature, humidity, soil/compost temperature, compost moisture, air quality, CO₂, and light intensity—as well as cameras. Alongside the sensors, actuators operate the farm's equipment, including air conditioners, humidifiers, sprinklers, exhaust fans, and circulation fans. The middle tier houses the edge boards, which coordinate data collection and perform the computations required to drive the actuators with precision. These boards also link the system to the cloud, which serves as the third tier where all data categories ultimately reside.

Figure 1. General architecture of smart mushroom cultivation system.

Figure 1. General architecture of smart mushroom cultivation system.

The design assumes that the farm is already outfitted with the basic appliances and infrastructure needed for oyster mushroom growing, and that both mains electricity and internet connectivity are available on site. Where this is not the case, alternative power and connectivity solutions would be required to implement the system. In off-grid rural settings, for instance, renewable sources such as solar panel arrays can supply electricity, as is increasingly common today in unconnected areas of Northern Syria. For internet access, mobile data networks and satellite connections represent viable options.

Figure 2 provides a more granular block diagram of the system, which comprises sensors, actuators, and microcontrollers integrated with an IoT platform. Sensors track the key environmental parameters: temperature, relative humidity, compost temperature, compost moisture, air quality, CO₂, and light intensity. Various cameras are also installed for visual monitoring and to capture images for subsequent growth analysis using AI and ML methods. Actuators drive the farm devices—air conditioners, humidifiers, and fans. The system relies on ThingSpeak as the IoT platform for remote monitoring and management.

Figure 2. Mushroom cultivation system block diagram.

Figure 2. Mushroom cultivation system block diagram.

The proposed system was implemented and evaluated at a local oyster mushroom farm in Mersin, on Turkey's Mediterranean coast. The regional climate is typically mild and rainy in winter, with temperatures between 8 and 15 °C, and turns hot and moist in summer, reaching around 30 °C. The farm covers 14×7 m² and accommodates up to 1000 ten-kg mushroom bags on four-tier shelving. Several variants of sensing nodes were built and tested on-site. The trials took place over two full cultivation cycles, starting in late December 2022 and finishing in late April 2023. Several free IoT platforms—Blynk, Arduino IoT, and ThingSpeak—were evaluated. Blynk and Arduino IoT deliver user-friendly environments, yet their free tiers are significantly limited in functionality. By comparison, a free ThingSpeak account offers considerably greater capacity, supporting 10 million messages per year and retaining data for three years. ThingSpeak enables real-time graphing of sensor data—such as temperature, relative humidity, and soil moisture—viewable from any location. It also indicates the On/Off status of remotely operated devices and permits data analysis and computation using the full MATLAB™ toolset. This makes it possible to implement a capable IoT system for the mushroom farm without configuring servers or developing custom web applications, which is why ThingSpeak was preferred for this work.

Sensing nodes

To enable off-site farm monitoring, several sensor types at varying prices and performance levels were tested. Two different temperature/humidity sensors were tried: the DHT21 and the SHT20, both capturing relative humidity and ambient temperature inside the farm. The DS18B20 was found to be the best option for measuring compost temperature inside the grow bags, thanks to its thermocouple-based design and robust insulation. For compost moisture, two sensor technologies were compared: capacitive and resistive. Air quality and CO₂ measurements were trialled using three different sensor models: the SGP30, CCS811, and MH-Z19. Finally, the BH1750 was chosen for measuring light intensity.

Microcontroller boards are another key part of the sensing chain, as they capture sensor data and perform the calculations needed for precise actuator control. Because affordability was a central design goal, the ESP8266 and ESP32 stood out as the most suitable microcontrollers, given their low price and built-in features such as Bluetooth, Wi-Fi, and I2C support.

System cost was a critical factor throughout the project, given the target users—refugees and displaced communities. Consequently, three separate sensing node configurations—low, medium, and high cost—were designed and assembled (Figures 3-5) to compare their performance and identify the most suitable, budget-friendly solution. Each sensing node was assigned its own ThingSpeak channel to display live sensor readings and store historical data for later analysis. The prices of all components used in this study are presented in Table 1, based on 2023 rates in Turkey and inclusive of a 20% value-added tax.

Figure 3. Lowest-cost sensing node.

Figure 3. Lowest-cost sensing node.

Table 1. Utilized component prices.

Component

Price ($)

NodeMCU ESP 8266 board

4.90

ESP32 WROOM 32D board

7.22

DHT21 Temperature/humidity sensor

3.87

SHT20 Temperature/humidity sensor

33.51

DS18B20 Composite temperature sensor

1.29

Capacitive moisture sensor

1.03

HD38 Resistive moisture sensor

7.09

SGP30 Air quality sensor

11.86

CSS811 Air quality sensor

34.89

BH1750 Light sensor

1.37

LM2596 DC-to-DC converter

0.89

4-channel AC dimmer module

29.06

4-channel relay module

2.45

Solid state relay (SSR)

2.76

AMS1117 3.3 V voltage regulator module

0.49

AC-DC voltage adaptor

4.28

Plastic container

0.4

The lowest-cost sensing node consists of a microcontroller board and three sensors, as shown in Figure 3. This node is built around the NodeMCU ESP8266 development board, the least expensive member of the microcontroller family that supports internet connectivity. It uses the minimum set of general-purpose input/output (GPIO) pins needed to operate the sensors that measure environmental variables. One analogue input pin is used to read the output of the capacitive soil moisture sensor. It also easily accommodates the DS18B20 compost temperature sensor, which communicates over the 1-wire protocol, and the DHT21 temperature/humidity sensor, which likewise uses the 1-wire protocol. A DC-to-DC buck converter (LM2596) was included to supply more stable voltages to the sensors from a mains adapter. The node performed adequately overall, although some inaccuracy was observed, particularly at higher humidity levels. Figure 3 gives the detailed schematic showing how the three sensors are wired and which pins they use in the lowest-cost sensing node.

The medium-cost node, shown in Figure 4, is built on an ESP32 WROOM 32D development board and includes a DHT21 temperature/humidity sensor, a DS18B20 soil temperature sensor, a capacitive soil moisture sensor, a BH1750 ambient light sensor, and an SGP30 CO₂ sensor. The ESP32 WROOM 32D provides more GPIOs than the ESP8266 board, particularly additional analogue inputs. It also provides dedicated I2C pins, which greatly simplify interfacing with I2C sensors such as the BH1750 ambient light sensor. The SGP30 CO₂ sensor has a moderate accuracy of around 15%, which is adequate for serving as a CO₂ level indicator for the mushroom farm. Figure 4 presents the detailed schematic for this node; a DC-to-DC converter (LM2596) was again used to deliver cleaner supply voltages to the sensors.

Figure 4. Medium-cost sensing node.

Figure 4. Medium-cost sensing node.

Finally, the highest-cost sensing node depicted in Figure 5 is built around an ESP WROOM 32 development board, a voltage regulator, a reliable SHT20 temperature/humidity sensor operating via the I2C protocol, a DS18B20, an HD-38 resistive soil moisture sensor, and a CSS811 for estimating CO2 (eCO2) and Total Volatile Organic Compounds (tVOC). The SHT20 is a high-quality, waterproof sensor that communicates over the I2C protocol. The CO2 sensor CSS811 is likewise of high quality and utilizes the I2C protocol. The schematic diagram of the highest-cost sensing node, including detailed PINs, is presented in Figure 5.

Figure 5. Highest-cost sensing node.

Figure 5. Highest-cost sensing node.

Three sensing node configurations were engineered and built in advance to offer a range of options suited to mushroom growers operating at varying levels—spanning from extremely modest refugee-run setups to medium- and large-scale commercial ventures. Based on 2023 pricing in Turkey, the location where the experimental work took place, the lowest-tier, mid-tier, and highest-tier sensing nodes carry approximate price tags of $17, $33, and $90, respectively (Figure 6). The stated figures also bundle the expense of one voltage adapter for each node.

Figure 6. Costs of sensing nodes.

Figure 6. Costs of sensing nodes.

Control nodes

Turning to the command-and-control portion of the installation, a pair of separate control node designs were implemented, each with an individual ThingSpeak channel. Figure 7 depicts the entry-level control node, which adequately meets the basic requirements of a modest mushroom-growing facility without imposing a heavy financial burden. Figure 8 shows the higher-end counterpart, built for a mushroom farm that demands premium functionality and can command up to 7 direct current and alternating current appliances.

Figure 7. Basic control node.

Figure 7. Basic control node.

Figure 8. Advanced control node.

Figure 8. Advanced control node.

Focusing first on the simpler control circuitry, it governs three pieces of equipment deemed vital in a mushroom farm: a moisture-generating humidifier, an air-movement fan, and an exhaust extraction fan. The illustration in Figure 7 shows that the build incorporates an ESP8266 microcontroller board, a relay unit with four channels, and a set of voltage regulation components.

By contrast, the more sophisticated node is designed to take charge of a broader assortment of apparatus that might be present inside a more spacious growing house, specifically: a climate-control air conditioning unit, a humidifier, lighting fixtures, a pair of internal air movement fans, and a pair of exhaust extraction fans, as laid out in Figure 8. For governing the air conditioner, humidifier, and lighting, solid-state relays (SSRs) represent the most trustworthy electrical switching solution because they deliver absolute galvanic separation between the low-power microcontroller signals and the high-power input lines of the target devices. These same solid-state relay modules could also serve the four fans; however, enabling variable fan velocity required the inclusion of a 4-channel alternating current (AC) dimmer module, a design choice that allows the fans to operate more harmoniously alongside other apparatuses such as the air conditioner and the humidifier. For every fan, a total of five distinct rotation speeds—plus a complete shutdown state—were made available, representing the following fractions of peak speed: 0%, 20%, 40%, 60%, 80%, and 100%.

Concluding this section, a side-by-side financial assessment placed the simpler control node (in the vicinity of $14) against the enhanced control node (in the vicinity of $49), a contrast depicted in Figure 9. Provided they receive modest technical guidance, cultivators are empowered to pick whichever node combination fits their specific context best, with combined entry-level pricing beginning near $30 for the pairing of the most elementary sensor and controller modules. One should also stress that properly sealed housings for these electronic assemblies are imperative to shield the circuitry from the corrosive impact of persistent moisture. A practical, low-cost solution involves repurposing everyday plastic kitchen storage boxes with reliable snap-on lids.

Figure 9. Control nodes' costs.

Figure 9. Control nodes' costs.

Application user interface

A connection to a unique ThingSpeak channel was established for every sensor and controller unit to serve as a repository for its information stream. Regarding the controller hardware, an online portal accessible from any mobile device, tablet, or desktop was developed, enabling growers to control the farm's equipment remotely. In parallel, a dedicated MATLAB program was developed for individuals with more technical expertise to support the same device management purposes. The control layout prioritizes clarity and accessibility, allowing growers to toggle any piece of equipment to an active or inactive state via clear visual cues; the MATLAB program also maintains a chronological record of issued directives. Figure 10 puts the web-based dashboard (a) and the MATLAB software interface (b) for the simpler control unit side by side. Any pair of commands transmitted in sequence must observe a minimum interval of 15 seconds to safeguard the reliable synchronization and responsiveness of the ThingSpeak channel. Furthermore, these user-facing control panels can be integrated with ThingSpeak, enabling the archival and real-time observation of both current and historical records tied to the operational condition of any managed apparatus.

Figure 10. Basic control node user interfaces (a) Web page (b) MATLAB application.

Figure 10. Basic control node user interfaces (a) Web page (b) MATLAB application.

An equivalent scenario holds for the advanced controller circuitry, which likewise offers dual interface modalities via a browser-based page and a MATLAB software application, as displayed in Figures 11a and 11b, respectively.

Figure 11. Advanced control node user interfaces (a) Web page (b) MATLAB application.

Figure 11. Advanced control node user interfaces (a) Web page (b) MATLAB application.

As Figure 12 makes evident, the MATLAB software environment extends its utility to pulling information feeds from the sensor arrays, shown in Figure 12a, in addition to issuing operating instructions through the control circuitry. The tool can fetch the real-time operational state of all peripheral devices tied to the control architecture—encompassing the climate-control unit, moisture generator, illumination level, the pair of air circulation fans, and the pair of exhaust extraction fans—as shown in Figure 12b. A deliberate design effort was invested in keeping the command console as uncluttered as possible while still embedding all vital panel sections required for both exercising authority over all farm machinery and observing the incoming flow of sensor measurements.

Figure 12. MATLAB application user interfaces (a) sensor data reading (b) control data reading.

Figure 12. MATLAB application user interfaces (a) sensor data reading (b) control data reading.

Cloud and IoT platform

The concluding element of the architecture we have put forward centers on the cloud-based Internet of Things framework we have employed. Several IoT hosting services underwent testing phases before settling on ThingSpeak, as shown in Figure 13, which serves as the centralized IoT hub for collecting, graphically presenting, and computationally analyzing streaming data in the cloud. The principal strength motivating the choice of the ThingSpeak ecosystem lies in its ability to deliver on-the-fly graphical representations of information from field hardware, while retaining long-term historical datasets. On top of that, ThingSpeak natively incorporates MATLAB's full analytical and plotting toolkit and lends itself to straightforward integration with external web domains. To illustrate, a purpose-built site was constructed as the farmer-facing portal, allowing cultivators to consult live sensor output and send operational commands to machinery situated on the premises. The grower can either access the monitoring console directly via the ThingSpeak platform or use a registered profile on the connected custom website, which requires a login name and secret key to maintain personal confidentiality and ensure system integrity. Figure 14 shows the farm's monitoring console being pulled up from a remote, secure connection. Additionally, the layout of the web-based dashboards was carefully adapted to function smoothly across a range of form factors, including smartphones, tablets, and desktops.

Figure 13. ThingSpeak IoT platform.

Figure 13. ThingSpeak IoT platform.

Figure 14. Website interface with farmer dashboard.

Figure 14. Website interface with farmer dashboard.

 

Results and Discussion

Measurements from the sensors together with photographic records were gathered and archived without issue. Information covering relative humidity, ambient temperature, the inner temperature of the mushroom bags, internal bag moisture, and CO₂ concentrations was reliably captured over two full growth cycles. In the second cycle, the set of tracked variables was broadened, and nearly all the technical hurdles faced during the first cycle were resolved. Over 66,000 readings taken at one-minute intervals were logged and preserved during the second cycle alone. Across both cycles, the figure surpassed 390,000 measurements collected at 20-second intervals. In parallel, an image bank containing more than 700 farm photographs and 500 video recordings was also compiled.

Figure 15 displays the Arduino IoT platform with live readings of four tracked variables—ambient temperature, relative humidity, in-bag temperature, and moisture—during the first growth cycle, offering merely a single day's worth of data retention and plotting. The Arduino IoT platform works across various computing devices, including PCs, tablets, and smartphones. Yet, the free tier limits users to 2 devices/nodes, with a ceiling of 4 variables per device, plus only 1 day of data storage and graphing. By comparison, a no-cost ThingSpeak account provides 4 channels/nodes, offering markedly greater storage, analysis, and visualization headroom. Each channel can accommodate up to 8 separate data fields or variables. Figure 16 shows two fields within a ThingSpeak channel, illustrating both real-time and hourly aggregated temperature and relative humidity values from an SHT20 sensor attached to a sensing node that polls every 60 seconds. The hourly trend lines clearly show oscillations in the readings, driven by the switching cycle of the exhaust fans, which the grower had programmed to kick in whenever the temperature climbed past 19 °C and to shut off once it dropped below 19 °C, thereby stabilizing the farm atmosphere near 19 °C.

Figure 15. Arduino IoT platform interface (23 Jan 2023).

Figure 15. Arduino IoT platform interface (23 Jan 2023).

Figure 16. ThingSpeak IoT platform interface of SHT sensor (25 Mar 2023).

Figure 16. ThingSpeak IoT platform interface of SHT sensor (25 Mar 2023).

Parallel oscillations induced by the exhaust fan duty cycle are also apparent in the traces from the CSS811 air-quality unit, which captures estimated CO₂ (eCO₂) and tVOC, as shown in Figure 17.

Figure 17. ThingSpeak IoT platform interface of CSS sensor (25 Mar 2023).

Figure 17. ThingSpeak IoT platform interface of CSS sensor (25 Mar 2023).

The budget-friendly DHT21 sensor (Figure 18) followed comparable oscillatory patterns, registering temperatures from 18.5 to 18.7 °C and relative humidity spanning 75.2% to 76.7%, in contrast to the pricier, more robust SHT20 unit, which logged temperatures of 18.8–19.05 °C and relative humidity of 69.2%–70.7%. More pronounced gaps in relative humidity figures between the two sensor types emerged at higher humidity bands.

Figure 18. ThingSpeak IoT platform interface of DHT21 sensor (25 Mar 2023).

Figure 18. ThingSpeak IoT platform interface of DHT21 sensor (25 Mar 2023).

As for the lower-cost SGP30 air-quality sensor (Figure 19), similar cyclic variations tied to the exhaust fan routine were observed, though the readings diverged more sharply when compared with the higher-cost CSS811 unit.

Figure 19. ThingSpeak IoT platform interface of SGP30 sensor (25 Mar 2023).

Figure 19. ThingSpeak IoT platform interface of SGP30 sensor (25 Mar 2023).

Beyond simple plotting, ThingSpeak provides a considerably richer set of analytical tools, as MATLAB scripts, visual outputs, and applications are natively supported by the ThingSpeak environment. Figure 20 shows daily and weekly data summaries, where the split between daytime and nighttime readings—most strikingly for relative humidity—is readily discernible. These contrasts arise from the exhaust fan schedule during that phase: it operated on a timer throughout the day. It ran uninterrupted overnight to keep the farm temperature steady at roughly 19°.

Figure 20. Data graphs showing temperature and relative humidity (a) daily and (b) weekly values.

Figure 20. Data graphs showing temperature and relative humidity (a) daily and (b) weekly values.

Temperature logs drawn from different sensing nodes were also placed side by side in Figure 21, covering both the ambient farm air and conditions inside the mushroom bags. Internal bag temperatures were markedly elevated in one bag due to vigorous mycelial growth. The grower adjusted the circulation fan schedule on the afternoon of 20 March (13:00 local time), an intervention reflected in the temperature records based on each sensor's distance from the fan units. In addition, a sharp temperature surge occurred on the morning of 20 March following a mains failure (07:53–08:43 local time), raising readings by roughly 2 degrees. Once electricity was restored and the fans spun back up, temperatures returned to normal within 10 minutes.

Figure 21. Data graphs showing comparisons of temperature values (a) in the farm and (b) inside bags.

Figure 21. Data graphs showing comparisons of temperature values (a) in the farm and (b) inside bags.

Electrical cuts occurred from time to time, seldom lasting more than an hour. There was, however, one lengthy internet service outage due to a fault on the provider's side. To work around this, a mobile data link was activated to reinstate the connectivity required for off-site oversight of the farm. Without question, having contingency measures and fallback options ready is vital for coping with unexpected disruptions. A variety of portable generators and alternative internet connections can be used in these scenarios.

Figure 22a shows relative humidity traces from three separate sensing nodes. The contrast between daytime and nighttime conditions is clear, and a steep humidity spike is also visible, triggered when the farmer manually ran the humidifier for a 10-minute burst. Figure 22b plots eCO₂ readings from the SGP30 and CSS811 sensors. However, the absolute offset between the two sensor outputs was sizable; their overall behaviour followed a broadly similar trajectory, indicating that either unit can serve as an economical proxy for CO₂ levels inside the farm.

Figure 22. Data graphs showing comparisons of (a) relative humidity and (b) air quality data.

Figure 22. Data graphs showing comparisons of (a) relative humidity and (b) air quality data.

Figure 23 presents photographs taken by the in-house cameras during two separate cultivation cycles, with the exhaust and circulation fan units visible in the background. In addition, a repository of mushroom imagery has been assembled for subsequent work that harnesses CV, AI, and ML techniques.

Figure 23. Images from the farm.

Figure 23. Images from the farm.

A further significant finding was that the grower—who had previously been obliged to travel to the farm twice daily for manual crop checks—was now able to supervise and run the farm from afar with the proposed setup, slashing both fuel consumption and time spent.

In the end, the full set of technical design and build files, source code, and step-by-step instructions covering all versions of the sensing and control nodes devised for the oyster mushroom cultivation system will be published under a CC BY license. This will permit the system to be assembled and duplicated not only by NGOs and official bodies assisting refugee and displaced communities, but also by any organization that opts to put it into use. The system was validated for oyster (Pleurotus ostreatus) mushroom production in a greenhouse, where ambient temperatures ranged from 5 to 25 °C and relative humidity ranged from 60% to 95%. Still, the platform can be reconfigured for other fungal species and different greenhouse crops by adjusting the operational setpoints for temperature and relative humidity to match the needs of each growth stage of the chosen species [21, 22]. For example, the number of sensing nodes can be adjusted to match the dimensions of the greenhouse or farm, and individual sensors can be swapped out for types better matched to the particular mushroom or crop under cultivation. The same holds for the control nodes: a wide range of farm appliances can be operated and managed by these units, preserving the same architecture and user-facing interfaces.

Conclusion

This study demonstrates that constructing and deploying an effective, budget-friendly remote observation and regulation system for organic oyster mushroom farming is entirely achievable, with total entry costs starting around $30. Rolling out this system produced encouraging results, visible in lower labour needs and reduced production costs, as well as extended cropping windows enabled by the remotely governed environment. This streamlines the overall mushroom production sequence to a point where lay users, following a short period of instruction, can manage it—a particularly valuable outcome for internally displaced populations and Syrian refugees. In addition, it can provide them with a supplementary income stream and an additional supply of nutrient-rich food.

The oyster mushroom cultivation system variants developed over the course of this research can be tailored for other mushroom varieties and for crops grown in greenhouse structures, since virtually all such setups rely on tracking the internal environment and controlling the hardware that modulates those conditions.

The outputs generated by this project can be disseminated not solely to NGOs and agencies running agricultural initiatives for internally displaced persons and Syrian refugees, but also to growers in other low-resource settings, for instance. The day-to-day operation and handling of the system can be folded into mushroom cultivation training curricula and hands-on workshops delivered by these stakeholders. The proposed system has the potential for scaled-up manufacturing for organizations engaged with refugee communities, given that various UN entities and international or local NGOs bankroll such efforts through livelihood restoration and local economic recovery programmes.

Acknowledgements

The authors would also like to thank Dr. Denise De Pauw from the University of Leeds for providing language support during the writing of this paper.

Conflict of interest

None

Financial support

This work was supported by the Council for At-Risk Academics (Cara) [Apr22URN15 grant].

Ethics statement

None

References

Kassim MRM, Mat I, Yusoff IM. Applications of internet of Things in Mushroom Farm Management. In: Proceedings of the International Conference on Sensing Technology, ICST. IEEE Computer Society; 2019 Dec.
https://doi.org/10.1109/ICST46873.2019.9047702
UN Data. A world of information [Internet]. 2020 [cited 2026 Jul 29]. Available from: http://data.un.org/Data.aspx?d=FAO&f=itemCode%3A449
International Agricultural Cooperation Organization (I.A.C.O.). Manual of agricultural mushroom production in Syria [Internet]. 2020 [cited 2026 Jul 29]. Available from: http://iaco-sy.org/?p=988
Walter A, Finger R, Huber R, Buchmann N. Opinion: Smart farming is key to developing sustainable agriculture. Proc Natl Acad Sci U S A. 2017;114:6148-50.
https://doi.org/10.1073/pnas.1707462114
Zhu M, Shang J. Remote monitoring and management system of intelligent agriculture under the Internet of Things and deep learning. Wirel Commun Mob Comput. 2022;2022.
Abbasi R, Martinez P, Ahmad R. The Digitization of Agricultural Industry – a Systematic Literature Review On Agriculture 4.0. Smart Agric Technol. 2022;
https://doi.org/10.1016/j.atech.2022.100042
Jararweh Y, Fatima S, Jarrah M, AlZu'bi S. Smart and sustainable agriculture: fundamentals, enabling technologies, and future directions. Comput Electr Eng. 2023;110:108799.
https://doi.org/10.1016/j.compeleceng.2023.108799
Karunathilake EMBM, Le AT, Heo S, Chung YS, Mansoor S. The path to smart farming: innovations and opportunities in precision agriculture. Agriculture. 2023;13(8):1593.
https://doi.org/10.3390/agriculture13081593
Angral PK, Thakur R. Different automatic monitoring and controlling technique for mushrooms. Turk J Comput Math Educ. 2021;12(11):3363-9.
Thong-un N, Wongsaroj W. Productivity enhancement using low-cost smart wireless programmable logic controllers: a case study of an oyster mushroom farm. Comput Electron Agric. 2022;195:106798.
https://doi.org/10.1016/j.compag.2022.106798
Ten ST, Krishnen G, Khulidin KA, Mohamad Tahir MA, Hashim MH, Khairudin S. Automated controlled environment mushroom house. Adv Agric Food Res J. 2021;
https://doi.org/10.36877/aafrj.a0000230
Mahmud MSA, Buyamin S, Mokji MM, Abidin MSZ. Internet of things based smart environmental monitoring for mushroom cultivation. Indones J Electr Eng Comput Sci. 2018;10(3):847-52.
https://doi.org/10.11591/ijeecs.v10.i3.pp847-852
Mohammed MF, Azmi A, Zakaria Z, Tajuddin MFN, Isa ZM, Azmi SA. IoT based monitoring and environment control system for indoor cultivation of oyster mushroom. J Phys Conf Ser. 2018;1019:012053.
Subedi A, Luitel A, Baskota M, Acharya TD. IoT Based Monitoring System for White Button Mushroom Farming. In: ECSA-6. MDPI AG; 2020. p. 46.
https://doi.org/10.3390/ecsa-6-06545
Surige YD, Perera WSM, Gunarathna PKN, Ariyarathna KPW, Gamage N, Nawinna D. IoT-based monitoring system for oyster mushroom farming. In: Proceedings of the ICAC 2021 - 3rd International Conference on Advancements in Computing. 2021. p. 79-84.
https://doi.org/10.1109/ICAC54203.2021.9671112
Rahman H, Faruq MO, Abdul Hai TB, Rahman W, Hossain MM, Hasan M, et al. IoT enabled mushroom farm automation with Machine Learning to classify toxic mushrooms in Bangladesh. J Agric Food Res. 2022;7:100267.
https://doi.org/10.1016/j.jafr.2021.100267
He L, Fu L, Fang W, Sun X, Suo R, Li G, et al. IoT-based urban agriculture container farm design and implementation for localized produce supply. Comput Electron Agric. 2022;203:107445.
https://doi.org/10.1016/j.compag.2022.107445
Tongcham P, Supa P, Pornwongthong P, Prasitmeeboon P. Mushroom spawn quality classification with machine learning. Comput Electron Agric. 2020;179:105865.
https://doi.org/10.1016/j.compag.2020.105865
Lu CP, Liaw JJ. A novel image measurement algorithm for common mushroom caps based on convolutional neural network. Comput Electron Agric. 2020;171:105336.
https://doi.org/10.1016/j.compag.2020.105336
Yin H, Yi W, Hu D. Computer vision and machine learning applied in the mushroom industry: a critical review. Comput Electron Agric. 2022;198:107015.
https://doi.org/10.1016/j.compag.2022.107015
Bellettini MB, Fiorda FA, Maieves HA, Teixeira GL, Ávila S, Hornung PS, et al. Factors affecting mushroom Pleurotus spp. Saudi J Biol Sci. 2019;26(4):633-46.
https://doi.org/10.1016/j.sjbs.2016.12.005
Raman J, Jang KY, Oh YL, Oh M, Im JH, Lakshmanan H, et al. Cultivation and nutritional value of prominent Pleurotus Spp: an overview. Mycobiology. 2021;49(1):1-14.
https://doi.org/10.1080/12298093.2020.1835142

Author information

Carlos Ramirez, Elena Torres, Pablo Ortega & Sofia Mendes contributed to this work.

Authors and affiliations

Department of IoT for Oyster Mushroom Farming, Faculty of Agriculture, University of Barcelona, Barcelona, Spain
Carlos Ramirez & Pablo Ortega

Department of Remote Environmental Monitoring for Mushrooms, Faculty of Agricultural Sciences, University of Lisbon, Lisbon, Portugal
Elena Torres

Department of Intelligent Control for Mushroom Cultivation, Faculty of Agriculture, University of Porto, Porto, Portugal
Sofia Mendes

Corresponding author

Correspondence to Carlos Ramirez

Rights and permissions

Open Access The author(s) retain copyright. This article is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. It may be shared and adapted for non-commercial purposes with appropriate attribution, an indication of changes, and distribution of adaptations under the same license. Third-party material may be subject to separate terms identified in its credit line. View the license at https://creativecommons.org/licenses/by-nc-sa/4.0/.

About this article

Cite this article

Vancouver
Ramirez C, Torres E, Ortega P, Mendes S. An Intelligent IoT-Based Oyster Mushroom Farming System for Remote Environmental Monitoring and Control. . 2024;3:104.
APA
Ramirez, C., Torres, E., Ortega, P., & Mendes, S. (2024). An Intelligent IoT-Based Oyster Mushroom Farming System for Remote Environmental Monitoring and Control. Journal of Intelligent Agriculture and Food Systems, 3, 104.
Received
02 February 2024
Revised
19 March 2024
Accepted
08 May 2024
Published
15 September 2024
Version of record
15 September 2024

Share this article

Easily share this article with others using the link below:

An Intelligent IoT-Based Oyster Mushroom Farming System for Remote Environmental Monitoring and Control
Scan to access
this article

Ready to submit?
Start a new submission or continue a submission in progress:
Submission Portal Author Guidelines

Follow this journal
Get notified of new updates and articles.