BAS-340 · Lesson 9 of 12 · 25 min

Smart building platforms and IoT devices

▶ Video coming soon A video version of this lesson is on the way.

Marisol Ekwueme, the engineer from Fenwright Engineering who represented Thistledown at the kickoff, had brought two requests from her client's workplace team. Thistledown used wireless desk-occupancy sensors in its other offices, reporting to a cloud platform, and wanted them on the new floor. And its workplace app let staff ask for a warmer or cooler room. Could the app talk to the BAS? Declan had written both requests into the minutes with the note discuss with Prakash. "This is where everyone's going," Prakash said when Callie showed him, "and it's where most of the mistakes are being made. The technology is fine. The questions about who controls what, and who can reach what, are the hard part."

What people mean by a smart building

Smart building has no fixed meaning, but most uses of the phrase describe some combination of four things.

  • More sensing: many small, often wireless, sensors for occupancy, temperature, air quality, people counts and equipment condition, added without running cable.
  • Data platforms: software, usually in the cloud, that collects data from the BAS, lighting, access control, meters and sensors into one place with a common data model.
  • Applications: analytics and fault detection, as BAS-330 described; space utilization reports; tenant apps for comfort requests, room booking and building information; and dashboards for owners.
  • Connections out of the building: to cloud services, to the utility for demand response, to the owner's portfolio systems and to service contractors.

Each of these can be valuable. Each also moves information, and sometimes control, across a boundary that did not exist when the BAS was a closed system on its own wires. Integration work in a smart building is mostly about managing those boundaries.

Wireless sensors

Common wireless technologies for building sensors (typical characteristics).
TechnologyTypical useRange and powerNotes
EnOceanRoom sensors, switchesShort range; many devices harvest energy from light or the press of a switchNo batteries in many devices; a receiver gateway maps them to BACnet
Zigbee and ThreadRoom sensors, some lightingShort range mesh; batteriesMesh networks need enough nodes to route around obstacles
Bluetooth Low EnergyBeacons, phone-based apps, some sensorsShort range; batteriesOften used for commissioning wireless lighting
LoRaWANSensors spread over large buildings or campusesLong range, low data rate; batteries can last yearsUsually reports to a network server, often in the cloud
Wi-FiHigher data rate devicesUses the owner's network; higher powerNeeds IT approval and network segmentation
Cellular IoTRemote meters, isolated equipmentWide area; carrier subscriptionBypasses the building network entirely, which is both a convenience and a governance problem

Battery life is the practical limit of most wireless sensors, and it depends mostly on how often the sensor reports. Manufacturers quote long battery lives at the default reporting interval; shortening the interval to get faster data can shorten the life dramatically.

Worked problem

Reporting interval and battery life

A wireless temperature and occupancy sensor has a 2,400 mAh battery. At a 10-minute reporting interval its average current is about 25 µA; at a 1-minute interval it rises to about 120 µA (sample data sheet figures). What is the theoretical battery life at each interval, ignoring self-discharge?

Show solution
  1. At 10 minutes: 2,400 mAh ÷ 0.025 mA = 96,000 h, about 11 years.
  2. At 1 minute: 2,400 mAh ÷ 0.120 mA = 20,000 h, about 2.3 years.

Answer: About 11 years against about 2.3. In practice self-discharge and temperature cut the long figure to the battery's shelf life, but the lesson holds: a reporting interval chosen for convenience can turn a set-and-forget sensor into a battery replacement program for 200 devices.

How data leaves the building

A BAS sends data to a cloud platform in one of a few ways. Each starts with a device inside the building, usually called an edge gateway, which reads the BAS, lighting and meters on the building network and sends chosen values out.

  • MQTT, a lightweight publish-and-subscribe protocol. Devices publish messages to topics on a broker, such as ninefield/floor4/zone12/temperature, and any authorized subscriber receives them. MQTT is efficient, works well over unreliable links, and has features such as quality-of-service levels, retained messages and a last will message that the broker publishes if a device disconnects unexpectedly. Sparkplug is a specification on top of MQTT that standardizes topic names and message formats for industrial and building data.
  • REST APIs, in which the cloud platform or the edge gateway exposes web addresses that return data when asked, usually in JSON. Simple to use, but each request is a poll.
  • BACnet Secure Connect (BACnet/SC), the addition to BACnet that carries BACnet messages over encrypted, authenticated connections through a hub, which makes BACnet itself suitable for links across networks the owner does not control.
  • Vendor protocols built into a manufacturer's cloud service.
A layered diagram. At the bottom, inside the building, the BAS controllers, the lighting gateway and the meters are on the building automation network. An edge gateway on that network reads chosen points. A firewall separates the building network from the internet. Above it, the edge gateway opens an outbound encrypted connection to an MQTT broker in the cloud, which feeds the analytics platform and the tenant's workplace platform. Arrows show data flowing out only. A crossed-out arrow from the cloud back into the BAS is labeled no direct writes. A separate cloud box for the tenant's wireless desk sensors connects to the tenant platform only, not to the building network.
Data leaving Ninefield: an edge gateway publishes chosen values over an outbound encrypted connection; nothing in the cloud writes to the BAS.

Worked problem

How much data does an MQTT feed send?

The fourth floor will have 18 VAV zones. The proposed feed to Thistledown's platform publishes 4 values per zone (temperature, setpoint, occupancy and airflow) every 60 s, and each message is about 200 bytes. How many messages and how much data per day? How much if the gateway publishes only on change, with about 1 in 10 values changing in a typical minute?

Show solution
  1. Messages per minute = 18 × 4 = 72. Per day = 72 × 1,440 = 103,680.
  2. Data per day = 103,680 × 200 bytes = 20,736,000 bytes, about 21 MB.
  3. On change, about 1 in 10: 10,368 messages and about 2.1 MB a day.

Answer: About 104,000 messages and 21 MB a day at a fixed interval, or about a tenth of that by exception. Neither is a burden on a modern connection, but subscription platforms often price by message or by point, so the publishing rule affects cost as well as traffic.

Data models

A cloud platform that collects data from many buildings needs to know what each value is. A point named AHU2_SAT means something to the person who named it and nothing to software. Tagging and semantic models solve that. BAS-320 described Project Haystack tagging, which Quillon uses on new programs. The Brick schema describes equipment, points and their relationships in a more formal way, and ASHRAE's Standard 223 work defines a semantic model for building systems that both build on. For integration, the practical point is that a platform which understands tags can find every zone temperature in the building without a person mapping them one by one, which is most of the cost of onboarding a building onto an analytics or smart building platform.

Control stays local

The most important design decision in any smart building project is where control lives. Quillon's answer, which BAS-330 gave for analytics, applies to every platform: the BAS controls the building, from controllers in the building, and cloud platforms read. There are good reasons for that.

  • Reliability. An internet connection fails, a cloud service has an outage, a subscription lapses. The building must keep running on its own controllers through all of them.
  • Speed. A control loop that waits for a round trip to a data centre a few hundred kilometres away, plus queueing, cannot hold a pressure or a temperature well.
  • Responsibility. When a setpoint is changed, the BAS's audit trail, described in BAS-320, records who changed it and when. A write from a cloud platform arrives as a write from a service account, and the person behind it may be impossible to trace.
  • Security. A path that lets the cloud write to the BAS is a path that an attacker who compromises the cloud account can use too.

Worked problem

Why a cloud control loop struggles

A duct static pressure loop at Ninefield is tuned for a controller that updates its output every 1 s. Suppose instead the loop ran in a cloud service with a round trip of 2 s on a good day and occasional delays of 30 s. How much dead time does the cloud add, compared with the loop's own 1 s update, on a good day and on a bad one?

Show solution
  1. Good day: 2 s of round trip, twice the loop's update interval.
  2. Bad day: 30 s, thirty times the update interval, during which the fan speed cannot change at all.

Answer: Even on a good day the cloud doubles the loop's dead time, which BAS-130 showed is the enemy of stable control, and on a bad day the loop is effectively open. Supervisory decisions, such as a schedule or a reset every 5 minutes, can tolerate that; feedback loops cannot.

Some platforms do write to buildings, and some owners want them to: an analytics platform that resets setpoints, a demand response service that sheds load, a tenant app that adjusts a room. Where that is agreed, the write goes through a narrow, bounded path designed into the BAS: the BAS exposes a specific point, such as a setpoint offset, and its own program limits the value, applies it only in the zone it belongs to, expires it after a set time and records it. The cloud never writes directly to equipment points, and nothing written from outside can affect a safety or life-safety function.

The answer to Thistledown

Prakash and Declan's answer to Marisol, sent after the kickoff, was in three parts, and it made a good summary of the lesson.

  • Desk sensors: welcome, on Thistledown's own wireless system and cloud platform, with their gateway on Thistledown's network, not on the building automation network. The BAS already gets zone occupancy from the lighting sensors for occupied standby and does not need the desk data.
  • Data to Thistledown's platform: a read-only feed of the floor's zone temperatures, setpoints, occupancy and airflow, published over MQTT by an edge gateway that Quillon manages, with an outbound-only encrypted connection through the building's firewall.
  • Comfort requests from the app: sent to Ilona's work order system as requests, where the building operator can respond through the BAS, rather than written to the BAS directly. If the app is later to adjust rooms itself, it will be through a bounded setpoint offset point, limited by the BAS program to 1 K (2 °F) either way and expiring after two hours, and only after Ilona approves it and the design has been reviewed against Quillon's security standard.

Marisol replied that the first two parts suited Thistledown and that the third could wait until the tenant had lived through a winter on the floor. Prakash's comment to Callie was that every platform has an owner, and the owner signs off: at Ninefield that is Ilona, for anything that touches the building, and Thistledown, for its own devices and its own cloud account. An integration that nobody owns is one that nobody will maintain.

Contracts, data and security

Smart building platforms are usually subscriptions, and subscriptions raise questions that a traditional BAS never did. Who owns the data, and can the owner take it with them if they change platforms? What happens to the building's devices if the subscription ends: do the sensors stop working? Does the vendor have remote access, and who approves and logs it? Where is the data stored, and for how long? An integration plan should answer each of these in writing before a single device is installed, because they are very hard to change afterward.

Security is the subject of BAS-430, and every smart building project should be reviewed against it. The basic patterns are worth knowing now: keep devices on segmented networks, allow only outbound encrypted connections from an edge gateway rather than inbound connections from the internet, use unique credentials and certificates rather than default passwords, keep firmware updated, and give every vendor account a named owner and an expiry date.

A short checklist for any platform

Prakash keeps a short list of questions that every smart building proposal must answer before Quillon will connect anything to a client's BAS, and Callie copied it into the front of her notebook.

  • What data leaves the building, how often, and to whom?
  • Does anything come back in, and if so, through which bounded point?
  • Which device makes the outbound connection, who manages it, and how is it updated?
  • Who owns the data, and how is it returned or deleted at the end of the contract?
  • What keeps working if the internet connection or the subscription stops?

A proposal that cannot answer all six is not ready to install, however good its dashboards look.

Common mistakes

  • MistakePutting a tenant's wireless sensor gateway on the building automation network.

    InsteadKeep tenant devices on the tenant's network; share data through a defined interface.

  • MistakeShortening every sensor's reporting interval for faster data.

    InsteadChoose the interval for the purpose; battery life falls steeply with frequent reporting.

  • MistakeRunning feedback control loops in the cloud.

    InsteadControl stays in the building's controllers; the cloud reads and makes supervisory suggestions at most.

  • MistakeLetting a platform write directly to equipment points.

    InsteadUse a bounded, expiring, logged point designed into the BAS, and only with the owner's approval.

  • MistakeSigning a platform subscription without data and exit terms.

    InsteadAgree data ownership, retention, remote access and what happens at the end of the subscription before installation.

Summary and key terms

  • Smart buildings add sensing, data platforms, applications and connections out of the building.
  • Wireless sensors use EnOcean, Zigbee, Thread, Bluetooth, LoRaWAN, Wi-Fi or cellular; reporting interval drives battery life.
  • Edge gateways send chosen data out by MQTT, REST APIs, BACnet/SC or vendor protocols.
  • Tags and semantic models such as Haystack, Brick and ASHRAE 223 make data usable across buildings.
  • Control stays local for reliability, speed, responsibility and security; cloud writes, if any, go through bounded points.
  • Tenant systems stay on tenant networks; data is shared through defined, read-only interfaces.
  • Data ownership, exit terms and security are agreed before installation; BAS-430 covers security in depth.
Edge gateway
A device in the building that collects data from local systems and sends it to cloud services.
MQTT
A lightweight publish-and-subscribe messaging protocol using a broker and topics.
Broker
The MQTT server that receives published messages and passes them to subscribers.
BACnet/SC
BACnet Secure Connect, which carries BACnet over encrypted, authenticated connections through a hub.
LoRaWAN
A long-range, low-power wireless network protocol for sensors.
Semantic model
A formal description of what each point and piece of equipment is and how they relate.
Bounded write
A write from an outside system to a BAS point whose value, scope and duration the BAS limits.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. A sensor's battery is 1,800 mAh and its average current is 30 µA. What is its theoretical life?

    Show answer

    1,800 ÷ 0.030 = 60,000 h, about 6.8 years.

  2. 20 zones publish 3 values every 30 s. How many messages per day?

    Show answer

    20 × 3 × 2,880 = 172,800.

  3. 172,800 messages of 150 bytes: how much data per day?

    Show answer

    About 25.9 MB.

  4. Name two reasons control stays in the building's controllers.

    Show answer

    Reliability and speed (also responsibility and security).

  5. Where should a tenant's desk sensor gateway connect?

    Show answer

    To the tenant's own network.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz