
Overview
Fragmented campus energy and environmental data created a challenge for centralized monitoring and trend analysis. The goal was to build a multi-node wireless sensor network capable of aggregating data (temperature, humidity, CO2, light levels) into cloud storage without requiring additional campus network infrastructure.
System Architecture
Three edge nodes transmit readings to a central gateway over a long-range (LoRa) 433MHz connection. The gateway then relays this data to the cloud via MQTT over TLS.
- Sensor Node: ESP32-WROOM-32 with DHT22, MQ-135, and BH1750 sensors.
- Gateway Node: ESP32 with LoRa + WiFi, acting as an MQTT bridge.
- Cloud Infrastructure: Google Cloud IoT Core for data brokerage, BigQuery for storage, and Looker Studio for real-time visualization.
Implementation
Each sensor node was optimized for extreme low-power consumption, utilizing deep-sleep cycles every five minutes. This enabled an average power draw of 18mA, providing 72 hours of operation on a standard 18650 cell. The gateway implements a sliding window error-detection mechanism, flagging node failures if multiple consecutive data windows are missed. Field testing led to the tuning of the LoRa spreading factor to SF9, which balanced range and transmission reliability, resulting in less than 5% packet loss at a 1km range.
Outcome
The system successfully maintained 24/7 operation across three nodes, delivering real-time environmental trends to a centralized dashboard. Deep-sleep optimizations were critical in achieving the necessary battery life, proving the viability of long-range IoT networks for dense campus environments.
Lessons Learned
- Spreading Factor Tuning: LoRa airtime and payload size must be calculated explicitly; SF7 had unacceptably high packet loss beyond 800m.
- Deep Sleep Management: SPI and I2C hardware states must be re-initialized after every wake cycle to ensure reliable sensor communication.
- Protocol Evolvability: Transitioning away from deprecated cloud services requires a modular design that facilitates switching MQTT brokers without re-flashing entire edge nodes.