Back to Portfolio

Smart Building Sensor Fusion HVAC & Occupancy Optimisation

Multi-sensor fusion platform for smart building HVAC optimisation and occupancy prediction across 12 London office buildings — achieving 97.0% room-level occupancy prediction accuracy with a 15-minute lookahead and 18% reduction in HVAC energy consumption.

Project Context

Timeline

6 months, August 2024 – January 2025

Team

1 IoT/Embedded Engineer, 1 Data Scientist

Client

Commercial property management firm, 12 office buildings across London

Scope

340+ sensor nodes across 12 buildings, 180+ monitored zones

The client manages a portfolio of 12 multi-tenant office buildings across central and east London, totalling approximately 45,000 sqm of lettable space. Rising energy costs and tenant demands for better indoor air quality drove the need for an intelligent HVAC optimisation system. The buildings range from 1990s refurbishments to 2010s new builds, each with different BMS (Building Management System) vendors, making a unified sensor-driven approach essential.

Project Overview

Developed a sensor fusion platform that integrates environmental, occupancy, and energy-metering data to optimise HVAC scheduling and setpoints across 12 London office buildings. The system predicts room-level occupancy 15 minutes ahead and adjusts heating, cooling, and ventilation accordingly — reducing energy waste in unoccupied or lightly occupied zones while maintaining tenant comfort within defined thresholds.

Hardware

Raspberry Pi 4 (per-floor gateway), ESP32 (sensor nodes), Sensirion SCD41, Panasonic EKMC, BME280, TSL2591, Shelly 3EM

AI Framework

TensorFlow Lite, scikit-learn, XGBoost

Data Processing

Time Series Analysis (Prophet), Kalman Filtering, Sensor Fusion Algorithms

Communication

MQTT (Mosquitto), BACnet gateway, REST API, InfluxDB

The Challenge

A commercial property management firm overseeing 12 office buildings across London needed to reduce HVAC energy consumption without compromising tenant comfort or indoor air quality. Key challenges included:

  • Integrating 7 distinct sensor types — CO2 (Sensirion SCD41), PIR occupancy (Panasonic EKMC), temperature/humidity (BME280), ambient light (TSL2591), power metering (Shelly 3EM), door contact sensors, and acoustic occupancy detectors
  • Processing real-time data streams from 340+ sensor nodes across 12 buildings
  • Handling sensor drift, battery depletion, and Wi-Fi connectivity gaps gracefully
  • Correlating occupancy patterns with HVAC demand to predict heating/cooling needs
  • Interfacing with 4 different BMS vendors (Trend, Siemens, Honeywell, Schneider) via BACnet
  • Delivering occupancy predictions with enough lead time (15 minutes) for HVAC pre-conditioning

What Had Been Tried Before

The client had previously installed a basic PIR-only occupancy system in two of their buildings. The system used simple binary occupancy detection (occupied/unoccupied) with fixed 30-minute HVAC timeouts. This approach failed for several reasons: PIR sensors could not distinguish between 2 people and 40 people in an open-plan office, leading to identical HVAC output regardless of actual load. The 30-minute timeout meant HVAC continued running long after floors emptied in the evening. CO2 levels in densely occupied meeting rooms frequently exceeded 1200 ppm before the system reacted, generating tenant complaints. The client needed a predictive, multi-sensor approach that could anticipate demand rather than merely react to it.

Our Solution

1. Multi-Sensor Occupancy Estimation

Developed a fusion model that combines PIR motion events, CO2 rate-of-change, acoustic energy levels, and door contact transitions to estimate not just whether a room is occupied, but approximately how many people are present (in bands: 0, 1–5, 6–15, 16+). This granularity allows the HVAC system to modulate output proportionally rather than using binary on/off control.

Why sensor fusion over camera-based counting: Camera-based occupancy counting would have provided higher-resolution headcounts, but the client's tenants raised privacy objections during consultation. The sensor fusion approach uses only non-visual, non-biometric data — CO2 concentration is a reliable proxy for occupancy density, and combining it with PIR and acoustic signals resolves the ambiguity that any single sensor type introduces.

2. Predictive Occupancy Model

Built an XGBoost-based occupancy prediction model that forecasts room-level occupancy 15 minutes ahead. Features include time-of-day, day-of-week, historical occupancy patterns per zone, calendar integration (meeting room bookings from the client's Exchange server), and CO2 trend gradients. The model retrains weekly on a rolling 8-week window to adapt to changing tenant patterns.

Why XGBoost over LSTM: We tested both LSTM and XGBoost on 4 weeks of pilot data. XGBoost achieved 97.0% accuracy at the 15-minute horizon versus 95.8% for the LSTM, while running comfortably on a Raspberry Pi 4 (inference in under 5ms vs. 120ms for the LSTM). For this tabular time-series problem with strong temporal features, gradient boosting outperformed sequence models both in accuracy and resource efficiency.

3. HVAC Setpoint Optimisation

Implemented a rule-based optimisation layer that translates occupancy predictions into HVAC setpoint adjustments via BACnet. Unoccupied zones enter setback mode (heating to 16°C instead of 21°C, ventilation reduced to minimum fresh-air rate). Zones predicted to become occupied receive pre-conditioning 15 minutes in advance, ensuring comfort is maintained from the moment of arrival.

Why rule-based over reinforcement learning: While RL-based HVAC control is promising, the client required a transparent, auditable control logic that their building managers could understand and override. Rule-based setpoint scheduling is explainable, tuneable per-zone, and carries no risk of unexpected behaviour — critical for occupied commercial buildings.

4. Per-Floor Edge Gateway

Each floor is served by a Raspberry Pi 4 gateway that aggregates sensor data via MQTT, runs the local occupancy estimation model, and communicates setpoint recommendations to the BMS via a BACnet IP gateway. This architecture keeps latency-sensitive decisions local while forwarding historical data to a central InfluxDB instance for analytics and model retraining.

Why Raspberry Pi 4 over cloud-only: The client's buildings have inconsistent internet reliability. Edge gateways ensure HVAC optimisation continues even during internet outages — the Pi runs the last-trained model locally and only requires connectivity for model updates and dashboard reporting.

Technical Implementation

Sensor Network Architecture

The system integrates 7 sensor types deployed across 180+ zones:

  • CO2 (Sensirion SCD41): Photoacoustic NDIR sensor, ±40 ppm accuracy. Deployed in meeting rooms and open-plan areas. CO2 rate-of-change is the primary occupancy density signal.
  • PIR Occupancy (Panasonic EKMC): Passive infrared motion detection with 5m range. Used for binary occupied/unoccupied baseline and to detect first/last presence.
  • Temperature/Humidity (BME280): Combined environmental sensor for HVAC feedback loops and comfort monitoring. Deployed at desk height in each zone.
  • Ambient Light (TSL2591): High-dynamic-range light sensor. Used to detect daylight availability for blind/lighting integration and as a secondary occupancy signal (lights left on = likely occupied).
  • Power Metering (Shelly 3EM): Per-floor energy monitoring at the distribution board. Provides ground-truth HVAC energy consumption data for measuring optimisation impact.
  • Door Contact Sensors: Magnetic reed switches on meeting room doors. Provide entry/exit event timestamps for meeting room occupancy tracking.
  • Acoustic Occupancy Detectors: MEMS microphone modules running on-device sound level analysis (dBA only — no speech recording). Elevated ambient noise correlates with occupancy in open-plan areas.

Data Fusion Pipeline

The fusion pipeline processes sensor data through three stages:

  • Pre-processing: Kalman filtering for CO2 and temperature readings to smooth noise. Missing sensor data is handled via last-value-carry-forward with a configurable staleness timeout (10 minutes for PIR, 30 minutes for CO2).
  • Feature engineering: Rolling statistics (5-min, 15-min, 60-min windows) for CO2 gradient, temperature delta from setpoint, PIR event frequency, and acoustic energy. Calendar features from Exchange integration.
  • Occupancy estimation: XGBoost classifier outputs occupancy band predictions. Ensemble averaging across overlapping sensor zones improves robustness when individual sensors drop out.

Limitations & Edge Cases

The system has documented limitations that were communicated to the client during handover:

  • Sensor drift: CO2 and temperature sensors exhibit measurable drift over 3–6 months. The system flags readings that deviate significantly from expected baselines, but quarterly physical recalibration of SCD41 and BME280 sensors is required to maintain specified accuracy.
  • Post-layout changes: The occupancy model's accuracy drops to approximately 91% during the first 2 weeks after office layout changes (desk relocations, partition modifications) before the weekly retraining cycle adapts the model to new patterns.
  • Battery-powered sensors: PIR sensors, door contacts, and acoustic detectors run on CR123A batteries with approximately 12-month life. The system monitors battery voltage and alerts the facilities team, but annual replacement across 340+ nodes is a non-trivial maintenance burden.
  • BACnet compatibility: Two of the 12 buildings use legacy BMS controllers that support only BACnet MS/TP (serial) rather than BACnet IP. These require an additional RS-485 gateway per floor, adding cost and a potential point of failure.
  • Weekend/holiday accuracy: Occupancy prediction accuracy is lower on non-standard days (bank holidays, office events) when patterns diverge from the training distribution. The system falls back to reactive mode (respond to current sensor state rather than predict) when prediction confidence drops below 80%.

Results & Impact

97.0%

Occupancy Prediction Accuracy (room-level, 15-min lookahead)

<5ms

On-Device Inference Latency (Raspberry Pi 4)

340+

Sensor Nodes Across 12 Buildings

99.1%

System Uptime (edge gateway level)

Before & After Comparison

Before

Fixed HVAC schedules: heating/cooling ran 07:00–19:00 regardless of actual occupancy

After

Predictive scheduling: HVAC modulates per-zone based on 15-minute occupancy forecast

Before

Binary PIR: no occupancy density data, 30-min fixed timeout, frequent CO2 complaints

After

Multi-sensor fusion: 4-band occupancy estimation, 97.0% prediction accuracy, CO2 consistently <1000 ppm

Measured Outcomes

  • 18% reduction in HVAC energy consumption across the portfolio (measured via Shelly 3EM power meters over 3 months post-deployment vs. same period prior year, weather-normalised)
  • 97.0% occupancy prediction accuracy at room level with 15-minute lookahead
  • CO2 levels maintained below 1000 ppm in 98.5% of occupied hours (vs. 89% previously)
  • Tenant comfort complaints related to temperature reduced by 35%
  • Average HVAC pre-conditioning lead time reduced from 30 minutes (fixed schedule overshoot) to 15 minutes (predictive), saving energy while maintaining comfort

Ongoing & Next Steps

The system is in active operation across all 12 buildings with ongoing monitoring and planned enhancements:

  • In progress: Integration with tenant lighting controls — using ambient light sensor data and occupancy predictions to automate blind and lighting adjustments alongside HVAC
  • Scheduled Q2 2025: Expansion to 4 additional buildings in the client's Manchester portfolio, adapting sensor placement templates for different floor-plate sizes
  • Under evaluation: Replacing the rule-based HVAC setpoint logic with a model-predictive control (MPC) approach for buildings with well-characterised thermal models
  • Ongoing: Quarterly sensor recalibration programme and annual battery replacement cycle for the 340+ wireless sensor nodes
  • Exploring: Integration with the client's EPC (Energy Performance Certificate) reporting to provide automated energy efficiency evidence for regulatory compliance