## 2 System Architecture
Once connected, the ESP32 reads or writes BLE characteristics as defined by the GATT services on the Raspberry Pi. BLE's advantage is its energy efficiency. Devices remain in low-power modes most of the time and only wake up to transmit small bursts of data, such as sensor readings. This is crucial for IoT systems, where power consumption needs to be minimized. The ThingSpeak platform, which provides cloud-based management of real-time sensor data sent from the Raspberry Pi over a 5G network, acts as the system's data storage and visualization layer. The platform enables the system to safely store environmental data, including temperature and humidity, and display them in real time through dashboards that can be customized. ThingSpeak allows users to track trends and patterns over time by time-stamped each incoming sensor reading. This is particularly helpful for monitoring isolated or remote locations. By facilitating sophisticated data analysis and predictive modeling, its integration with MATLAB ([[https://www.mathworks.com/products/thingspeak.html](https://www.mathworks.com/products/thingspeak.html)]([https://www.mathworks.com/products/thingspeak.html](https://www.mathworks.com/products/thingspeak.html)) (accessed on 5 August 2025)) improves the platform even more and provides insights beyond simple monitoring. However, ThingSpeak does come with limitations, particularly in terms of data transfer and processing capabilities. The free version of ThingSpeak restricts the rate of data updates, with only one data point allowed every 15 s, and limits the total number of data points that can be stored. This could pose a challenge for systems that require high-frequency data transmission or real-time responsiveness in fast-changing environments. Additionally, the platform's free tier limits the amount of data that can be processed simultaneously, which may require the use of paid subscriptions for larger-scale applications or more frequent data transfers. Due to these limitations, ThingSpeak is not ideal for immediate-response requirements or high-volume data collection, but it is still an excellent solution for low-to-moderate data throughput in a variety of IoT projects. There are limitations on the data packet size that ThingSpeak can send to its cloud platform. Each packet constitutes an API call and can send up to eight fields of data with a maximum size of 255 bytes for each field. It comprises the data recorded by the sensor and its accompanying metadata or timestamps. This packet size is usually enough for small-scale IoT tasks that only manage small sensor readings such as temperature, humidity, or motion, but can get limiting when it comes to more complex or high-resolution data. A 5G cellular network is utilized in this system to facilitate rapid and reliable transmission of sensor data from peripheral locations into the cloud. To achieve the above, a Waveshare SIM8200 EA-M2 5G module is integrated on the Raspberry Pi to give it the capability to connect to the internet through the high-speed 5G cellular network. The  
Figure 4: Raspberry Pi 4. Raspberry Pi interacts with the modem through a USB interface. This 5G module acts as a modem connecting the Raspberry Pi to the cellular network, giving the device constant wireless real-time data transfer ability.The 5G network's low latency and high bandwidth make it ideal for all the needed IoT data transmission, in our case for constant remote monitoring of environmental conditions. The 5G SIM8200 EA-M2 module easily interfaces with the Raspberry Pi for seamless integration, and uploads sensor data from the ThingSpeak cloud via USB 3.0. It offers both 5G NSA (non-standalone) and SA (stand-alone) architecture support, allowing it to function over a wide range of network coverage. If a 5G network is unavailable, the module will switch to LTE or 3G, which maintains a constant connection. This feature is important for IoT systems that deploy remote environments with unpredictable network coverage issues (Figure 5).