Building Automation 8-Layer Stackable HAT for Raspberry Pi
Eight universal inputs: 1K/10K Thermistors, 0-10V, Dry Contact; Four 24VAC outputs; Four 0-10V outputs; 1-Wire, RS485, RTC, Watchdog.
Overview
Building automation hardware for Raspberry Pi with software-selectable universal inputs, standard communication interfaces, and support for widely used control and monitoring systems. The Building Automation HAT combines universal analog and sensor inputs, TRIAC and 0-10V outputs, RS485/MODBUS, and 1-Wire interfaces in a compact, stackable platform for HVAC, lighting, and building management applications.
- Eight software-selectable universal inputs: 0-10V, 1K/10K thermistors, or dry contact
- Native RS485 / MODBUS and 1-Wire interfaces
- Four TRIAC outputs for 24VAC load control and four 0-10V outputs for dimming
- Up to 8 cards of each type can be stacked and mixed with other Sequent HATs for virtually unlimited I/O expansion
- Designed for HVAC, lighting control, and building management systems
Works with Open Automation Software
Compatible with widely used tools for control, monitoring, and system integration.
INTERFACES AND I/O
| I/O's | Communication | Software Integration |
|---|---|---|
| • Eight Universal Inputs: | • I2C Port to Raspberry Pi | • Command line |
| • 1K or 10K thermistors | • RS485/MODBUS Port | • Python Library |
| • 0-10V analog inputs | • 1-Wire Interface | • Node-Red nodes |
| • Dry contact/counter inputs | • CODESYS driver | |
| • Four AC TRIAC Outputs, 1A/24VAC | • OpenPLC module | |
| • Four 0-10V Outputs | • Home Assistant Integration | |
| • Four General Purpose LEDs | • Arduino | |
| OTHER FEATURES | ||
| • Software-selectable universal input configuration | ||
| • Wide range 12-24V power supply delivers 5V/5A to Raspberry Pi | ||
| • 500Hz sample rate on 0-10V inputs | • Status LEDs on all Digital Inputs and Outputs | |
| • Works with any Raspberry Pi from ZERO to 5 | • Pluggable Connectors 26-16 AWG wires | |
| • TVS Protection on all Inputs | • On Board Hardware Watchdog and fuse | |
| • Real Time Clock With CR2032 Battery Backup | • Eight Level Stackable | |
DESCRIPTION
The Building Automation HAT provides everything needed to build HVAC, lighting, and building management systems with Raspberry Pi.
Eight universal inputs are software-selectable per channel — configure each one independently as a 0-10V analog input, a 1K or 10K thermistor, or a dry contact/counter input with no jumpers or DIP switches required.
Four AC TRIAC outputs switch 24VAC loads up to 1A for direct control of fans, dampers, and valves. Four 0-10V outputs provide proportional control of light dimmers, variable-speed drives, and other analog actuators.
The Real-Time Clock with CR2032 battery backup keeps accurate time through power failures, making the card ideal for scheduled control and time-stamped event logging.
The hardware watchdog automatically power-cycles the Raspberry Pi if the software becomes unresponsive, ensuring continuous operation in unattended deployments.
Connect to other building automation systems using the RS485/MODBUS port. Read up to 16 DS18B20 temperature sensors via the 1-Wire interface.
The card communicates over I2C using only two of the Raspberry Pi's GPIO pins, leaving the remaining 24 GPIOs free for user applications. Compatible with all Raspberry Pi versions from Zero to 5.
Requires a 24VAC external transformer connected to its own pluggable power connector. The card supplies 5V and up to 5A to the Raspberry Pi over the GPIO bus.
Up to 8 cards of each type can be stacked on a single Raspberry Pi, and cards of different types can be freely mixed in the same stack. Three DIP switch positions (ID0, ID1, ID2) set each card's stack address.
TECHNICAL DETAILS
CARD LAYOUT

MECHANICAL SPECIFICATIONS

DIP SWITCH AND STACKING
The onboard six-position DIP switch configures both the stack address and the RS485 port behavior. Switches ID0, ID1, and ID2 set the card's stack level as a binary address from 0 to 7, allowing up to 8 cards of each type to be stacked on a single Raspberry Pi. Cards of different Sequent HAT types can be freely mixed in the same stack. Switches RX and TX select whether the RS485 port is driven by the Raspberry Pi directly or by the card's onboard processor. Switch TERM connects the RS485 line termination resistor — enable this on the last card in an RS485 chain to prevent signal reflections.
ELECTRICAL SPECIFICATIONS
- Power supply: 3.5mm Pluggable Connector, 24V/1A
- Power consumption: 50mA @ 24V
- On board resettable fuse: 1A
-
0-10V Inputs:
- Maximum Input Voltage: 12V
- Input Impedance: 20KΩ
- Resolution: 12 bits
- Sample rate: 500 sps
- Full scale linearity: 0.15%
- Contact closure inputs max. frequency: 100Hz
- 0-10V Outputs:
- Minimum Output Load: 1KΩ
- Resolution: 0.1%
- Full scale linearity: 0.1%
- Triac Outputs;
- Maximum Output Current: 1A
- Output Voltage: 24VAC
POWER REQUIREMENTS
The card requires an external 12–24VDC power supply connected to its own pluggable power connector. The card supplies 5V and up to 4A continuous, 5A peak to the Raspberry Pi over the GPIO bus, eliminating the need for a separate Raspberry Pi power supply. Operating current is 50mA at 24V.
PLUGGABLE CONNECTORS
All I/Os connect to heavy-duty 3.5mm pitch pluggable screw terminal connectors rated at 8A, accepting wire gauges from 26 to 16 AWG. Connectors can be unplugged from the board for convenient field wiring and debugging without disturbing the rest of the installation.
SELECTING THE UNIVERSAL INPUTS
The default setting of the Universal Inputs is 0-10V. In order to change it:
- Make sure you have the latest software installed, instructions in the readme
- Run the command "megabas 0 incfgwr <channel> <value>", where
-
- channel = 1-8
- value = 0 for 0-10V, 1 for 1K Thermistor, 2 for 10K Thermistor
- value = 1 for Dry contact/Counter
For more info on the commands type "megabas -h incfgwr" and "megabas -h incfgrd"
FIELD CALIBRATION
All the analog inputs and outputs are calibrated at the factory, but firmware commands permit the user to re-calibrate the board, or to calibrate it to better precision. All inputs and outputs are calibrated in two points; select the two points as close to possible to the two ends of scale. To calibrate the inputs, the user must provide analog signals. (Example: to calibrate 0-10V inputs, the user must provide a 10V adjustable power supply). To calibrate the outputs, the user must issue a command to set the output to a desired value, measure the result and issue the calibration command to store the value. Calibration process can be done using command line interface provided, type "megabas -h" for a complete list of command options
COMMUNICATION INTERFACES
The Building Automation HAT includes a standard RS-485 transceiver that can be accessed either by the onboard processor or by the Raspberry Pi. The operating mode is configured using the TX and RX switches on the SW1 DIP switch.
When TX and RX are set to ON, the Raspberry Pi communicates directly with any device that has an RS-485 interface. In this mode the card functions as a passive bridge, implementing only the hardware signal levels required by the RS-485 protocol. To use this configuration, the onboard processor must first release control of the RS-485 bus:
~$ megabas 0 rs485wr 0 0 0 0 0
When TX and RX are set to OFF, the card operates as a MODBUS RTU slave. Any MODBUS master — PLC, SCADA, or HMI — can read all inputs and control all outputs using standard MODBUS commands, with no Raspberry Pi required. A full list of supported MODBUS registers is available on GitHub.
In both modes, the onboard processor must be configured to either release or control the RS-485 signals accordingly. Refer to the command-line help for further details.
The Building Automation HAT includes a standard 1-Wire bus for connecting digital temperature sensors. Up to 16 DS18B20 sensors can be connected in parallel on a single two-wire cable, covering large areas such as multi-zone HVAC systems or distributed monitoring installations. Sensors are accessible from the command line, Python scripts, Node-RED, and the MODBUS interface, making integration straightforward regardless of your software environment.
HARDWARE WATCHDOG
The Building Automation HAT includes a hardware watchdog that ensures your system automatically recovers if the Raspberry Pi software becomes unresponsive. The watchdog is disabled at power-up and activates after it receives the first reset command from the Raspberry Pi.
The default timeout is 120 seconds. Once active, if the Raspberry Pi does not issue a reset command before the timeout expires, the watchdog cuts power to the system and restores it after 10 seconds. Two independent timeout periods can be configured: the initial period, which allows sufficient time for the Raspberry Pi to boot and start the application, and the running period, which is the normal operating timeout. Both are configurable from the command line. The number of watchdog-triggered resets is stored in non-volatile flash and can be read or cleared at any time.
For a full list of watchdog commands, run: megabas -h
COMPATIBILITY
The Building Automation HAT communicates with the Raspberry Pi over I2C, using only two GPIO pins regardless of how many cards are stacked. The remaining 24 GPIO pins remain fully available for other purposes. Up to 8 cards of each type can be stacked on a single Raspberry Pi, and different Sequent HATs can be freely mixed in the same stack with virtually no upper limit on total I/O. Compatible with all Raspberry Pi versions from Zero to 5.
FIRMWARE UPDATE
The onboard microcontroller firmware can be updated in the field. The update tool downloads the latest firmware from Sequent Microsystems' servers and flashes it to the board over I2C.
|
WARNING: Stop all processes that access the card (Node-RED flows, Python scripts, cron jobs) before starting a firmware update. Accessing the card during an update may corrupt the firmware. |
Running the Update
~$ cd ~/megabas-rpi/update/
~/megabas-rpi/update$ ./update <id>
Replace <id> with the board stack address (0-7). Full instructions including recovery procedures are available at:
https://github.com/SequentMicrosystems/megabas-rpi/tree/master/update/README.md
DOWNLOADS
| User’s Guide (PDF) | Schematics (PDF) | CAD | GitHub Repository |
|---|---|---|---|
| User's Guide V3 | Schematic V3.0 | 2D CAD drawing | Command Line |
| User's Guide V4 | Schematic V4.1 | 3D STEP Model | Python Library |
| Schematic V5.1 | Node-Red nodes | ||
| MODBUS interface | |||
| CODESYS driver | |||
| Home Assistant Integration | |||
WHAT'S INCLUDED
When you purchase the Building Automation Card you will receive the following items:
1. Building Automation Card for Raspberry Pi

2. Mounting hardware
- Four M2.5x18mm male-female brass standoffs
- Four M2.5x5mm brass screws
- Four M2.5 brass nuts

4. All required connector plugs
-
Four 8-pin female mating connector plugs for IO's.
-
One 5-pin female mating connector plug for RS485 and 1-Wire.
-
One 2-pin female mating connector plug for power.

QUICK START
- Plug your card on top of your Raspberry Pi and power up the system
- Enable I2C communication on Raspberry Pi using raspi-config.
- Install the software from github.com:
-
- ~$ git clone https://github.com/SequentMicrosystems/megabas-rpi.git
- ~$ cd /home/pi/megabas-rpi
- ~/megabas-rpi$ sudo make install
- ~/megabas-rpi$ megabas
The program will respond with a list of available commands.
Expand Your System
-
In stockEight Relays 4A/120V 8-Layer Stackable HAT for Raspberry Pi
Eight Relays 4A/120VAC, 24VDC N.O./N.C. contacts and LED indicators; RS485 Port. -
In stockRTD Data Acquisition 8-Layer Stackable HAT for Raspberry Pi
Eight Channel RTD Data Aquisition HAT; 0.01% accuracy through calibration; PT100/1000 Sensors; RS485/MODBUS, Watchdog. -
In stockSixteen LV Digital Inputs 8-Layer Stackable HAT for Raspberry Pi
Sixteen 3V-24V Opto-isolated Inputs with LED indicators; RS485/MODBUS, Hardware Watchdog. -
In stockSmart Fan HAT the Best Cooling Solution for Raspberry Pi
PWM controlled 40x40x10mm Fan keeps Raspberry Pi temperature constant; Stackable with any other HAT.







