Use FREE-SHIPPING discount code for all US orders over $15

Building Automation V4 8-Layer Stackable HAT for Raspberry Pi

SKU: SM-I-002

Regular price $95.00


  • Building Automation V4 8-Layer Stackable HAT for Raspberry Pi
  • Eight Level Stackable
  • Works with any Raspberry Pi from  ZERO to 5
  • Eight Universal Inputs:
    • 1K or 10K thermistors,
    • 0-10V analog inputs, 500Hz sample rate
    • Dry contact/counter inputs;
  • Four AC TRIAC Outputs, 1A/24VAC
  • Four 0-10V Outputs
  • 1-Wire interface
  • Four General Purpose LEDs
  • 24VAC or DC Power Supply
  • Real Time Clock with Battery Backup
  • On board Hardware Watchdog
  • TVS protection on all Inputs
  • DIP-Switch selection - no jumpers
  • Pluggable Connectors 26-16 AWG wires
  • Status LEDs on all Digital Inputs and Outputs
  • RS485/MODBUS Port with dual connectors
  • Uses only I2C port (address 0x48 to 0x4f), all GPIO pins available
  • ECCN Code EAR99
  • Building Automation Raspberry Pi
  • All mounting hardware included: stand-offs, screws and nuts
  • Open source hardware and schematics
  • Command line
  • Python Library
  • Node-Red nodes
  • CODESYS driver
  • OpenPLC module



Brings to Raspberry Pi all IO's needed for Building Automation Systems. Eight universal inputs can be jumper selected to process 0-10V signals, read 1K or 10K temperature sensors or dry contact counters. Four TRIAC outputs can drive loads up to 1A at 24VAC. Four 0-10V outputs can control light dimmers. Status LEDs display the state of all outputs. Keep time indefinitely even during power failure using the Real Time Clock with battery backup. Connect up to 16 DS18B20 temperature measurement devices on the 1-Wire interface. Activate the hardware watchdog to monitor and power cycle the Raspberry Pi in case of software lockup. TVS diodes on all inputs protect the card for external ESD, and the on-board resettable fuse protects is from accidental shorts.


Heavy loads of up to 8A and 250VAC can be driven adding one or more 4-RELAYS cards. High DC loads of up to 10A and 250V, with fast response time and unlimited endurance can he driven by adding one or more 8-MOSFET cards.


Version 4 of the Building Automation HAT has also a standard 1-Wire interface. Up to 16 DS18B20 temperature measurement devices can be connected in parallel. Devices can be accessed from the command line of from the MODBUS interface.


The Building Automation Cards share the I2C bus using only two of the Raspberry Pi’s GPIO pins to manage all eight cards. This feature leaves the remaining 24 GPIOs available for the user. The card is compatible with all Raspberry Pi versions from Zero to 5 and has all the necessary I/Os for your Building Automation projects.


The Building Automation card requires a 24VAC/1A external transformer to operate and has to be powered from it's own pluggable connector. The card supplies 5V and up to 3A to the Raspberry Pi on the GPIO bus. A local 3.3V regulator powers the rest of the circuitry. The card needs 50mA to operate.


All the IO's are connected to heavy duty (8A), 3.5mm pitch pluggable connectors which make field wiring very convenient for installation and debugging.


A six position DIP switch is used to select the source of the RS485 port and the position of the card in the stack, if multiple cards are used. 

DIP Switch for the Building Automation HAT


Up to eight Building Automation cards can be stacked on your Raspberry Pi. The three left positions of the DIP Switch are used to select the stack level.

Stack Level Selection


The Building Automation Card has an RS485 port which can be driven from the Raspberry Pi, or from the local processor. Leave the TX and RX switches in the OFF position to connect the port to the local processor. Set both to ON to connect to USART1 on the Raspberry Pi GPIO connector.

When DIP Switches are ON, Raspberry Pi can communicate with any device with an RS485 interface. In this configuration the card is a passive bridge which implements only the hardware levels required by the RS485 protocol. To use this configuration, you need to tell the local processor to release control of the RS485 bus:

~$ megabas [0]  rs485wr 0 0 0 0 0

When DIP Switches are OFF, the card operates as MODBUS slave and implements the MODBUS RTU protocol. Any MODBUS master can access all the card's inputs, and set all the outputs using standard MODBUS commands. A detailed list of commands implemented and parameters addresses can be found on GitHub:

In both configurations the local processor needs to be programmed to release (jumpers installed) or control (jumpers removed) the RS485 signals. See the command line online help for further information.


The last position on the DIP switch is the RS485 line terminator. Set it to ON if the card is last on the RS485 chain.


Building Automation Card Layout


  • 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: tbd
    • 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
    • Maximum Output Voltage: 120V


BAS Mechanical Dimensions


Building Automation Card Downloads



You can write your own application using the Command Line or Python Libraries provided. No programming is required if you use the Node-Red nodes provided. You can drag-and-drop the functional blocks to design your application. Examples are provided at GitHub. CODESYS drivers also provided.


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


The card contains a built-in hardware watchdog which will guarantee that your mission-critical project will recover and continue running even if Raspberry Pi software hangs up. After power up the watchdog is disabled, and becomes active after it receives the first reset or first period set.

The default timeout is 120 seconds. Once activated, if it does not receive a subsequent reset from Raspberry Pi within 2 minutes, the watchdog cuts the power and restores it after 10 seconds.

Raspberry Pi needs to issue a reset command on the I2C port before the timer on the watchdog expires. The timer period after power up and the active timer period can be set from the command line. The number of resets is stored in flash and can be accessed or cleared from the command line. All the watchdog commands are described by the online help function.


The card firmware can be updated in the field by running a command. The update is made with the latest firmware version located on our servers. More instructions about the process can be found on GitHub. Please make sure there is no process, like Node-Red or python scripts, that tries to access the card during the update process.



The Building Automation card can be installed parallel on a DIN-Rail using the DIN-Rail Kit Type 1, or perpendicular using the DIN-Rail Kit Type 2.


The Smart Fan provides a stackable cooling solution for Raspberry Pi. Its on-board processor powers the fan just enough to maintain the preset temperature of the Pi.


When you purchase the Building Automation Card you will receive the following items:

1. Building Automation Card for Raspberry Pi

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

Building Automation HAT brass hardware

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.

Connector Plugs for Building Automation HAT


  1. Plug your card on top of your Raspberry Pi and power up the system
  2. Enable I2C communication on Raspberry Pi using raspi-config.
  3. Install the software from
    • ~$ git clone
    • ~$ cd /home/pi/megabas-rpi
    • ~/megabas-rpi$ sudo make install
    • ~/megabas-rpi$ megabas
The program will respond with a list of available commands.

Customer Reviews

Based on 3 reviews
Chris Blair
Great Product and Superb Support

I'm building an RPi pool control system using Node-Red and other open sourced software. I had a new version that has dip switches instead of the jumpers and it's not yet reflected in the data sheet. So I got ready to email and have a few day delay. But I saw the chat window and put in a quick question. To my surprise they answered in minutes! Wow!! I'm not an electronics wiz, I'm more of a user that's tech savvy enough to get myself in trouble. I had heard these people had superb customer support but I also thought yeah, yeah, yeah... Boy was I wrong it's definitely YES, YES, YES! It's for real!!

Thank you folks, anytime I need something you sell this is where I'll come first.

Great board and even better support!

A fully featured board with all kinds of inputs/outputs. I had an issue with mine, and reached out to support who responded and resolved my issue within an hour. I will be buying more from this company in the future!

Jack Anderson
Very Versatile IO Board

I am using this board to design and build a replacement heating control system. The board is extremely versatile providing a great many different inputs and outputs. I am using the 0-10V to control the output from a gas boiler (in the UK) and for pump speed control. I haven't found any other board that provides 0-10V outputs. I also use the universal inputs with thermistors for temperature measurement. I'm planning to use the 1-wire interface but haven't tried it yet. This board is readily combined with some of the relay boards to provide everything I need to interface to a Raspberry Pi.

The software provided is excellent and it is very straightforward to control all the outputs and read all the inputs using Python.

Just like the other boards that I have tried in the Sequent range the build quality is superb and I can highly recommend this Building Automation HAT. It is excellent value even if you don't require all the options.

Notify Me When Available

Fill in the required details to get notified when the product is again in stock!