Smart Relays with Universal Inputs 8-Layer Stackable HAT for Raspberry Pi
10A/240V Relays with load current sense; 5V/10-24V power; Analog and digital inputs; RS485/MODBUS; Hardware Watchdog.
Overview
Relay control and universal input hardware for Raspberry Pi for mission-critical home and industrial automation. The Smart Relays with Universal Inputs HAT combines four HALL-effect current-sensing relay outputs with four universal inputs that read either 10K thermistor temperature or dry-contact/opto-isolated digital signals, in a compact, stackable platform.
- Four relay outputs with HALL-effect current sensing, switching up to 8A at 240VAC or 24VDC
- Monitor load failure, compute load power, and limit load current from 1 to 8A
- Four universal inputs reading 10K thermistor temperature, or dry-contact/24V opto-isolated digital signals
- Extended input functions: transition counters, PPS counters, quadrature encoders, and PWM reading
- RS485/MODBUS interface — card controllable without Raspberry Pi
- Up to 8 cards stackable (32 relays + 32 inputs per Raspberry Pi)
- Works with any Raspberry Pi from Zero to 5
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 |
|---|---|---|
| • Four Relay Outputs NO/NC, 8A/240VAC or 24VDC, with HALL-effect current sensing | • I2C Port to Raspberry Pi | • Command Line |
| • Four Universal Inputs — 10K thermistor (analog) or dry-contact/24V opto-isolated (digital) | • RS485/MODBUS Port | • Python Library |
| • Node-RED nodes | ||
| • OpenPLC Module | ||
| • Home Assistant | ||
| • Arduino Library | ||
| Other Features | ||
| • Transition counters to 4kHz on all inputs | ||
| • Input counters with cumulative or PPS (pulse per second) reading up to 4kHz | ||
| • 2× Quadrature encoder inputs reading up to 4000 PPS | ||
| • PWM inputs reading fill factor and frequency | • Pluggable Connectors 30–16 AWG wires | |
| • Raspberry Pi reset push button | • On Board Hardware Watchdog and fuse | |
| • Status LEDs on all relay and input channels | • Eight Level Stackable | |
DESCRIPTION
The Smart Relays with Universal Inputs HAT is the ideal solution for mission-critical projects where you must be 100% sure that your system works as expected, combining current-monitored relay switching with flexible input reading for Raspberry Pi.
Four NO/NC relay contacts switch loads up to 8A at 240VAC or 24VDC. HALL-effect sensors on every relay monitor load current in real time, so you can confirm the load operates within specification, compute load power, and limit the load current to any value from 1 to 8A.
Four universal inputs read temperature from 10K thermistors, or accept dry-contact and opto-isolated 0-24V digital signals — giving each channel flexibility for both analog sensing and digital signal reading.
All input channels support transition counters to 4kHz, cumulative and PPS input counting, 2× quadrature encoder decoding up to 4000 PPS, and PWM input reading (fill factor and frequency).
Standard RS485 transceiver allows the Raspberry Pi to communicate using any protocol, including MODBUS, PROFIBUS, or camera PTZ control. The transceiver can be driven either from the Raspberry Pi serial port or directly from the local processor.
A momentary pushbutton at the board edge signals the Raspberry Pi via GPIO26 (pin 37) for a clean software shutdown — no monitor, keyboard, or mouse needed.
The hardware watchdog automatically power-cycles the Raspberry Pi if the software becomes unresponsive, ensuring reliable operation in unattended deployments.
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. Cards of different Sequent HAT types can be freely mixed in the same stack.
| Switch | Name | Function |
|---|---|---|
| TERM | RS485 termination | Enable on the last card in an RS485 chain to prevent signal reflections |
| TX | RS485 TX select | ON: Raspberry Pi drives RS485 directly |
| RX | RS485 RX select | ON: Raspberry Pi receives RS485 directly |
| ID2 | Stack ID bit 2 | Binary stack address bit 2 (MSB) |
| ID1 | Stack ID bit 1 | Binary stack address bit 1 |
| ID0 | Stack ID bit 0 | Binary stack address bit 0 (LSB) — sets card level 0–7 |
ELECTRICAL SPECIFICATIONS
| Power | |
|---|---|
| Power supply | 5V / 8A pluggable connector |
| Onboard resettable fuse | 3 A |
| Relay Outputs | |
|---|---|
| Contact rating | 8A / 240VAC or 24VDC |
| Contact types | NO and NC |
| Current sensing / limiting range | 1 A – 8 A |
| Opto-Isolated Digital Inputs | |
|---|---|
| Input Forward Current | Typical 5 mA, maximum 50 mA |
| Low Voltage Input Series Resistor | 2.2 KΩ |
| High Voltage Input Series Resistor | 120 KΩ |
| Isolation Resistance | Minimum 1012 Ω |
POWER REQUIREMENTS
Power supply: The card operates from a 5V or 10-24V power supply. In both cases it provides 5V and up to 5A to the Raspberry Pi. Relay coils are also powered from 5V. The card draws less than 50mA with all relays off; each relay requires approximately 80mA to turn on.
COMMUNICATION INTERFACES
RELAY SELF TEST
The card can be tested before installation by running a simple command from the command line. The card will cycle each relay on and off at 0.5 second intervals. The clacking noise of the relays and the lighting of the LEDs will assure that all relays are functioning.
EXTENDED INPUT FUNCTIONS
The card's local processor enables the following extended input capabilities on all channels:
- Transition counters to 4kHz on all inputs
- Input counters with cumulative or PPS (pulse per second) reading up to 4kHz
- 2× Quadrature encoder inputs reading up to 4000 PPS
- PWM inputs on each channel, reading both the fill factor and the frequency
- 1% resolution on PWM inputs up to 100Hz, 5% resolution up to 500Hz
CURRENT SENSING & LOAD MONITORING
HALL-effect sensors on each relay output continuously monitor the load current. This lets you confirm the load is operating within its specified parameters, compute the load power, and limit the load current to any value from 1 to 8A — useful for detecting load failure or protecting downstream equipment from overcurrent conditions.
HARDWARE WATCHDOG
The Smart Relays with Universal Inputs 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.
| Watchdog Parameters | |
|---|---|
| Initial timeout period | Configurable — allows time for Raspberry Pi to boot and start the application |
| Running timeout period | Configurable — normal operating timeout |
| Off period | Configurable — duration the Raspberry Pi power is cut when timeout triggers |
| Reset counter | Stored in non-volatile flash; can be read or cleared at any time |
For a full list of watchdog commands, run: 4rel4in -h
COMPATIBILITY
| Interface | I2C |
| I2C address range | 0x0e – 0x15 |
| GPIO used | GPIO2 (SDA), GPIO3 (SCL) — 2 pins only; remaining GPIO pins stay free |
| Max stack | 8 cards of each type; different Sequent HATs can be freely mixed with virtually no upper limit on total I/O |
| Compatible with | All Raspberry Pi versions from Zero to 5 (40-pin GPIO header) |
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.
Running the Update
~$ cd ~/4rel4in-rpi/update/
~/4rel4in-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/4rel4in-rpi/tree/main/update/README.md
DOWNLOADS
| User's Guide (PDF) | Schematics (PDF) | CAD | Software & Integrations |
|---|---|---|---|
| User's Guide | Schematic V2.0 | 3D STEP Model | Command Line |
| 3D Printing Enclosure | Python Library | ||
| Node-RED Nodes | |||
| Arduino Library | |||
| Home Assistant |
WHAT'S INCLUDED
When you purchase the card you will receive the following items:
| 1. Smart Relays with Universal Inputs Card for Raspberry Pi |
|---|
![]() |
| 2. Mounting Hardware | |
|---|---|
![]() |
|
| 3. Mating Connector Plugs | |
|---|---|
![]() |
|
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:
~$ git clone https://github.com/SequentMicrosystems/4rel4in-rpi.git~$ cd /home/pi/4rel4in-rpi~/4rel4in-rpi$ sudo make install~/4rel4in-rpi$ 4rel4in
The program will respond with a list of available commands. To read more about the cli, please refer to the README file. If you would rather use a different platform, you can access the same functionality through dedicated, ready-to-use integrations in the Downloads tab above.
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.









