The Senbrix logo, mark of the Raspberry Pi PLC development environment

Part 2 is the Raspberry Pi side. Flash the OS, install the runtime, then register the Pi-SD16R board in the editor.

What you need

ItemDetail
BoardsRaspberry Pi 5, Pi-SD16R carrier board
StoragemicroSD card (16 GB or more) and a card reader
PowerDC 12 to 24 V adapter
PCThe Windows PC from Part 1 with the editor installed, on the same network as the Pi
SoftwareRaspberry Pi Imager, PuTTY

The Pi-SD16R board

A carrier board that sits on the Pi’s 40-pin header. It powers the Pi and gives you 4 isolated inputs, 4 relay outputs and one RS-485 channel.

Terminal layout and component placement of the Pi-SD16R board

ItemSpec
Power inputPOWER +/-, DC 12 to 24 V. An onboard 5 V regulator feeds the Pi
Digital inputs4 (IN1 to IN4, common IN_COM). Photocoupler isolated (2,500 Vrms), non-polar, DC 12 to 24 V
Relay outputs4 (OUT1 to OUT4, common OUT_COM). Form A, 5 A 250 VAC / 5 A 30 VDC
RS-4851 channel, half duplex, automatic direction control, up to 500 kbps. Terminals 485+, 485-, GND
IndicatorsPOWER, 4 inputs, 4 outputs, RS-485 TX/RX LEDs
OtherVDD terminal outputs the input supply (for sensor power). POWER_SW switches power to the Pi on and off

GPIO pin map

The Raspberry Pi 40-pin header section of the Pi-SD16R schematic

SlotGPIO (BCM)Header pinSlotGPIO (BCM)Header pin
IN1GPIO2038OUT1GPIO529
IN2GPIO2140OUT2GPIO631
IN3GPIO2215OUT3GPIO1232
IN4GPIO2316OUT4GPIO1333

RS-485 uses UART0 (GPIO14/15). Inputs and outputs are both active high, so the XML needs no invert.

1. Flash Raspberry Pi OS

In Raspberry Pi Imager pick device Raspberry Pi 5, OS Raspberry Pi OS Lite (64-bit), storage the microSD card.

Raspberry Pi Imager with Raspberry Pi OS Lite 64-bit selected

Fill in the customisation settings:

ItemValue
Hostnamesenbrix
Userpi / raspberry. Use a different password on real equipment
Wi-FiSSID and password. Skip it on wired
Remote accessTurn on SSH, password authentication

When the write finishes, the completion screen lists the settings that were applied.

The write complete screen listing the five applied settings

2. Boot and connect over SSH

Insert the microSD, seat the Pi-SD16R on the 40-pin header, and feed power into the POWER terminals. First boot takes two to three minutes.

Connect to senbrix.local with PuTTY. If it does not resolve, look up the IP on your router.

ping senbrix.local

Log in as pi with the password you set in Imager.

3. Install the runtime

curl -sSL https://raw.githubusercontent.com/going-kr/Release.Senbrix/master/install-runtime.sh | sudo bash

Running the runtime install one-liner until the service starts

At the CAN expansion board question, just press Enter. When you see Active: active (running) at the end, you are done. It starts on every boot from now on.

systemctl status senbrix-runtime
journalctl -u senbrix-runtime -f
  • Update: run the same command again
  • Firewall: open 5557/tcp, 5555/tcp, 5353/udp

4. New project and device check

On the editor start screen click New Project. Name it Test, keep the default location, and pick Ladder Diagram + C# as the project type. Click Create and the project screen opens. You will use this project through Part 3.

The new project dialog with name, location and project type

Click the connection icon at the bottom of the editor and the Connect Device dialog lists senbrix. If it does not, type the IP in directly.

The device connection dialog listing senbrix at 192.168.0.34

Click Connect and the status bar shows the IP and state.

The status bar showing 192.168.0.34 (IDLE)

5. Register the Pi-SD16R main board XML

Open the main board definitions folder.

explorer %LocalAppData%\Going\Senbrix\MainBoards

Create Pi-SD16R.xml.

<MainBoard name="Pi-SD16R" version="1">
  <Pin gpio="20" slot="IN1"  direction="In"/>
  <Pin gpio="21" slot="IN2"  direction="In"/>
  <Pin gpio="22" slot="IN3"  direction="In"/>
  <Pin gpio="23" slot="IN4"  direction="In"/>
  <Pin gpio="5"  slot="OUT1" direction="Out"/>
  <Pin gpio="6"  slot="OUT2" direction="Out"/>
  <Pin gpio="12" slot="OUT3" direction="Out"/>
  <Pin gpio="13" slot="OUT4" direction="Out"/>
</MainBoard>
AttributeMeaning
gpioBCM number. No duplicates
slotIN<n> / OUT<n>
directionIn / Out
pull, invertInput pull-up/down, active-low inversion. Not needed for the Pi-SD16R

On the project screen, click Assign Main Board in the Board panel on the right and pick Pi-SD16R from the Select Main Board dialog. You can also skip the folder and pick the XML file directly with Browse.

Click OK and the board panel shows Main board · Pi-SD16R, with inputs bound to P1 to P4 and outputs to P5 to P8. Change that under I/O Mapping if you need to.

The board panel showing main board Pi-SD16R with inputs P1-P4 and outputs P5-P8

Next

Part 3 has AI write a small control program, deploys it to the Pi, and moves the relays.