1 Introduction

Wireless sensor networks (WSNs) have become an innovative and attractive solution for environmental monitoring. They allow for pervasive monitoring of various environmental parameters such as temperature, humidity, air quality, and noise levels. WSNs provide many important benefits such as real-time access to data, coverage of wide areas, long-term monitoring, and system scalability [1]. Environmental monitoring is fundamental to understanding our ecosystem in order to prevent adverse effects on human health and the environment. Urban noise affects more than quality of life and can cause long-term physiological damage. The application of wireless sensor networks in terrestrial and aquatic ecosystems offers significant benefits as a better consideration of the local test conditions becomes possible. This can be essential for the monitoring of environmental systems. Significant advantages in the application of heterogenous wireless sensor networks are their self-organizing behaviour, resulting in a major reduction in installation and operation costs and time [2]. Integrating a thresholding algorithm can make wireless sensor networks (WSNs) more energy efficient.

There are many studies and research papers that have been published on the topic of wireless sensor networks for environmental monitoring. In [3], the authors described a LoRa-based environmental monitoring system that modeled and simulated a LoRaWAN network using MATLAB/SIMULINK before the physical deployment of the network. The system is made up of a sensor node, base station, and database unit. The research used LoRa technology to overcome the short-range communication barriers while consuming low power.

A Collaborative Energy Efficient IoT-based LoRa WAN, utilizing ultra-low-energy hardware and the LoRa modulation technique to enhance the energy efficiency of Wireless Sensor Networks was carried out in [4]. Cluster heads (CHs) facilitate data aggregation before transmission to gateways, optimizing data flow. The system incorporates a hibernation mode for the microcontroller post-transmission.

A low-cost air quality monitoring system that measures several pollutants was carried out in [5]. The authors proposed a novel adaptive algorithm to reduce packet loss in the cellular network-based transmissions used by the system, to extend response waiting times based on the RSSI.

A scalable and energy-efficient medium-access control (MAC) protocol designed specifically for greenhouse monitoring and control was carried out in [6]. The article describes the proposed protocol’s contributions, including avoiding collisions, overhearing, over-emitting, and idle listening while maintaining scalability and reducing control packet overheads. They also reduce transmission delays by avoiding periodic node synchronizations.

An innovative approach that allows any passive sensor in the network to obtain the distance to its neighbors via backscattering and hence detect and signal changes in the monitored structure was carried out in [7]. The estimation algorithm considers the effect of multiple reflections and background noise and works for any network topology.

A method for wireless soil moisture content monitoring using underground IoT sensors and communication modules with UAS-mounted LoRaWAN gateways was carried out in [8]. The authors buried the sensors and communication modules underground and used UAS-mounted gateways for wireless communication.

The authors in [9] presented the uRADMonitor® network, which is an independent monitoring network consisting of 630 sensors measuring PM10 and PM2.5 concentration levels. The study investigated the relationship between PM10 concentrations and local weather parameters such as temperature, humidity, and atmospheric pressure in Romania’s five most populated urban areas.

The authors in [10] proposed a low-cost forest fire detection system based on WSN and IoT. The system utilizes a network of strategically placed sensor nodes monitoring environmental conditions such as temperature, humidity, and smoke levels, and data is transmitted to a central server for real-time analysis and alerts.

In [11], they proposed a dedicated delta encoding algorithm that utilizes the spatial and temporal similarity in the acquired datasets to minimize transmissions and improve battery life throughout the network. The authors implemented the developed technologies in a custom AA battery-powered hardware platform, and they conducted an assessment of the power consumption.

Table 1 summarizes the related works reviewed in this study, highlighting their advantages and significance while also detailing their limitations.

Table 1 Comparison of related works

Using [4] as a reference, we recognized a signifi cant limitation in the transmission protocol, which currently permits data transmission for only 3 minutes every 4 hours. This intermittent transmission window may hinder the timely acquisition of data and could aff ect the overall eff ectiveness of the research outcomes. To address this issue, we propose increasing the transmission frequency to 5 minutes every 4 hours, allowing the system more time to collect reliable data.

Using MATLAB/Simulink for modeling the proposed wireless sensor network (WSN) is effective due to its advanced simulation capabilities and support for control systems and communication protocols. It allows for precise modeling of sensor nodes and data transmission, enabling rapid prototyping without immediate hardware deployment. MATLAB’s analytical tools also help evaluate power consumption and optimize design. The thresholding approach enhances energy efficiency by allowing sensor nodes to transmit data only when parameters exceed set thresholds, reducing unnecessary transmissions and extending battery life crucial for remote applications. This lightweight algorithm is suitable for low-power sensors, focusing resources on significant data. Overall, MATLAB/Simulink and thresholding create a cost-effective, scalable design methodology that balances complexity with real-time performance, ideal for smart environmental monitoring systems.

Subsequent sections that make up the article include the methodology which outlines the model design, Air Quality Index calculation, details of the Thresholding Algorithm and power estimation of the system. Results and Discussion which presents the results achieved by the system during simulation with emphasis on transmission reduction, power consumption reduction per node by 6.3–13.4%, depending on the sensor, Battery Life Extension of 6.69–15.49% increase when compared with traditional method, and the energy efficiency of the system. The paper concludes that the threshold-based Simulink-designed WSN successfully reduces energy usage and extends node lifespan, making it suitable for long-term deployment in remote areas. The study supports WSN application in smart cities, agriculture, and environmental sustainability.

2 Method

The goal of this research is to develop an energy-efficient wireless sensor network for real-time environmental monitoring, using a Simulink-based design. To achieve our objectives, we followed several steps. First, the system was modelled in Simulink. Next, the thresholding algorithm was implemented in the LoRaWAN end nodes. Finally, the system was tested and validated.

2.1 Simulation of model in Simulink

Sensor nodes were made using random block generator in Simulink to mimic environmental scenarios in real time. The blocks for environmental parameters were modelled on Simulink using random number block with values shown in Table 2.

Table 2 Values used to model sensor nodes

Using Eq. 1 which determine the USEPA-AQI which is recommended by the United States Environmental Protection Agency (USEPA) [12], we were able to determine the value of the air sensor to be implemented in the simulation of the model in order to achieve to right Air Quality Index (AQI).

$$\:AQI=\frac{AQIHi-AQILo}{BPHi-BPLo}\times\:\left(C-BPLo\right)+AQILo\:\:\:\:\:\:$$
(1)

where:

\(\:AQIHi\) and \(\:AQILo\): AQI breakpoints.

\(\:BPHi\) and \(\:BPLo\): concentration breakpoints.

\(\:C\) measured PM concentration.

Making C the subject of the formula gives:

$$\:C=\frac{(BPHi-BPLo)\times\:(AQI-AQILo)}{AQIHi-AGILo}+BPLo$$
(2)

Equation 2 is then used to determine the value for the air sensor which is found to be 254 µg/m³ for an AQI of 150. Table 3 show the AQI rating and BP index for PM10.

Table 3 AQI rating and BP index for PM10 [12, 13]

Then using a function generator, LoRaWAN end nodes were created to collect the sensors readings, those values are then crossed-referenced with set threshold to determine if they are above or below the set threshold and then the thresholding algorithm is then implemented and the values are sent to the LoRaWAN gateway through the LoRaWAN network protocol. At the gateway the values are processed and sent to the base station where the values are displayed, stored and analysed in real time.

Figure 1 illustrates the model in Simulink, showing all the sensor nodes that transmit monitored values once every 4 h for 5 min to the LoRaWAN end node where the thresholding algorithm is implemented. The values that meet the threshold criteria are then sent to the LoRaWAN gateway, which collects the received data and forwards it to the base station. At the base station, the values are processed for easy identification and are subsequently displayed using a scope.

Fig. 1
figure 1

Model of system in Simulink

2.2 Method of implementation of the thresholding algorithm

The thresholding algorithm is set to ensure the system only transmits data when values are above the set threshold to minimize transmission power and avoid over-crowding of the system’s network.

At the LoRaWAN end node, the thresholding algorithm was implemented using the code below;

M0 = the monitored values from the sensor nodes coming into the end nodes.

t = the time from the clock block used to ensure the transmission occurs at the right time.

figure a

The threshold values shown in Table 4 were selected because they indicate levels that approach potentially dangerous figures.

Table 4 Values used to implement thresholding

According to the World Health Organization (WHO), maintaining indoor temperatures at or below 30 °C is crucial, as prolonged exposure to temperatures above this threshold, combined with humidity levels exceeding 50%, poses significant health risks, including the potential for heat stroke and fatalities [14]. Additionally, data indicate that exposure to noise levels above 110 dB for more than 5 min can lead to irreversible damage to the hair cells in the inner ear, resulting in noise-induced hearing loss (NIHL) [15]. Furthermore, an air quality index (AQI) reading of 150 or higher is associated with an increased risk of respiratory illnesses and can be potentially life-threatening, particularly for vulnerable populations [16].

The power consumption of each node assuming power consumed by LEDs and resistors are negligible can be calculated as follows:

$$\:{T}_{pc}=\:Nano\:+SX1278+\:S$$
(3)

where \(\:{T}_{pc}\) = total power consumption of the system’s components.

Nano = the power consumed by the Arduino nano microcontroller in active mode.

Sx1278 = the power consumed by the SX1278 LoRa transceiver module.

S = the sensor node responsible for monitoring environmental parameters (DHT22- temperature and humidity sensor, SDS011– Air quality sensor and Mic– noise sensor).

A DHT22 temperature sensor typically consumes a current of 20µA and a power of 0.1mW when active [17, 24].

The microphone requires a supply voltage of 5v and consumes a current of 1.5 mA and a power of 7.5mW when active [18, 24].

An SDS011 PM sensor typically consumes a current of 120 mA and a power of 600mW when active [19, 20, 24].

Using Eq. 3, the power consumed by each node was calculated to be; 271.1mW for the DHT22, 278.5mW for the Mic and 871mW for SDS011.

Table 5 shows the parameters used during the simulation in MATLAB/SIMULINK.

Table 5 Simulation parameters

Figure 2 is the flowchart of the system illustrating the control logic of the algorithm.

Fig. 2
figure 2

Flow chart for the system

3 Results and discussion

3.1 Results from Simulated model

Table 6 displays the total transmission time of the system and also when thresholding is in place. The system is allowed to transmit once every 4 h for an interval of 5 min in a 24 h period, which account for 30 min of transmission in a day.

Using the model in Simulink we were able to calculate the number of times each sensor node transmitted and were unable to transmit due to the implementation of the thresholding at the nodes.

The power consumption of each node was significantly affected by the transmission power of the nodes, the spread factor used (SF12) determines the transmission power since SF12 requires the most transmission power when compared with other spread factors (SF7,SF8,SF9 and SF10), although it requires more power it ensures the longest transmission range, which is a key requirement in this study. Table 6 shows the effect of implementing thresholding specifically on the time the system is allowed to transmit, reducing the transmission power to null when the sensor nodes parameters do not meet the set threshold, thereby ensuring the system save transmission power for when it is not transmitting [24].

Table 6 Thresholding on and off time [24]

3.2 Power consumed by each node

The lora SX1278 module uses a transmit power of 20dBm (100mW) when transmitting at full power [21], if each node will be active for 5 min every 4 h and 30 min per day (24 h), implementing the threshold means the system will only consume power for transmission when it is transmitting [24].

When the system is on standby mode only the Arduino consumes power and in standby mode it only uses 1 mA (5mW) [22]. Since the system is only on for 30 min (1800 s) of the day, it stays in standby mode for 23 h 30 min (84600 s).

The total power consumption of the sensor nodes for 24 h is given by Eq. (4) [23, 24]

$$\:{T}_{p}={T}_{pa}+{T}_{ps}$$
(4)

and

$$\:{T}_{pa}={T}_{p+}+{T}_{p-}$$
(5)
$$\:{T}_{ps}={T}_{pc}+{ST}_{t}$$
(6)

where \(\:{T}_{pa}\) = total power consumed when active.

\(\:{T}_{p+}\) = total power consumed when thresholding allows transmission.

\(\:{T}_{p-}\)= total power consumed when thresholding prevents transmission.

\(\:{T}_{ps}\) = total power consumed when on standby.

\(\:{T}_{pc}\) = total power consumed by the system’s components.

\(\:{ST}_{t}\)= Standby time in sec.

Given that;

$$\:{T}_{p+}={(T}_{pc}\times\:{T}_{t})+{(P}_{t}\times\:{T}_{t})$$
(7)

where \(\:{P}_{t}\) = transmission power.

\(\:{T}_{t}\)= transmission time in sec.

But when thresholding prevents transmission \(\:{P}_{t}=0\)

$$\:{T}_{p-}={T}_{pc}\times\:{T}_{t}$$
(8)

When thresholding is not implemented the total power consumed when active is given by:

$$\:{T}_{pa}=\left({T}_{pc}+{P}_{t}\right)\times\:{T}_{t}$$
(9)

The total power consumed by each node when thresholding was implemented and when it was not implemented were calculated using Eq. (4) and are displayed in Table 7 and in Fig. 3.

Table 7 Percentage savings with thresholding [24]
Fig. 3
figure 3

Power Consumed by Each Node (J)

To calculate the percentage savings, we made use of Eq. (10).

$$\:\%savings=\frac{{P}_{n}-{P}_{o}}{{P}_{o}}\times\:100$$
(10)

where \(\:{P}_{n}\) is new power value.

\(\:{P}_{o}\) is old power value.

3.3 Lifespan of nodes

To determine how long the system can operate on battery power, we used Eq. (11) to calculate the battery life expectancy of the system [4, 24].

$$\:{B}_{life}=\frac{B}{{E}_{total}*\frac{24}{N}*365}$$
(11)

where \(\:B\) is the battery capacity.

\(\:{B}_{life}\) is the battery life.

\(\:{E}_{total}\) is the total energy consumed by the node.

\(\:N\) is the number of cycles in hours in a day (24 h).

The system will transmit every 4 h for a duration of 24 h.

$$\:N=\frac{24}{4}$$
$$\:N=6$$

If we use a battery with a capacity of 5000mAh

$$\:{B}_{life}=\frac{5000\times\:3600mAs}{{E}_{total}*\frac{24}{6}*365}$$
$$\:{B}_{life}=\frac{18000As}{{E}_{total}\times\:1.460}$$
(12)

Using Eq. (12) determine the battery life expectancy for each node was determined, comparing cases with and without thresholding implemented. The results are presented in Table 8 and in Fig. 4.

Table 8 Lifespan of nodes [24]
Fig. 4
figure 4

Estimated Lifespan of Nodes (years)

Using Eq. (10), we were able to calculate the percentage increase in the battery life expectancy of the system as shown in Table 8 above.

The implementation of a threshold-based data transmission model demonstrated a substantial reduction in unnecessary data transmission. Sensor nodes were programmed to activate and transmit data only when predefined thresholds were exceeded (30 °C for temperature, 40% for humidity, 70 dB for noise levels, and 254 µg/m³ (PM10) for air quality monitoring). This approach reduced network traffic and significantly lowered energy consumption by minimizing the active duty-cycle of each sensor node. The system effectively filtered routine readings, thereby preserving energy and extending node operational life, particularly in applications where long-term deployment is essential.

The comparative analysis of energy consumption, presented in Table 7, indicates a substantial decrease in power usage when thresholding was applied. Specifically, energy savings of 13.4%, 13.0%, 6.3%, and 12.86% were recorded for the temperature, humidity, air quality, and noise level sensor nodes, respectively. These improvements are directly attributed to reduced communication overhead and optimized node activity. In addition, battery life analysis using a 5000 mAh lithium battery showed notable enhancements, as detailed in Table 8. The projected lifespan of the sensor nodes increased by 15.49% for temperature sensing, 15.04% for humidity, 6.69% for air quality, and 14.78% for noise level monitoring. These results validate the practical viability of the system for long-duration field deployment, particularly in locations where frequent maintenance or battery replacement is impractical.

When benchmarked against conventional WSN approaches (where sensor nodes typically transmit at fixed intervals regardless of data significance) the proposed system demonstrates a clear advantage in terms of energy conservation and network efficiency. By transmitting only when necessary, the system minimizes power wastage while maintaining effective environmental surveillance. This design choice is critical in the context of scalable deployments, where hundreds or thousands of nodes may be deployed over large geographical areas.

The adoption of threshold-triggered transmission strategies presents a sustainable model for energy-aware WSN deployments. This not only supports environmental sustainability by reducing the frequency of battery disposal but also ensures operational cost savings over the life cycle of the monitoring infrastructure.

3.4 Gaps between simulation and real-world performance of the proposed technique

The simulation consider an ideal situation to emulate sensor data, assuming consistent performance and accuracy. Perfectly timed transmissions every 4 h for 5 min using an ideal clock. Power consumption values used in the model are based on datasheet ratings and do not account for real-time variations or hardware inefficiencies. The thresholding logic assumes clear-cut decision-making without considering signal noise, sensor jitter, or borderline values. The LoRa communication is simulated without modeling interference, signal attenuation, or packet loss, which can significantly affect real-world performance. The battery lifespan is estimated using constant current discharge assumptions, neglecting temperature effects and battery degradation over time. The model assumes that all sensor nodes maintain consistent accuracy throughout the simulation, with no degradation in performance.

3.5 Limitations

Despite the promising results achieved through simulation, several limitations exist that must be addressed to enhance the reliability and applicability of the proposed system in real-world deployments. The LoRa communication is simulated without modeling interference, signal attenuation, or packet loss, which can significantly affect real-world performance. The system operates at low data rates to achieve long-range capabilities. However, this limited bandwidth may not be suitable for applications that require high data throughput, such as video streaming or transferring large files.

By addressing these limitations, future implementations of the proposed WSN architecture will be better equipped for deployment in dynamic and unpredictable environments, ensuring greater reliability, accuracy, and longevity.

3.6 Future work recommendations

Field measurements with precise power profiling tools (e.g., Joule scope or Power Profiler Kits) should be conducted to refine the energy consumption model, including overheads from sensor warm-up, idle modes, and transceiver retries. Future work should involve outdoor testing with multiple nodes under varying environmental conditions to assess network robustness. Integration with real LoRaWAN gateways and performance benchmarking (e.g., packet delivery ratio, RSSI, SNR) is also recommended.

4 Conclusions

In conclusion, this research highlights the successful development and simulation of an energy-efficient Wireless Sensor Network (WSN) specifically designed for real-time environmental monitoring. By utilizing a Simulink-based design and implementing a thresholding algorithm, Simulation results showed energy reductions of up to 13.4% and battery life increases of up to 15.49% compared to traditional methods enabling the system to remain in the field for longer. This advancement not only extends the operational lifespan of sensor nodes but also emphasizes the potential of WSNs in supporting sustainable environmental practices and smart city initiatives. Ultimately, this study offers valuable insights and establishes a foundational framework for future explorations in smart technologies aimed at monitoring and managing environmental parameters, fostering informed decision-making, and promoting sustainability within communities.