
Piswitcher plus board
FibStack/pi-switcher-plus
The FibStack PiSwitcher Plus board was designed to help you in your next automation project.

A modbus RTU relay board with 3 relays for the CNC. This uses the ASX framework
Relay is an open-source printed circuit board by adarwoo, from the adarwoo/modbus_relay repository on GitHub. It is a 2-layer board of 45 × 72 mm with 43 parts on 37 nets, routed with 176 tracks and 17 vias.
It is built around the ATTINY824-SSU, LM1117MP-5.0 and IRLML0030. Its parts include 10 capacitors, 9 resistors, 6 diodes, 4 connectors and 3 ICs. It belongs with the home automation and IoT boards and the AVR (ATmega, ATtiny) boards of this library.
This project is a fully working MODBUS RTU Relay. The project comes with schematic and PCB, as well as the firmware of course!
The core of the relay is an AVR Tiny1624, an automotive grade MPU designed for harsh environment. Note: The code optimized with -Os is <16KB. The -Og used typically for debug is <32k. Therefore, for debugging, a 3224 device is required. Remembed to edit the makefile to specify your device.
This project can be reused for other Modbus devices. A modbus interface generator is provided that makes adding modbus commands simple. The generator reads from a Python configuration file.
Example of such configuration file:
"device@44": [
(READ_COILS, u16(0, 2, alias="addr"),
u16(1, 3, alias="qty"),
"on_read_coils"),
(WRITE_SINGLE_COIL, u16(0, 2, alias="addr"),
u16([0xFF00, 0, 0x5500], alias="op"),
"on_set_single"),
(WRITE_MULTIPLE_COILS, u16(0, alias="from"),
u16(3, alias="qty"),
u8(1, alias="count"),
u8(0, 7, alias="values"),
"on_set_multiple"),
(READ_HOLDING_REGISTERS, u16(0, 2), u16(1, 3), "on_read_info"),
]The handling code is just as simple:
void on_read_info(uint8_t index, uint8_t qty) {
Datagram::pack<uint8_t>(qty*2);
while ( qty-- ) {
switch(index++) {
case 0: Datagram::pack( DEVICE_ID ); break;
case 1: Datagram::pack( HW_VERSION ); break;
case 2: Datagram::pack( FW_VERSION ); break;
default:
Datagram::reply_error(modbus::error_t::illegal_data_value);
}
}
}
Solder side of the board
Out of the box, the relay supports the following modbus commands:
If compiling using the supplied Dockerfile, the elf is 7KB in size, so a ATTiny824 will work.
The device default address is 44 (Decimal). By default, it runs at 115200 8E1.
KiCAD schematic and PCB are available.
Tested with QModMaster.
I plan to add address and serial configuration modbus command (and eeprom persistence).
You will need a Linux shell, or WSL shell in Windows. The tool 'gitman' is required as well as Docker. (docker-ce or else).
# Clone this repo
$ git clone https://https://github.com/adarwoo/modbus_relay.git
$ cd modbus_relay
# Optional - install gitman
$ pipx install gitman
$ gitman update
$ make NDEBUG=1 # Optional, add ARCH=attiny1624 to suit you deviceThe binary modbus_relay.elf can be found in the directory
The Modbus Relay Device is a configurable relay controller with Modbus RTU communication. This document describes how to configure and operate the device, including its default settings, configuration mode, and reset process.
The relay comes pre-configured with the following value:
| Configuration | Default value | Explanation |
|---|---|---|
| Slave ID | 0x44 | The device address is 44 (decimal) by default |
| Baud rate | 9600 | The device talks at 9600 by default |
| Serial setup | 8N1 | 8bits, no parity and 1 stop bit |
| Watchdog | 0 (off) | The watchdog feature is off by default |
If the relay is un-responsive, it may have been mis-configured. The relay can be reset to it's factory default using the following procedure.
| Field | Value | Explanation |
|---|---|---|
| Slave ID | 0x00 | Broadcast address. |
| Function Code | 0x10 | Write multiple holding registers. |
| Start Address | 0x0063 | Address of the reset register (40100) |
| Quantity | 0x0002 | Writing 2 registers (32-bit number). |
| Byte Count | 0x04 | 4 bytes of data to follow. |
| Data | 0xDEAD 0x5AFE | MSW = 0xDEAD, LSW = 0x5AFE. |
| CRC | 0xBAE7 | CRC |
44 (0x2C).In normal mode:
0x0000 to 0x0002 for Relay 0, Relay 1, and Relay 2.0xFF00 to turn on, 0x0000 to turn off, and 0x5500 to toggle a relay.0x0000 (40001): Product ID (0x3701).0x0001 (40002): Device Hardware Version (0xMMmm, where MM = major, mm = minor).0x0002 (40003): Software Version (0xMMmm, where MM = major, mm = minor).0x0008 (40009): Device address0x0009 (40010): Baud rate selection (1/100th of the actual baud rate)0x000A (40011): Parity. 0=None, 1=Odd, 2=Even0x000B (40012): Number of stop bits. 1=1 stop bit, 2=2 stop bits0x000C (40013): Watchdog window size in seconds0x0010 (40017 + 40019): Number of minutes in operation as a 32-bits0x0014 (40019 + 40020): Number of relay 0 movements as a 32-bits0x001A (40021 + 40022): Number of relay 1 movements as a 32-bits0x001C (40023 + 40024): Number of relay 2 movements as a 32-bitsThe factory default communication settings for the relay are:
These can be accessed with a write single register command or the serial settings can be set with 1 write multiple command.
| Register Address | Function | Values/Description | Factory Default |
|---|---|---|---|
| 40009 (0x0008) | Device ID | 1 to 247 | 44 |
| 40010 (0x0009) | 1/100th of the baud Rate | 12, 24, 48, 96, 192, 384, 576, 1152 | 96 |
| 40011 (0x0010) | Parity | 0 = None, 1 = Odd, 2 = Even | 0 (None) |
| 40012 (0x0011) | Stop Bits | 1 or 2 | 1 |
| 40013 (0x0012) | Watchdog Timeout (seconds) | 0 = Disabled, 1->65535 | 0 |
Note: When writting the configuration with a multiple write, all 5 settings must be written in the same transaction.
The register at 0x63 (40100) can be written with 0xDEAD5AFE to reset the device remotely. This is usefull to apply any changes made to the settings. The command will reply, and the leds will flash fast for 2 seconds, then solid (the device is booting).
The relay has a command watchdog which will release the relays following a period of inactivity. Everytime a valid modbus command is received (including holding register read etc.), the watchdog is reset. This feature allow for the relays to be atomatically releases if the master was to fail. The period is given in seconds. A value of zero (default) turns off the feature.
0) to reset the device via the reset register.| Qty | Value | Footprint | References |
|---|---|---|---|
| 4 | 100n | Capacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolder | C4, C5, C6, C7 |
| 3 | 10k | Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolder | R10, R11, R12 |
| 3 | 1J | Diode_SMD:D_SMA | D1, D2, D3 |
| 3 | 1u | Capacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolder | C8, C9, C10 |
| 3 | 22 | Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolder | R4, R5, R6 |
| 3 | 471K | Varistor:RV_Disc_D9mm_W3.3mm_P5mm | RV1, RV2, RV3 |
| 3 | 680 | Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolder | R7, R8, R9 |
| 3 | G | LED_THT:LED_D3.0mm | D4, D5, D6 |
| 3 | IRLML0030 | Package_TO_SOT_SMD:SOT-23 | Q1, Q2, Q3 |
| 3 | Relay_SPDT | Relay_THT:Relay_SPDT_Omron_G2RL-1-E | K1, K2, K3 |
| 2 | 10u | Capacitor_Tantalum_SMD:CP_EIA-6032-28_Kemet-C | C1, C2 |
| 1 | 4u7 | Capacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolder | C3 |
| 1 | 62R | Adarwoo:Murata_NFM61R | FL1 |
| 1 | ATtiny824-SS | Package_SO:SOIC-14_3.9x8.7mm_P1.27mm | U2 |
| 1 | AVR-UPDI-6 | Connector_PinHeader_2.54mm:PinHeader_2x03_P2.54mm_Vertical | J3 |
| 1 | LM1117MP-5.0 | Package_TO_SOT_SMD:SOT-223-3_TabPin2 | U1 |
| 1 | LOGO | LOGO | G*** |
| 1 | LT1785AxS8 | Package_SO:SOIC-8_3.9x4.9mm_P1.27mm | U3 |
| 1 | Screw_Terminal_01x02 | Connector_Phoenix_MC:PhoenixContact_MCV_1,5_2-G-3.81_1x02_P3.81mm_Vertical | J5 |
| 1 | Screw_Terminal_01x03 | Connector_Phoenix_MC:PhoenixContact_MCV_1,5_3-G-3.81_1x03_P3.81mm_Vertical | J4 |
| 1 | ~ | TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-4_1x04_P5.00mm_Horizontal | J2 |

FibStack/pi-switcher-plus
The FibStack PiSwitcher Plus board was designed to help you in your next automation project.


NYDEREK/LineFollower_GRUZIK2.0-light
GRUZIK2.0 is simple light construction made for "line follower light" competition

SherpaModular/RawWaves
Raw Waves is a eurorack synthesizer module that plays RAW or WAV sample files from a micro SDcard. It is a derivate work of "Radio Music" from Tom Whitwell. Raw Waves is released under a CC-by-SA 3.0 license.

aNThiCu/AirsoftETU
The code for a airsoft MOSFET board that includes the trigger , active break mode and semi-auto,full-auto detection.

imad-drs/mini_encabulator_PCB
A complete PCB design exercise demonstrating schematic capture, component selection, and board layout using KiCAD. This project implements a simple LED blinker with user-controllable blink rate.

chithigun23/ANUFS-BSPD-2026
ANUFS's BSPD for 2026 Formula SAE ICE Car. The goal of this project is to be AEC-Q100/Q101/Q200 compliant.

KenwoodFox/SuperGauge
This repo contains all the firmware and hardware for the SuperGauge.
It measures 45 × 72 mm and has 2 copper layers, 1.6 mm thick.
43 parts, built around the ATTINY824-SSU, LM1117MP-5.0 and IRLML0030. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
From the adarwoo/modbus_relay repository on GitHub, at the commit this page was made from: the board is hw/relay.kicad_pcb and its schematic hw/relay.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Its repository states no licence, so its author keeps all rights: ask adarwoo before reusing the design.