论文信息
论文解读
AI 辅助整理- 方法
- SHT20传感器、ESP32、Mamdani模糊逻辑九规则及Telegram远程
- 发现
- 温湿度精度超99%,执行器响应1.4秒且无冲突,实现自动调控。
- 机会点
- 可探索多环境因子耦合优化与虫害生长模型联动,并推广至其他昆虫养殖场景。
论文摘要
黑水虻(black soldier fly, BSF)幼虫养殖是一种有机废弃物生物转化与可持续蛋白质生产的高效途径;然而,其生产力对温度和湿度极为敏感,而传统人工管理方式对这些环境因子的调控能力较差,存在劳动强度大、易出错且无法响应环境波动等问题。本研究实现了一套面向黑水虻幼虫养殖的物联网(internet of things, IoT)浇水与监测系统,集成了SHT20传感器、ESP32微控制器和三个执行器(水泵、加热灯泡和鼓风机)。该系统以两种模式运行:通过Telegram Bot API实现的手动模式,以及由具有九条IF–THEN规则的Mamdani模糊逻辑推理引擎控制的自动模式。传感器精度在12次试验中(22.5–43.8 °C;45–89% RH)得到验证。平均温度精度达到99.13%(误差:0.87%,标准差:0.58%),平均湿度精度达到99.27%(误差:0.73%,标准差:0.56%),二者均在±2%的物联网传感容差范围内。模糊逻辑评估确认执行器激活具有一致性,平均响应时间为1.4 s,且在所有试验中均未出现冲突组合。该系统构成了可用于昆虫养殖自动化的可复用知识,在低成本嵌入式平台上融合了模糊逻辑驱动、多参数传感和基于Telegram的监测,可应用于更广泛的智慧农业和可持续废弃物管理领域。
全文
Bulletin of Electrical Engineering and InformaticsBulletin of Electrical Engineering and Informatics
Vol. 15, No. 6, December 2026, pp. 4953~4966
ISSN: 2302-9285, DOI: 10.11591/eei.v15i6.12685 4953
Journal homepage: http://beei.org
Enhancing maggot farming with an internet of things-enabled
watering and monitoring system
Rini Puji Astutik1, Arbi Alfian Mas’ud1, Muhammad Ramadhani1, Samsudin Nur1, Soffa Zahara2,
Mohammad Muslimin3
1Department of Electrical Engineering, Faculty of Engineering, Universitas Muhammadiyah Gresik, Gresik, Indonesia
2Department of Informatics, Faculty of Engineering, Universitas Islam Majapahit, Mojokerto, Indonesia
3Department of Industrial Engineering, Faculty of Engineering, Universitas Islam Majapahit, Mojokerto, Indonesia
Article Info ABSTRACT
Article history:
Received Mar 2, 2026
Revised Sep 17, 2026
Accepted Oct 4, 2026
Black soldier fly (BSF) maggot cultivation is a high -efficiency approach to
organic waste bioconversion and sustainable protein production; however,
productivity is critically sensitive to temperature and humidity, which are
poorly regulated under conventional manual practices that are labor -
intensive, error-prone, and unresponsive to environmental fluctuations. This
study implements an internet of things (IoT)-enabled watering and
monitoring system for BSF maggot farming, integrating an SHT20 sensor,
ESP32 microcontroller, and three actuators (water pump, heating bulb, and
blower fan). The system operates in two modes: manual mode via Telegram
Bot API, and automatic mode governed by a Mamdani fuzzy logic inference
engine with nine IF –THEN rules. Sensor accuracy was validated across 12
trials (22.5-43.8 C; 45-89% RH). Mean temperature accuracy of 99.13%
(error: 0.87% , SD: 0.58%) and mean humidity accuracy of 99.27% (error:
0.73%, SD: 0.56%) were achieved, both within the ±2% IoT sensing
tolerance. Fuzzy logic evaluation confirmed consistent actuator activation
with a mean response time of 1.4 s and no conflicting combinations across
all trials. The system constitutes reusable knowledge for insect farming
automation, combining fuzzy logic actuation, multi -parameter sensing, and
Telegram-based monitoring within a low -cost embedded platform ,
applicable to broader smart agriculture and sustainable waste management
domains.
Keywords:
Automated watering
Black soldier fly
Environmental monitoring
Internet of things
Maggot farming
Mamdani inference
Telegram Bot
This is an open access article under the CC BY-SA license.
Corresponding Author:
Rini Puji Astutik
Department of Electrical Engineering, Universitas Muhammadiyah Gresik
Gresik, Jawa Timur, Indonesia
Email: astutik_rpa@umg.ac.id
-
INTRODUCTION
Context black soldier fly (BSF) (Hermetia illucens ) larval cultivation has emerged as a high-
efficiency bioconversion technology capable of reducing organic waste volume by 60 –70% while producing
protein-rich biomass for animal feed and industrial applications [1]. Within the circular economy and
sustainable food system frameworks, BSF farming represents a critical pathway toward reducing food waste,
lowering carbon emissions from organic decomposition, and generating high -value protein for aquaculture
and poultry feed [2], [3]. BSF larval development is, however, highly sensitiv e to environmental conditions:
optimal temperature ranges between 25 °C and 35 °C, while substrate moisture content should be maintained
at 60–80% relative humidity [2], [3]. Deviations from these thresholds result in reduced larv al growth rates,
elevated larval mortality, ammonia odor generation, and lower bioconversion efficiency [4], [5]. ISSN: 2302-9285
Bulletin of Electr Eng & Inf, Vol. 15, No. 6, December 2026: 4953-4966
4954
Problem statement despite the sensitivity of BSF cultivation to environmental parameters, the
majority of small and medium -scale maggot farming opera tions continue to rely on manual monitoring and
substrate watering. Manual procedures require operators to physically inspect and adjust the farming
environment typically one to three times per day, resulting in intervention latency of 3 -12 hours as a
timeframe far exceeding the environmental response requirements of BSF larvae [4]. This operational
limitation leads to inconsistent environmental conditions , suboptimal production yields , an d high labor
dependency, particularly in resource -constrained settings where automated solutions have not yet been
adopted [6], [7].
State of the art internet of things (IoT)-based system integrating sensor networks , microcontrollers,
and wireless communication platforms have demonstrated significant improvements in operational
efficiency, resource optimization, and environmental stability across smart agriculture [8]-[10], precision
irrigation [11]-[13], and livestock housing management [14]-[16]. Recent advances in embedded IoT system,
particularly those utilizing low -cost microcontroller such as the ESP32, have further democratized
agricultural automation by enabling real -time environmental sensing, automated actuator control, and cloud
or mobile -accessible monitoring within si ngle integrated platform [17]-[19]. Within the domain of insect
farming specifically, Wibisono et al. [20] and Ramadhan et al. [21] have implemented IoT-based temperature
and humidity monitoring for BSF environments, while Kayo nde [5] and Teng and Halim [22] have
demonstrated remote monitoring capabilities for BSF farm management.
Gap analysis a critical review of these related works, summarized in Table 1, reveals three
measurable gaps. First, all prior BSF IoT systems restrict their scope to data acquisition and notification
without implementing closed -loop automated actuator control, a fundame ntal limitation that prevents
autonomous environmental correction. Second, the only existing intelligent control approach for BSF, such
as the neuro -fuzzy systems of Sari et al . [23], requires substantially greater computational resources
(PC-based implementation) and lacks a real -time remote communication interface , making it impractical for
deployment on low -cost embedde d hardware such as the ESP32 . In contrast, the Mamdani fuzzy logic
method selected in this study offers comparable interpretability and control precision at a fraction of the
computational cost (inference time<5 ms on ESP32), making it substantially more s uitable for
resource-constrained embedded deployment [24], [25]. Third, no prior system has int egrated all three
functional layers, such as automated actuator control, fuzzy logic inference, and mobile -accessible real-time
monitoring, within a single low-cost embedded platform for BSF cultivation.
Table 1. Comparison of related IoT system for BSF maggot farming
Study System type Auto actuator control Fuzzy logic Remote monitoring BSF-specific
Wibisono et al. [20] IoT monitoring No No No Yes
Ramadhan et al. [21] IoT+hygrometer No No No Yes
Sari et al. [23] Neuro-fuzzy control Yes Yes (NF) No Yes
Kayode [5] IoT monitoring No No Yes Yes
Teng and Halim [22] Smart IoT Partial No Yes Yes
Proposed system IoT+fuzzy control Yes Yes (Mamdani) Yes (Telegram) Yes
Research contribution to address the identified gaps, this study proposes and implements an
IoT-enabled watering and monitoring system for BSF maggot farming with three specific technical
contributions: i) a Mamdani fuzzy logic inference engine embedded on ESP32 that provides real -time
closed-loop automated control of three actuators (water pump, heating bulb, and blower fan) without rel iance
on cloud-based processing; ii) the Telegram Bot API as a lightweight, bidirectional remote monitoring , and
manual override interface, a practical alternative to proprietary cloud dashboards that eliminates subscription
costs, reduces communication la tency, and operates reliably over standard mobile internet connections ; and
iii) a complete, reproducible embedded IoT architecture for insect farming automation that constitutes
reusable knowledge applicable to other insect farming species (e.g., mealworm and cricket) and broader
smart agriculture microclimate control applications.
Significance, t he proposed system contributes to the advancement of AI -driven agriculture
automation by demonstrating that lightweight fuzzy logic inference, a classical intelli gent systems method,
can deliver reliable real -time environment control on resource -constrained hardware at minimal cost. In the
broader context of sustainable agriculture, automated BSF farming systems directly support circular economy
goals by improving organic waste bioconversion efficiency and reducing the carbon footprint of protein
production.
The remainder of this paper is structured as follows. Section 2 describes the system architecture,
fuzzy logic controller design, IoT communication implementation, and testing procedure. Section 3 presents
Bulletin of Electr Eng & Inf ISSN: 2302-9285
Enhancing maggot farming with an internet of things-enabled watering and … (Rini Puji Astutik)
4955
calibration results, system performance analysis , and benchmarking. Section 4 concludes the study with a
contributions, limitations, and future research directions.
- RESEARCH METHOD
The IoT -enabled watering and monitoring system for BSF maggot cultivation is designed to
facilitate the automated regulation and supervision of farming environment. The research methodology
encompasses hardware and software integration, fuzzy logic controll er design, IoT communication
implementation and rigorous sensor calibration and system performance testing.
2.1. System architecture
The system architecture follows a four -stage processing pipeline, illustrated in Figure 1: i) sensing:
the SHT20 sensor acquires temperature (T, C) and relative humidity (H,%) via I 2C communication to the
ESP32 microcontroller at a 1,000 ms sampling interval; ii) processing: the ESP32 applies the Mamdani fuzzy
inference engine (fuzzification to rule evaluation to aggregation to COA defuzzification) to determine binary
actuator states (ON/OFF) ; iii) actuation: the resolved states are transmitted to a relay module and motor
driver, which physically activate or deactivate the water pump (irrigation), incandescent heating bulb
(heating), and blower fan (ventilation) ; and iv) communication; sensor readings and actuator states are
serialized into a JSON payload and transmitted to the Telegram Bot API via HTTPS for delivery to the
registered user. Figure 1 illustrates the complete end-to-end signal flow across all four-stages.
Figure 1. Four-stage architecture of the IoT-enabled watering and monitoring system, illustrating the end-to-
end signal flow from SHT20 sensor acquisition through ESP32 fuzzy processing to actuator activation and
Telegram Bot API communication
2.2. Fuzzy logic controller design
Two distinct operational modes are implemented: a manual mode, in which act uators are controlled
via Telegram commands, and an automatic mode governed by a Mamdani fuzzy logic inference engine . The
Mamdani method was selected over alternative approaches, including neuro-fuzzy systems, for three reasons:
i) interpretability: Mamdani rules are directly formulated from domain expert knowledge without requiring
training data, making the rule base fully transparent and auditable; ii) computational efficiency: Mamdani
inference executes in <5 ms per cycle on the ESP32, compared to neuro-fuzzy systems that require dedicated
computing hardware [23]; and iii) practical deployability: the complete inference engine is implementable on
a single low -cost microcontroller without external processing dependencies. The overall operational flow of
the system is illustrated in Figure 2, showing the sequential process from system initialization and sensor data
acquisition, through mode selection (manual or automatic), fuzzy processing, and data transmission to
Telegram. The operational logic of both modes is detailed in the flowcharts: Figure 3(a) presents the manual
mode flowchart, illustrating the request -order sequence for watering pump, bulb ( relay 1), and blower ( relay
2) control via Telegram commands; Figure 3(b) presents the automatic mode flowchart, showing the fuzzy
logic decision process for humidity sensing (RH<60% for water pump activation) and temperature sensing
(temp<25 °C for bulb activation; temp>40 °C for blower activation).
ISSN: 2302-9285
Bulletin of Electr Eng & Inf, Vol. 15, No. 6, December 2026: 4953-4966
4956
Figure 2. The main flowchart of IoT monitoring system for maggot cultivation
(a)
(b)
Figure 3. Operational flowcharts of both system modes: (a) manual mode as request-order sequence for
watering pump, heating bulb, and blower control via Telegram commands and (b) automatic mode as
Mamdani fuzzy logic decision process for humidity-based irrigation (RH<60%) and temperature-based
actuation (temp<25 °C: bulb ON; temp>40 °C: blower ON)
Bulletin of Electr Eng & Inf ISSN: 2302-9285
Enhancing maggot farming with an internet of things-enabled watering and … (Rini Puji Astutik)
4957
Fuzzification and membership functions . Two crisp input variables are processed: temperature
(T, °C) and relative humidity (H, %). Each input variable is mapped to three triangular m embership functions
(low, medium, and high ). The membership functions thresholds were determined based on published
empirical BSF larval development parameters [2], [3]: the medium (optimal) range for tempera ture
(25-40 °C) and humidity ( 60, 85%) represents the documented range for maximum larval growth rate and
bioconversion efficiency; the low and high boundaries represent thresholds at which larval stress and
mortality are reported in the literature. Tempe rature MFs: low (peak: 25 °C, support: [15, 30 °C]); medium
(peak: 32 °C, support: [25, 40 °C]); high (peak: 42 °C, support: [35, 50 °C]). Humidity MFs: low (peak: 50%,
support: [30, 65%]); medium (peak: 72%, support [60, 85%]; high (peak: 90%, support: [80, 100%]).
Rule base, the rule base comprises nine Mamdani IF–THEN rules derived from BSF agronomic
knowledge, presented in Table 2. The rules encode three primary control strategies: i) when temperature is
low, activate the heating bulb; ii) when humidity is low and temperature is not high, activate the water pump;
and iii) when temperature is high, activate the blower fan . A ll actuators remain deactivated when both
temperature and humidity are within the medium (optimal) range.
Defuzzification, the centroid of area (COA) method converts the aggregated fuzzy output into a
crisp actuation signal. Output membership function for OFF (centroid: 0) and ON (centroid: 1) are triangular.
If the COA result exceeds 0.5, the actuator is activated. COA was selected for its smooth output response
under partial membership conditions and low computational overhead on embedded hardware. Algorithm 1
presents the complete pseudo -code for the ESP32 implementation of the Mamdani fuzzy inference engine,
providing sufficient detail for full reproducibility on any compatible microcontroller platform.
Table 2. Mamdani fuzzy logic rule base for bsf maggot farming environmental control
Temperature (input 1) Humidity (input 2) Water pump Bulb (heater) Blower (fan)
Low (T<25 C) Low (H<60%) ON ON OFF
Low (T<25 C) Medium (60≤H<80%) OFF ON OFF
Low (T<25 C) High (H≥80%) OFF ON OFF
Medium (25 C≤T<40 C) Low (H<60%) ON OFF OFF
Medium (25 C≤T<40 C) Medium (60≤H<80%) OFF OFF OFF
Medium (25 C≤T<40 C) High (H≥80%) OFF OFF OFF
High (T≥40 C) Low (H<60%) ON OFF ON
High (T≥40 C) Medium (60≤H<80%) OFF OFF ON
High (T≥40 C) High (H≥80%) OFF OFF ON
Algorithm 1. Mamdani fuzzy inference engine–ESP32 implementation (pseudo-code)
-
Parameter initialization
Input: T (temperature, C), H (humidity, %)
Output: O (pump state, bulb state, blower state {0, 1})
R = Rule base
Begin
State 1: Sensor Acquisition -
Read T dan H from SHT20 via I2C
State 2: Fuzzification – compute membership degree using triangular MF -
Fuzzification
T-Low = [15, 25, 30]; T-Med = [25, 32, 40]; T-High = [35, 42, 50];
H-Low = [30, 50, 65]; H-Med = [60, 72, 85]; H-High = [80, 90, 100]
State 3: Rule Evaluation
Rule evaluation (9 rules, min operator); N = 9;
For r = r1, … rN do
r = min (antecedent1_r, antecedent2_r)
End For
State 4: Aggregation Apply Max
For each output variable o Do
agg_o(x) = Max (r * consequent_r(x)), r
End For
State 5: Defuzzification -
Defuzzification
For each output variable o Do
𝑐𝑟𝑖𝑠𝑝𝑜 =
∑ 𝑥 ∗𝜇𝑎𝑔𝑔_𝑜(𝑥)
∑ 𝜇𝑎𝑔𝑔_𝑜(𝑥)
If 𝑐𝑟𝑖𝑠𝑝𝑜 ≥ 0.5
𝑠𝑡𝑎𝑡𝑒𝑜 = 1
Else ISSN: 2302-9285
Bulletin of Electr Eng & Inf, Vol. 15, No. 6, December 2026: 4953-4966
4958
𝑠𝑡𝑎𝑡𝑒𝑜 = 0
End If
End For
State 6: Actuation and Transmission -
Activate or deactivate actuator according to pumpstate, bulbstate, blowerstate
-
Serialize sensor readings and actuator states into JSON payload
-
Transmit JSON payload to registered user via Telegram Bot API (HTTPS)
-
End Begin
2.3. Internet of things communication and monitoring
The Telegram Bot API serves as the primary communication platform interface [26], selected as a
lightweight, cost -free alternative to proprietary cloud -based IoT dashboards (e.g., ThingSpeak, Blynk, and
AWS IoT). Unlike cloud platform that require paid subscription, server maintenance, and proprietary SDKs,
the Telegram Bot API operate over standard HTTPS with no additional infrastructure cost, supports
bidirectional command execution (monitoring and manual override), and is accessible on any mobile device
with internet connectivity. This design decision directl y reduces deployment cost and increases accessibility
for small-scale BSF farming operators.
Sensor data are serialized into a structured JSON payload (field: timestamp, temperature float 1dp,
humidity integer, and actuator states Boolean) and transmitted via HTTPS long-polling at 1,000 ms intervals.
End-to-end latency ranged from 1.2 to 2.5 seconds under normal Wi -Fi conditions (RSSI>−70 dBm) .
Three-level error handling ensures robustness under prolonged deployment: i) Wi -Fi reconnection with
exponential backoff (500 ms initial, 30 s maximum) prevents permanent disconnection after network
interruptions; ii) Telegram API timeout handling (5 s timeout , automatic retry ) manages intermittent
connectivity; and iii) sensor read failure detection, (3 consecutive failed I²C reads attempts trigger user alert)
ensures sensor malfunction is immediately communicated rather than causing silent system failure . These
mechanisms have been designed to sustain reliable operation across extended deployment periods without
manual intervention.
Figure 4 illustrates the complete Telegram Bot command ordering system, comprising four
command categories: i) monitoring order with command/status, /sensor, /ping, and /memory for real -time
environmental data retrieval; ii) controlling o rder with commands /setlow, /sethigh, /relay1 on/off, and
/relay2 on/off for threshold configuration and manual relay activation; iii) watering order with commands
/waternow, /waterstop, /autowater, and /waterstatus for irrigation management; and iv) system order with
commands /restart, /authorize, and /help for system administration. All commands are processed by the
ESP32 and responses are returned to the user via Telegram.
Figure 4. The Telegram bot command ordering system flowchart, showing the four command categories:
i) monitoring, ii) controlling order, iii) watering order, and iv) system order
Bulletin of Electr Eng & Inf ISSN: 2302-9285
Enhancing maggot farming with an internet of things-enabled watering and … (Rini Puji Astutik)
4959
2.4. Testing procedure
System testing encompasses three components: i) sensor accuracy validation, ii) fuzzy logic control
response evaluation, a nd iii) integrated IoT communication testing. Figure 5 presents the complete
methodology flowchart illustrating the sequential testing procedure.
Figure 5. Methodology flowchart of the system testing procedure, showing the sequential stages of sensor
calibration, fuzzy logic control evaluation, IoT communication testing, and statistical analysis
Sensor calibration was conducted over a period of four weeks (19 September –15 October
2025/2026) across 12 non -consecutive sessions at varying times o f day to capture diurnal environmental
variation. Reference instruments: calibrated digital thermometer (resolution: 0.1 °C, accuracy: ±0.3 °C), and
digital hygrometer (resolution: 1% RH, accuracy: ±2% RH) , both factory -calibrated and within valid
calibration period. The SHT20 sensor and reference instruments were co-located within the farming
enclosure. Each data point represents the mean of three consecutive SHT20 readings within a 30 -second
window. Percentage error is calculated as expressed in (1):
𝐸𝑟𝑟𝑜𝑟 =
|𝑆𝑒𝑛𝑠𝑜𝑟 𝑅𝑒𝑎𝑑𝑖𝑛𝑔−𝑅𝑒𝑓𝑒𝑟𝑒𝑛𝑐𝑒 𝑅𝑒𝑎𝑑𝑖𝑛𝑔|
𝑅𝑒𝑓𝑒𝑟𝑒𝑛𝑐𝑒 𝑅𝑒𝑎𝑑𝑖𝑛𝑔 × 100% (1)
Statistical significance of sensor accuracy was evaluated using 95% confidence interval (CI) for the
mean error, calculated as (2):
𝐶𝐼 = 𝑥̅ ± 𝑡𝛼
2
× (
𝑆𝐷
√𝑛) (2)
Where n is 12 trials, SD is standard deviation of percentage error, and tα
2
= 2.201 (t-distribution, 11 degrees
of freedom, = 0.05). For temperature: 95% CI = [0.872.201 × (0.58/√12)] = [0.50%, 1.24%]. For
humidity: 95% CI = [0.732.201 × (0.56/√12)]=[0.37%, 1.09%]. Both upper bound remain well below
ISSN: 2302-9285
Bulletin of Electr Eng & Inf, Vol. 15, No. 6, December 2026: 4953-4966
4960
the 2% tolerance threshold, confirming statistical significance of sensor accuracy claims at the 95%
confidence level.
Fuzzy logic evaluation was performed by configuring the enclosure t o represent each of the three
principal environmental conditions through controlled ambient adjustment. Each trial was sustained for a
minimum of 10 minutes to steady -state sensor confirmation before actuator response record ing. Actuator
response time was measured using internal ESP32 timestamp with millisecond resolution.
- RESULTS AND DISCUSSION
An IoT -enabled watering and monitoring system has been designed and implemented for BSF
maggot farming. This section presents sensor calibration results with sta tistical validation , IoT
communication evaluation, fuzzy logic control performance, system benchmarking against related works, and
practical implications for sustainable agriculture and waste management.
3.1. Sensor calibration results
The complete IoT-enabled watering and monitoring system was successfully assembled and deployed
within the BSF maggot farming enclosure. All hardware components, including the SHT20, ESP32
microcontroller, relay module, motor driver, water pump, incandescent h eating bulb, and blower fan, were
integrated and mounted within the farming environment as illustrated in Figure 6. The system enclosure housing
the ESP32 and relay modules was wall-mounted within the cultivation area to ensure proximity to all actuator
connection while maintaining protection from substrate moisture. Following successful deployment, sensor
calibration and system performance evaluation were conducted as described in the following subsections. Prior
to system evaluation, both sensors were subjected to calibration testing. Figures 7 and 8 present the temperature
and humidity calibration results, respectively ; Figure s 7(a) and 8(a) show sensor versus reference
measurements, while Figures 7(b) and 8(b) show the percentage error per trial with 95% CI bounds.
Figure 6. Implementation of IoT-enabled watering and monitoring system in maggot farming
(a) (b)
Figure 7. Temperature sensor calibration results across 12 trials: (a) comparison of SHT20 sensor reading
versus reference thermometer measurement and (b) percentage error per trial with mean error reference line
(0.87%), upper 95% CI bound (1.24%), and lower 95% CI bound (0.50%)
Bulletin of Electr Eng & Inf ISSN: 2302-9285
Enhancing maggot farming with an internet of things-enabled watering and … (Rini Puji Astutik)
4961
As shown in Figure 7, t he temperature sensor achieved a mean accuracy of 99.13% (mean error:
0.87%, SD: 0.58%, 95% CI: [0.50%, 1.24%]), with a minimum error of 0.00% (Trial 6) and maximum error
of 1.72% (Trial 8) . The humidity sensor, as in Figure 8, achieved a mean accuracy of 99.27% (mean error:
0.73%, SD: 0.56%, 95% CI: [0.37%, 1.09%] ), with four trials re cording zero error and a maximum error of
1.54% (Trial 5) . Both 95% CI upper bound remain well within the 2% tolerance threshold for IoT
environmental monitoring applications [10], [13], confirming the statistical significance of the accuracy
claims. The low SD value (0.58% and 0.56%) indicate consistent measurement performance with limited
variability across the full diurnal test range. From a practical perspective, this level of accuracy is sufficient
to reliably detect the critical BSF environmental thresholds (T:25 C and 40 C; H:60%) that trigger actuator
response, ensuring that the fuzzy logic controller operates on trustworthy input data.
(a) (b)
Figure 8. Humidity sensor calibration results across 12 trials: (a) comparison of SHT20 sensor reading versus
reference hygrometer measurement and (b) percentage error per trial with mean error reference line (0.73%),
upper 95% CI bound (1.09%), and lower 95% CI bound (0.37%)
3.2. Internet of things communication via Telegram
The system operates under two modes: automatic (fuzzy logic ) and manual mode (Telegram
commands). Both modes and the monitoring system are interfaced through the Telegram platform. Figure 9
illustrates t he Telegram display interface , comprising Figure 9(a) the system monitoring panel displaying
real-time temperature, humidity, actuator states, Wi -Fi RSSI, memory utiliza tion, system uptime , and
administrator status; Figure 9(b) the control command menu enabling threshold configuration and manual
relay activation; and Figure 9(c) the watering management panel for initiating, terminating, and monitoring
irrigation operations.
(a) (b) (c)
Figure 9. The monitoring and operational system display at the Telegram platform showing: (a) the system
monitoring panel with real-time environmental data and actuator status, (b) the control command menu for
manual threshold configuration and relay activation, and (c) the watering management panel for initiating,
terminating, and monitoring the irrigation process
ISSN: 2302-9285
Bulletin of Electr Eng & Inf, Vol. 15, No. 6, December 2026: 4953-4966
4962
The Telegram Bot API achieved end-to-end communication latency of 1.2-2.5 seconds under normal
Wi-Fi conditions, providing near -real-time environmental visibility without subscription costs or proprietary
operators: compared to cloud-based IoT platforms (which typically require USD 5 -25/month and dedicated
server maintenance), the Telegram -based interface operates at zero recurring cost while delivering
comparable monitoring and control functionality over standard mobile internet connections.
3.3. Fuzzy logic system performance
Table 3 presents the fuzzy logic evaluation results across all 12 trials. Three distinct actuator
response patterns were consistently observed: i) heating bulb activation in trials D2 and D8 (T<25 C), with
concurrent water pump activation in D2 where humidity was also below threshold; ii) blower fan activation
in trials D4, D6, D9 and D12 (T≥40 C), with response times of 1.1 -1.4 s; and iii) water pump activation in
isolation in D4, D7, and D10 (H<60%, T in medium range). Trials D1, D3, and D11, with both parameters in
the optimal medium range, resulted in all actuators remaining deactivated. No conflicting actuator
combinations were recorded across all 12 trials, confirming the logical integrity of the ni ne-rule Mamdani
inference engine.
Table 3. Running system based on fuzzy logic analysis
Data Temp (C) Humidity (%) Water pump Bulb (heater) Blower (fan) Response time (s)
D1 30.4 86 Off Off Off -
D2 23.0 50 On On Off 1.3
D3 28.2 81 Off Off Off -
D4 43.0 45 On Off On 1.1
D5 24.9 66 Off On Off 1.6
D6 41.0 83 Off Off On 1.2
D7 32.2 55 On Off Off 1.5
D8 22.5 75 Off On Off 1.8
D9 41.5 88 Off Off On 1.4
D10 29.6 53 On Off Off 1.3
D11 32.1 89 Off Off Off -
D12 43.8 70 Off Off On 1.1
Average 32.68 C 70.08% ON:4× ON:3× ON:4× 1.4 s (mean)
3.4. System benchmarking against related works
To validate comparative performance, the proposed system is benchmarked against five directly
related IoT system for BSF farming automation, as presented in Table 4. The benchmark evaluates six
dimensions: platform, sensor accuracy reporting, automated actuation capability, fuzzy logic control,
response time, and remote access.
Table 4. Benchmark comparison of proposed system against related IoT BSF farming solutions
Study Platform Sensor accuracy Auto actuation Fuzzy control Response time Remote access
Wibisono et al. [20] ESP8266 Not reported No No N/A No
Ramadhan et al. [21] Arduino+IoT Not reported No No N/A No
Sari et al. [23] PC-based Not reported Yes Neuro-fuzzy >5 s No
Kayonde [5] Raspberry Pi Not reported No No N/A Yes (web)
Teng and Halim [22] ESP32 Partial Partial No N/A Yes
Proposed System ESP32 99.13% (T)
99.27% (H)
Yes (3 act.) Mamdani 1.4 s
(mean)
Yes (Telegram)
As shown in Table 4, the proposed system is the only solution that simultaneously achieves
automated three-actuator control, Mamdani fuzzy logic inference, sub -2-second actuator response time, and
mobile-accessible remote monitoring within a single low -cost embedded platform. Prior systems either lack
automated actuation entirely [5], [20], [21], require more computationally demanding approaches [23], or
implement only partial actuation without intelligent inference [22]. This benchmark confirms the practical
superiority of the proposed system for real-time automated environmental management in BSF cultivation.
3.5. Practical implications for sustainable agriculture and waste management
The proposed system delivers measurable practical benefits across three dimensions relevant to
sustainable agriculture and waste management. First, labor cost reduction: by replacing manual monitoring
Bulletin of Electr Eng & Inf ISSN: 2302-9285
Enhancing maggot farming with an internet of things-enabled watering and … (Rini Puji Astutik)
4963
(1-3 daily inspections requiring 15 -30 minutes each) with continuou s automated sensing and actuation, the
system eliminates approximately 0.5 -1.5 person -hours of daily monitoring labor per farming unit. At a
conservative labor cost of USD 3/ hour in small-scale Indonesian operations, this represents an annual saving
of approximately USD 500-800 per cultivation unit, a significant reduction for small and medium -scale BSF
farmers. Second, productivity improvement: the reduction of environmental deviation response time from 3 -
12 hours (manual) to 1.4 seconds (automated) ensur es that temperature and humidity remain within the
optimal BSF larval development range for a substantially greater proportion of the cultivation cycle.
Literature reports indicate that maintaining optimal BSF environmental condition can increase larval bi omass
yield by 15 -25% compared to inconsistently managed environments [4], [7], suggesting meaningful
productivity gains achievable through the proposed system. Third, waste management contribution: improved
BSF larval survival and bioconversion eff iciency directly translates to higher organic waste processing
capacity per unit area, supporting municipal organic waste reduction goals and contributing to circular
economy targets in urban agricultural setting [1], [2].
Beyond BSF cultivation, the system architecture constitutes reusable knowledge applicable to other
insect farming domains. The same ESP32+SHT20+Mamdani fuzzy logic+Telegram architecture can be
adapted for mealworm (Tenebrio molitor) cultivation (optimal: 25 -30 C, 50 -70% RH), cricket ( Acheta
domesticus) farming (optimal: 28 -32 C, 60 -80% RH), and other microclimate -sensitive agricultural
applications including mushroom cultivation and seedling germination chambers, with only the fuzzy
membership function thresholds requiring adjustment. This architectural generalizability positio ns the
proposed system as transferable intelligent system solution for precision microclimate management across
smart agriculture domains [8], [9], [17].
-
CONCLUSION
This study successfully designed, implemented, and evaluated an IoT -enabled watering and
monitoring system for BSF maggot cultivation, the first integrated embedded IoT platform for BSF farming
combining Mamdani fuzzy logi c-driven automated actuation, multi -parameter environmental sensing, and
lightweight Telegram -based remote monitoring within a single low -cost system, without reliance on cloud -
based processing or proprietary infrastructure.
Sensor calibration confirmed a mean temperature accuracy of 99.13% (error: 0.87%, SD: 0.58%,
95% CI: [0.50%, 1.24%]) and mean humidity accuracy of 99.27% (error: 0.73%, SD: 0.56%, 95% CI:
[0.37%, 1.09%]), both statistically significant at 95% confidence level and well within the 2% IoT sensing
tolerance threshold. Fuzzy logic automatic control evaluation across 12 trials confirmed 100% logical
consistency across all actuator responses, with a mean response time of 1.4 s (range: 1.1 –1.8 s), three to four
orders of magnitude faster than manual intervention. Benchmarking against five related BSF IoT systems
confirmed that the proposed system is the only solution integrating all three functional layers: closed -loop
actuation, intelligent inference, and mobile remote monitoring. The sys tem aligns with intelligent system
architectures by demonstrating that classical artificial intelligence (AI) method, specifically Mamdani fuzzy
logic, can deliver reliable, real -time environmental control on resource -constrained embedded hardware at
minimal cost, constituting a practical contribution to AI -driven agricultural automation. Telegram Bot API
implementation demonstrates the viability of lightweight messaging platforms as zero -cost alternatives to
proprietary cloud IoT dashboards. The complete s ystem architecture constitutes reusable knowledge directly
transferable to other insect farming species and smart agriculture microclimate control applications with
minimal modification.
Limitations and future work; four limitations are acknowledged. First , the 12-trial evaluation over a
limited duration does not capture long -term performance degradation; future work should conduct multi -
lifecycle deployment testing under real commercial conditions. Second, fuzzy membership function
thresholds were defined from published BSF parameters rather than empirically optimized from observed
larval performance; adaptive or neuro -fuzzy approaches should be explored for dynamic recalibration. Third,
only temperature and humidity are monitored; integration of substrate moisture sensors, CO₂ sensors, and
larval mass weight sensors would provide more comprehensive environmental control capability. Fourth,
system scalability to multi -node commercial farming operations with centralized control has not been
evaluated. Future work should additionally investigate integration with machine learning -based predictive
models for proactive environmental management, and assess the system’s economic feasibility and
productivity gains under extended commercial BSF farming deployment. ISSN: 2302-9285
Bulletin of Electr Eng & Inf, Vol. 15, No. 6, December 2026: 4953-4966
4964
ACKNOWLEDGMENTS
This research was academically supported by Department of Electrical Engineering, Universitas
Muhammadiyah Gresik, Indonesia, and Informatics Engineering and Industrial Engineering, Universitas
Islam Majapahit, Indonesia.
FUNDING INFORMATION
This research was financially supported by Universitas Muhammadiyah Gresik, Indonesia and
Universitas Islam Majapahit, Indonesia.
AUTHOR CONTRIBUTIONS STATEMENT
This journal uses the Contributor Roles Taxonomy (CRediT ) to recognize individual author
contributions, reduce authorship disputes, and facilitate collaboration.
Name of Author C M So Va Fo I R D O E Vi Su P Fu
Rini Puji Astutik ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
Arbi Alfian Mas’ud ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
Muhammad
Ramadhani
✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
Samsudin Nur ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
Soffa Zahara ✓ ✓ ✓ ✓ ✓ ✓ ✓
Mohammad Muslimin ✓ ✓ ✓ ✓ ✓
C : Conceptualization
M : Methodology
So : Software
Va : Validation
Fo : Formal analysis
I : Investigation
R : Resources
D : Data Curation
O : Writing - Original Draft
E : Writing - Review & Editing
Vi : Visualization
Su : Supervision
P : Project administration
Fu : Funding acquisition
CONFLICT OF INTEREST STATEMENT
Authors state no conflict of interest
DATA AVAILABILITY
The data that support the findings of this study are available upon request from the corresponding
author. The data, which may contain information that could potentially compromise the privacy of research
participants, are not publicly accessible due to certain confidentiality restrictions and ethical considerations
governing data privacy protection.
REFERENCES
[1] S. Diener, C. Zurbrügg, and K. Tockner, “Bioaccumulation of heavy metals in the black soldier fly, Hermetia illucens and effects
on its life cycle,” Journal of Insects as Food and Feed, vol. 1, no. 4, pp. 261–270, Dec. 2015, doi: 10.3920/jiff2015.0030.
[2] C. H. Lalander, J. Fidjeland, S. Diener, S. Eriksson, and B. Vinner as, “High waste -to-biomass conv ersion and efficient
Salmonella spp. reduction using black soldier fly for waste recycling,” Agronomy for Sustainable Development, vol. 35, no. 1, pp.
261–271, Jan. 2015, doi: 10.1007/s13593-014-0235-4.
[3] R. Salomone, G. Saija, G. Mondello, A. Giannetto, S. Fasulo, and D. Savastano, “Environmental impact of food waste
bioconversion by insects: Application of Life Cycle Assessment to process using Hermetia illucens,” Journal of Cleaner
Production, vol. 140, pp. 890–905, Jan. 2017, doi: 10.1016/j.jclepro.2016.06.154.
[4] P. Madari, C. P. Mallapur, D. N. Kambrekar, and G. Goudar, “Bioconversion of organic wastes using black soldier fly,” Journal
of Farm Sciences, vol. 36, no. 04, pp. 373–376, Dec. 2023, doi: 10.61475/jfs.2023.v36i4.10.
[5] V. Kayonde, “An IoT Based Monitoring and Control System for a Black Soldier Fly (BSF) Farm,” B.S. thesis, School of
Engineering, Makerere University, Kampala, Uganda, 2023.
[6] D. R. Mulyanti et al. , “Utilizing Black Soldier Fly Larvae for Sustainable Organic Waste Management and Urban Farming:
Efficiency, Challenges, and Scalability,” Jurnal Teknologi dan Manajemen Industri Terapan , vol. 4, no. I, pp. 152 –161, Feb.
2025, doi: 10.55826/jtmit.v4ii.989.
[7] F. Sankara et al., “Optimization of Production Methods for Black Soldier Fly Larvae (Hermetia illucens L.) in Burkina Faso,”
Insects, vol. 14, no. 9, p. 776, Sep. 2023, doi: 10.3390/insects14090776.
[8] S. F. Fatima, U. B. Shinde, and S. Ali, “IoT Based Smart Agricultural Mon itoring System,” International Journal of Innovations
in Engineering Research and Technology, vol. 8, no. 06, pp. 175–179, 2021, doi: 10.17605/OSF.IO/HU2V6.
Bulletin of Electr Eng & Inf ISSN: 2302-9285
Enhancing maggot farming with an internet of things-enabled watering and … (Rini Puji Astutik)
4965
[9] F. R. de Avila and J. L. V. Barbosa, “Smart environments in digital agriculture: a systematic review and taxonomy,” Computers
and Electronics in Agriculture, vol. 236, p. 110393, Sep. 2025, doi: 10.1016/j.compag.2025.110393.
[10] N. N. Thilakarathne, M. S. A . Bakar, P. E. Abas, and H. Yassin, “Internet of things enabled smart agriculture: Current s tatus,
latest advancements, challenges and countermeasures,” Heliyon, vol. 11, no. 3, p. e42136, Feb. 2025, doi:
10.1016/j.heliyon.2025.e42136.
[11] S. P. Sudha and J. B. S. Loret, “A review on machine learning-based precision agriculture techniques for crop farming monitoring
with IOT,” Discover Environment, vol. 4, no. 1, p. 10, Jan. 2026, doi: 10.1007/s44274-025-00305-8.
[12] M. S. Mekala and P. Viswanathan, “A Survey: Smart agriculture IoT with cloud computing,” in 2017 International Conference on
Microelectronic Devices, Circuits and Systems, ICMDCS 2017, Aug. 2017, pp. 1–7, doi: 10.1109/ICMDCS.2017.8211551.
[13] D. Vallejo-Gómez, M. Osorio, and C. A. Hincapié, “Smart Irrigation Systems in Agriculture: A Systematic Review,” Agronomy,
vol. 13, no. 2, p. 342, Jan. 2023, doi: 10.3390/agronomy13020342.
[14] P. P. Ray, “Internet of things for smart agriculture: Technologies, practi ces and future direction,” Journal of Ambient Intelligence
and Smart Environments, vol. 9, no. 4, pp. 395–420, Jun. 2017, doi: 10.3233/AIS-170440.
[15] S. Wolfert, L. Ge, C. Verdouw, and M. J. Bogaardt, “Big Data in Smart Farming – A review,” Agricultural Systems, vol. 153, pp.
69–80, May 2017, doi: 10.1016/j.agsy.2017.01.023.
[16] N. Yamsani, K. Muthukumaran, B. S. Kumar, V. Asha, N. Singh, and J. A. Dhanraj, “IoT -Based Livestock Monitoring and
Management System Using Machine Learning Algorithms,” in Proceedings of 2024 International Conference on Science,
Technology, Engineering and Management, ICSTEM 2024, Apr. 2024, pp. 1–6, doi: 10.1109/ICSTEM61137.2024.10560908.
[17] A. Tzounis, N. Katsoulas, T. Bartzanas, and C. Kittas, “Internet of Things in agricult ure, recent advances and future challenges,”
Biosystems Engineering, vol. 164, pp. 31–48, Dec. 2017, doi: 10.1016/j.biosystemseng.2017.09.007.
[18] A. Abu Sneineh and A. A. Shabaneh, “Design of a smart hydroponics monitoring system using an ESP32 microcontroller and the
Internet of Things,” MethodsX, vol. 11, p. 102401, 2023, doi: 10.1016/j.mex.2023.102401.
[19] A. I . D. Idrissi, A. Abouabdillah, M. Chikhaoui, and R. Bouabid, “Low -cost IoT -based monitoring system for precision
agriculture,” in E3S Web of Conferences, vol. 492, p. 01003, Feb. 2024, doi: 10.1051/e3sconf/202449201003.
[20] F. Ssemakula, B. A. M. Tumwine, M. P. Namugwanya, and S. Mbalire, “A Low-Cost Internet of Things Cloud Based Solution for
the Intelligent Rearing of the Black Soldier Fly, ” in 2023 IEE E AFRICON , Nairobi, Kenya, 2023, pp. 1 -6, doi:
10.1109/AFRICON55910.2023.10293221.
[21] A. R. Ramadhan, T. P. Azzahra, K. Maharani, and D. Rimantho, “The Utilization of Hygrometer and Exhaust with IoT
Technology in Temperature Control in Maggot (BSF) Conta iners: Temperature Control Innovation in BSF Maggot Cultivation
through Hygrometer and Exhaust IoT Technology,” MEIN: Journal of Mechanical, Electrical & Industrial Technology , vol. 2,
no. 1, pp. 1–6, 2025, doi: 10.35991/MEIN.V2I1.19.
[22] A. H. Teng and E . Halim, “Smart IoT -Driven Organic Waste Management: A Design -Based Approach Utilizing Black Soldier
Fly (BSF) Maggots in Indonesia,” in Lecture Notes in Networks and Systems , vol. 1785 LNNS, 2026, pp. 372 –387, doi:
10.1007/978-3-032-14750-9_31.
[23] Y. S. Sari, Kusrini, E. Utami, and F. W. Wibowo, “VARFIS: A Hybrid Neuro-Fuzzy Model for Intelligent Microclimate Control
in Black Soldier Fly Farming Systems,” Jurnal Teknik Informatika , vol. 18, no. 2, pp. 281 –291, Oct. 2025, doi:
10.15408/jti.v18i2.46610.
[24] A. Kamilaris and F. X. Prenafeta-Boldú, “Deep learning in agriculture: A survey,” Computers and Electronics in Agriculture, vol.
147, pp. 70–90, Apr. 2018, doi: 10.1016/j.compag.2018.02.016.
[25] S. Karim, K. Hussain, M. B. Alvi, M. A. Rahu, M. A. Kaloi , and H. Haleem, “Artificial Intelligence in Sustainable Smart
Agriculture: Concepts, Applications, and Challenges,” VAWKUM Transactions on Computer Sciences , vol. 13, no. 1, pp. 307 –
342, Jun. 2025, doi: 10.21015/vtcs.v13i1.2151.
[26] M. I. M. M . Imran, R. Abdullah, S. I. Ismail, and N. N. S. N. Dzulkefli, “IoT -based Emergency Alert System Integrated with
Telegram Bot,” in 2023 IEEE International Conference on Automatic Control and Intelligent Systems, I2CACIS 2023 -
Proceedings, Jun. 2023, pp. 126–131, doi: 10.1109/I2CACIS57635.2023.10193550.
BIOGRAPHIES OF AUTHORS
Rini Puji Astutik received the engineer degree in Electrical Engineering from
Institut Teknologi Sepuluh Nopember, Surabaya, Indonesia in 2003. She received the master
degree in Electrical Engineering from Faculty of Electrical Technology, Institut Teknologi
Sepuluh Nopember Surabaya, Indonesia in 201 7. Since 2004, she has been with the
Department of Electrical Engineering, Faculty of Engineering, Universitas Muhammadiyah
Gresik, Indonesia as a lecture r. Her research interests include wireless sensor network,
wireless communication, internet of things and its implementation, and V2X communication.
She can be contacted at email: astutik_rpa@umg.ac.id.
Arbi Alfian Mas’ud received the engineering degree in Electrical Engineering
from Universitas Muhammadiyah Gresik, Indonesia in 2026. He has been active in
community service activities and received several grants either from education minister or
Pertamina Foundation. His research interests include renewable energy, implementation of
IoT, and programmable logic controller (PLC). He can be contacted at email:
arbyjaya123@gmail.com.
ISSN: 2302-9285
Bulletin of Electr Eng & Inf, Vol. 15, No. 6, December 2026: 4953-4966
4966
Muhammad Ramadhani is a student at the Department of Electrical and
Electronic Engineering, Universitas Muhammadiyah Gresik, Indonesia. His research interests
IoT and its implementation also PLC . He can be contacted at email:
mdhani111104@gmail.com.
Samsudin Nur is a student at the Department of Electrical and Electronic
Engineering, Universitas Muhammadiyah Gresik, Indonesia. His research interests IoT and its
implementation also PLC. He can be contacted at email: samsudinn605@gmail.com.
Soffa Zahara received t he engineer degree in Informatics Engineering from
Universitas Pasundan , Bandung, Indonesia in 2014. She received the master degree in
Electrical Engineering from Faculty of Electrical Technology, Institut Teknologi Sepuluh
Nopember Surabaya, Indonesia in 2017. Currently since 2017, she has been with Department
of Informatics Engineering, Faculty of Engineering, Universitas Islam Majapahit, Mojokerto,
Indonesia as a lecture. Her research interests include computer network, multimedia , and
cloud computing. She can be contacted at email: soffa.zahara@unim.ac.id.
Mohammad Muslimin received the engineer degree in Industrial Engineering
from Universitas Islam Majapahit, Mojokerto, Indonesia in 2008. He received the master
degree in Industrial Engineering from Faculty of Technology , Institut Teknologi Adhi Tama
Surabaya, Indonesia in 2015. Currently since 2015, he has been with Department of Industrial
Engineering, Faculty of Engineering, Universitas Is lam Majapahit, Mojokerto, Indonesia as a
lecture. His research interests include quality, production system, appropriate technology, and
manufacturing. He can be contacted at email: mmuslimin072@gmail.com.
论文原文与出版信息
Bulletin of Electrical Engineering and Informatics