Case study: Fan coil units
A BACnet MS/TP server for fan coil units, on an STM32 with an RTOS
An embedded developer runs the CAS BACnet Stack as a BACnet MS/TP server on an STM32 microcontroller, so a central building management system monitors and controls the fan coil in every room over RS-485.
The challenge
A fan coil sits in every room, so there are a lot of them, and each one is a small microcontroller board with an RS-485 port, not a computer with an Ethernet jack. In most buildings those units are wired on a BACnet MS/TP trunk back to the building management system.
The developer needed a BACnet MS/TP server that fits the memory of an STM32, runs under the board’s RTOS, and takes its turn on a shared token-passing trunk with every other unit on the floor.
Why the CAS BACnet Stack
- The stack’s embedded build target starts with every object type, service and data link switched off, and turns on only what the device uses, so an MS/TP fan coil carries only MS/TP and the objects it presents.
- The stack is portable C++ behind a flat C interface. The product supplies the serial port and a clock through callbacks, and the stack handles MS/TP framing and token passing on top of them.
- Source is included and royalty-free, which matters on a product that ships one per room.
The solution
- Fan coil sensors and outputs
- STM32 with an RTOS
- CAS BACnet Stack (BACnet MS/TP server)
- RS-485 MS/TP trunk
- Central building management system
The stack runs as a BACnet MS/TP server in an RTOS task on the STM32. The developer’s code passes bytes between the RS-485 UART and the stack’s receive and send callbacks, and calls the stack’s tick on a regular schedule.
Each fan coil appears on the trunk as its own BACnet device, and the room’s values become BACnet objects the building management system reads and writes.
Results
- A central building management system monitors and controls every room’s fan coil over BACnet MS/TP.
- The BACnet server runs on the existing STM32 microcontroller, with no separate network processor.
More of what manufacturers build with it
- HVAC controller: BACnet/IP in a commercial equipment controller
- Ultra-low temperature freezers: a BACnet/IP server on a TI AM335x Linux controller
- Lighting and shading control: a BACnet/IP server on a DIN-rail ESP32
- Air curtain controller: BACnet/IP and BACnet MS/TP on embedded Linux
- IoT air disinfection device: BACnet on an ESP32 with FreeRTOS
- Compressor fleet management: BACnet/IP on a custom ARM controller
- Digital twin for data centers: the BACnet API inside a software platform
Have a similar project?
Building something like this?
Tell Chipkin your platform, whether your device is a BACnet server or a client, and the data link you need. A Chipkin engineer replies with how the stack fits and where to start.
- Consultation: talk directly with BACnet specialists about your project.
- Run an example: every profile example project publishes a Windows and a Linux binary.