Skip to main content

ESP32 Firmware & IoT for Smart Buildings

GizanTech EngineeringIndustrial Firmware TeamUpdated June 15, 2026

Smart-building edge nodes fail in the field, not on the bench: an RS-485 trunk that wired fine drops BACnet MS/TP tokens the moment the rooftop unit's VFD spins up. We build ESP32 firmware that treats the fieldbus, the control loop, and the commissioning handoff as one problem, so the panel that passes point-to-point also holds setpoint a year later.

Challenges specific to Smart Buildings

  • BACnet MS/TP token loss on the RS-485 trunk

    VFD and contactor noise corrupts framing, the token drops, and the ESP32 silently falls off the MS/TP ring until a power cycle, so points read stale.

  • HVAC setpoint hunting after commissioning

    A PI loop tuned on a cool morning oscillates the damper at 3 PM, the zone overshoots two degrees, and occupants override the thermostat for the whole floor.

  • Cheap CO2 sensors drift out of spec

    NDIR cells age and the ABC baseline algorithm latches onto an occupied room, so demand-controlled ventilation over-ventilates and burns reheat energy.

  • Lighting and shade nodes flood the BACnet bus

    Every occupancy edge and lux change publishes a COV, the MS/TP bus saturates, and the AHU controller's reads time out during the busiest part of the day.

  • Commissioning point lists never match the panel

    The mechanical schedule says AI3 is mixed-air temp but the integrator wired it to discharge-air, and nobody catches it until the building runs backwards in winter.

How GizanTech solves them

  1. Hardened MS/TP and Modbus RTU stack. 1) Isolated RS-485 with biased fail-safe termination, automatic baud detection, MAC poll-for-master recovery, and a watchdog that rejoins the MS/TP token ring without a power cycle.
  2. Field-tunable, anti-windup control loops. 2) PI/PID with deadband, integral clamping, and slew-limited damper output exposed as BACnet writable AVs so a balancer retunes setpoint hunting from a laptop, no reflash.
  3. Self-validating CO2/IAQ acquisition. 3) Dual-source NDIR with ABC baseline lockout during occupancy, cross-check against differential pressure, and an out-of-range BACnet reliability flag instead of a silent bad reading.
  4. COV throttling and bus scheduling. 4) Per-object COV increment thresholds, rate limiting, and token-pass-aware transmit windows so lighting and shade traffic never starves the AHU controller's polls.
  5. Commissioning-first point exposure. 5) Object names, units, and present-value source map straight to the mechanical point list, with a built-in point-test mode and CSV export the integrator signs off against.
BMS pointFieldbus protocolControl loopComfort / energy impactCommissioning note
HVAC zone setpointBACnet MS/TP (AV, writable)PI with deadband, anti-windup, slew-limited damperHolds +/-0.5 C, kills setpoint hunting and reheat overshootExpose as priority-array AV; balancer tunes Kp/Ki live, no reflash
OccupancyModbus RTU coil to BACnet BVDebounced PIR fused with schedule, COV-throttledDrives DCV and unoccupied setback, trims fan and reheat hoursForce point in test mode; verify polarity vs. lighting relay
CO2 / IAQBACnet MS/TP AI (ppm)Dual-NDIR median, ABC lockout, reliability flagDCV trims over-ventilation; bad cell flags instead of over-fanningSpan-check against reference; log ABC baseline at handover
Lighting / shadeBACnet MS/TP MV + AO (0-10 V / lux)Daylight-harvest AO, COV-increment rate limitCuts lighting load without starving AHU polls on the trunkCap COV increment; confirm dimming curve and shade end-stops
Smart-building BMS point list: fieldbus, control loop, comfort/energy impact, and commissioning notes per ESP32 edge object

ESP32 Firmware & IoT Development for other industries

Frequently asked questions

Do you support BACnet MS/TP and Modbus on the same panel?

Yes. The ESP32 firmware runs a hardened BACnet MS/TP server and a Modbus RTU/TCP master concurrently, bridging legacy Modbus meters and VFDs into your BACnet point list on one isolated RS-485 bus.

How do you stop setpoint hunting after we commission a zone?

The PI/PID loops expose Kp, Ki, deadband, and output slew as BACnet writable values, so a balancer retunes a hunting damper from a laptop without a firmware reflash or a site visit.

Can the device join an existing BACnet building network?

Yes. It is a routable BACnet MS/TP device with configurable MAC, baud, and Device Instance, and it exposes named objects that map to your mechanical point list for integrator sign-off.

How do you keep cheap CO2 sensors from over-ventilating?

We median dual NDIR cells, lock out ABC baseline correction during occupied hours, cross-check differential pressure, and raise a BACnet reliability flag instead of feeding a drifted reading to DCV.

What happens if the RS-485 trunk is noisy from VFDs?

Isolated transceivers, biased fail-safe termination, and a poll-for-master watchdog let the node rejoin the MS/TP token ring automatically after VFD-induced framing errors, with no power cycle needed.