Access to state-of-the-art technologies allows us to create a synergy with daily activities, in order to optimize their processes, efficiency and quality. In the context of agriculture, the monitoring and control of production allows better results to be obtained by using Internet of Things systems, artificial intelligence and technological platforms that operate in real time.
In this report, the development of the course project through which an IoT system was designed and implemented for monitoring mushroom cultivation is presented, the description of the materials used, the methodology used and the results obtained are made. Highlighting the work done on the ThingsBoard Edge platform in the context of edge computing, for the control of environmental conditions such as temperature, humidity, and CO2.
2. OBJECTIVE AND SCOPEThe general objective is the implementation of an IoT system for the monitoring of mushroom cultivation.
The scope is the implementation of a prototype of the IoT system for the monitoring of mushroom cultivation that allows controlling the environmental variables of temperature, humidity and CO2.
3 PROTOTYPE DESCRIPTIONThe prototype developed represents a comprehensive monitoring system for mushroom crops, taking advantage of IoT and Edge Computing technologies. This system incorporates sensors, actuators, and devices connected to the Thingsboard platform, ensuring accurate and efficient monitoring of environmental variables critical to healthy fungal growth.
In addition, the prototype has a system of visual and audible alerts, which can be activated manually from the platform and automatically according to configurable parameters. To ensure the energy autonomy of the crop, we have implemented a solar energy system.
The proposed system includes the monitoring of temperature, humidity and CO2 variables in a mushroom crop to guarantee an optimal environment that favors its healthy and productive growth.
Figure 4 shows how this activity is carried out graphically, considering:
1. Temperature, humidity and CO2 sensors: Temperature, humidity and CO2 sensors were installed at different points in the cultivation area (prototype). These sensors are the electronic devices connected to a centralized monitoring network that were described in Table 1.
2. Continuous data logging: Temperature, humidity and CO2 sensors continuously record environmental data in the crop.
3. Setting limits: Optimal temperature ranges are established for mushroom growth. These limits can vary depending on the mushroom species being grown, but generally fall between 15°C and 25°C, depending on the specific conditions required.
4. Real-time monitoring: Sensor data is transmitted in real-time to a centralized monitoring platform. This allows crop managers to monitor the status of temperature, humidity and CO2, at all times and from anywhere.
5. Automatic alerts: Automatic alerts have been set up to notify responsible personnel if temperature, humidity or CO2 is outside the established limits. This can be done via email, text messages, graphic, or other forms of communication.
6. Corrective actions: In the event that an alert is received from out-of-bounds sensors, corrective actions are taken immediately, either manually or automatically. This may include adjustments to the greenhouse heating or cooling system, proper ventilation, or other measures to restore the temperature to the desired range.
7. Data logging and analysis: Temperature data is recorded and analyzed historically to identify trends and patterns over time. This helps to optimize the environmental conditions in the crop and make proactive adjustments to improve the yield and quality of the mushrooms.
Temperature monitoring in a mushroom crop is an essential part of agronomic management, as it ensures optimal environmental conditions for mushroom growth and development, leading to more successful and consistent production.
5 TBEL CODE FOR THE MONITORING SYSTEMProgramming code plays a fundamental role in the IoT system of mushroom crop monitoring by facilitating the integration between the collection of data such as temperature, humidity, CO2 levels and other factors relevant to the healthy growth of mushroom crops.
Defining Global Variables for Boundaries
var limitUpper Temp = 25; Upper temperature limit
var limitLowerTempe= 15; Lower temperature limit
var limitHumidityUpper = 80; Upper limit of humidity
var limitHumidityLower = 60; Lower Humidity Limit
var limitCO2Upper = 1000; Upper CO2 limit
var limitCO2Lower = 400; Lower CO2 limit
Function to read temperature sensor data
function readTemperature() {
var temperature = devices['sensor_temperatura'].temperature; Read sensor temperature
return temperature;
}
Function to read humidity sensor data
function readHumidity() {
var humidity = devices['sensor_humedad'].humidity; Read Sensor Humidity
return moisture;
}
Function to read data from the CO2 sensor
function readCO2() {
var CO2 = devices['sensor_co2'].CO2; Read CO2 from the sensor
return CO2;
}
Function to check if the data is within the set limits
function checkLimits(temperature, humidity, CO2) {
var withinLimits = true;
Check Temperature
if (temperature > limitUpper Temp || temperature < limitLowerTemp) {
withinLimits = false;
}
Check Humidity
if (humidity > limitHumidityUpper || humidity < limitHumidityLower) {
withinLimits = false;
}
Verify CO2
if (co2 > upper CO2 limit || co2 < lower CO2 limit) {
withinLimits = false;
}
return withinlimits;
}
Function to generate an alert
function generateAlert() {
var alert = "Alert: Conditions outside the established limits"; Alert message
devices['actuador_alerta'].sendAlert(alert); Send Alert to Alert Actuator
}
Main Monitoring Function
function monitorCrop() {
var temperature = readTemperature(); Read Temperature
var humidity = readHumidity(); Read moisture
var co2 = readCO2(); Read CO2
Check if the data is within the established limits
if (!checkLimits(temperature, humidity, CO2)) {
generateAlert(); Generate alert if data is out of bounds
}
}
Schedule the monitoring task to run every XXX time
schedule("*/XXXX * * * *", function() {
monitor crop();
});
6 PROTOTYPE SIMULATIONThe prototype is equipped with key indicators such as temperature, humidity and air quality in particles per million, our system offers a complete view of the growing environment. In addition, with two control switches in our Dashboard, farmers can activate audible and visual alerts to be instantly notified of any anomalies.
A standout feature of our system is the ability to set up custom alerts. For example, we have integrated a maximum temperature control widget, allowing the user to set limits and receive automatic alerts if these limits are exceeded
The Dashboard, which provides a highly effective visualization and monitoring system. We carefully select widgets to monitor temperature, humidity and air quality, allowing us to have a detailed view of the growing environment.
Thingsboard manages Edge Computing using what they call 'rule chains', which allows actions to be triggered based on inputs and outputs for each specific case. In addition, the rules can be separated to handle alerts or other cases independently.
Another important feature of Edge Computing is the ability to handle instances for devices that are not connected to the Internet, thus allowing individual cases to be addressed with their own rules and configurations.
Finally, in the devices section we can connect all our entities or devices that we want to monitor, providing a complete view of the system.
Comments