CURRENT MODEL · STM32 UART I/O

PiBot STM32 I/O Expander V5 Complete Manual

A detailed installation and configuration guide for adding 18 numbered I/O channels to a compatible FluidNC controller, with a downstream RJ12 path for a PiBot pendant.

8 optocoupler inputs10 outputsDual RX/TX jumpers1,000,000 baudFluidNCgrblHAL plugin
PiBot STM32 I/O Expander V5
OverviewPinMap 1–11Controller wiringRX/TX jumpersFluidNC YAMLOutput testFirmwareSize & downloads
Use this page for Expander V5. V4/V4.1 has different input circuits and RX/TX handling. Turn off the controller, VMOT, External V and pendant battery before changing cables, jumpers or loads. The expander is not a substitute for a hard-wired emergency stop.

1. Product overview and package contents

What V5 adds

  • Eight optocoupler inputs instead of the mixed V4 input arrangement.
  • Six buffered 5 V digital/PWM outputs, two more than V4.
  • Two onboard normally-open PhotoMOS relay outputs with indicator LEDs.
  • Two External-V MOSFET outputs for low-voltage DC loads.
  • Independent RX/TX swap jumpers on both the mainboard and pendant sides.
  • Dedicated RJ12 sockets for the controller and downstream pendant.

Included in every package

  • Expander V5 main unit × 1
  • Adapter for PiBot 4.x controller × 1
  • RJ12 communication cable × 1

The 4.x adapter is used with V4.96 Pro and V4.7B. V5.88 Ultra and V5.77 Carrier use the documented direct RJ12 connection.

2. Before installation

Prepare

  • Compatible PiBot FluidNC controller
  • Supplied RJ12 cable and 4.x adapter when required
  • Small insulated screwdriver
  • Computer with FluidNC WebUI or FluidTerm
  • Multimeter for wiring checks

Disconnect first

  • Spindle and laser enable circuits
  • Pumps, valves, solenoids and relay coils
  • Every load on #8–#17
  • External V supply
  • Pendant battery and machine power

Confirm first

  • Controller model and revision
  • Active YAML filename
  • Correct UART GPIO pair
  • 5 V or 12/24 V sensor supply
  • Load voltage, current and safe off-state
Do not use an unverified telephone cable. An RJ12 plug fitting mechanically does not prove that its power, ground and UART conductors match the PiBot pinout.

3. PinMap and board callouts 1–11

Open the high-resolution PinMap and follow the numbered explanation below. FluidNC uses the blue/orange I/O numbers printed on this drawing; it does not use STM32 names such as PA4 or PB11.

PiBot STM32 I/O Expander V5 PinMap with callouts 1 through 11
Click for the original 3494 × 1734 PinMap. The left half shows supported switch/sensor wiring; the right half identifies the V5 connectors, jumpers and I/O numbers.
1

SW_VCC input-voltage jumper

Selects the field voltage used by all eight optocoupler inputs. Put the shunt on the 5 V side for 5 V devices and ordinary dry-contact wiring; put it on VMOT when the controller VMOT supply is 12 V or 24 V and the sensor is rated for that voltage.

Rule: one setting applies to the whole input bank. Power off before moving the shunt; never feed 12/24 V while it is in the 5 V position.
2

Inputs #0–#7

Eight optocoupler input channels for limit switches, probes, buttons and compatible 3-wire sensors. Each channel uses the board's SW_VCC, Signal and GND arrangement shown on the PinMap. Dry contacts switch SW_VCC to Signal; powered sensors must also use the correct GND/reference.

Rule: match the sensor type and voltage before connection. Configure these as uart_channel2.0 through .7, never as outputs.
3

From FluidNC Mainboard

This RJ12 socket is the controller-side entrance. It carries the documented PiBot power and UART path from a V5.88/V5.77 direct socket or through the supplied 4.x adapter for V4.96/V4.7B.

Rule: the controller cable goes here—not into To Pendant. Insert or remove it only with every related supply off.
4

Mainboard RX/TX swap jumpers

The two shunts select Group 1 or Group 2 for the UART pair coming from the controller. Start with Group 1, the default shown on the V5 PinMap. If power is present but communication fails after YAML/GPIO checks, power off and move both shunts together to Group 2.

Rule: both shunts must form one complete group. Do not change a power or GND pin while troubleshooting RX/TX.
5

Pendant RX/TX swap jumpers

A separate pair controls the downstream UART orientation to a Pendant V4.2 or compatible smart display. Start with Group 1. Evaluate Group 2 only when the expander itself works but the downstream device has no serial data.

Rule: use one RX/TX correction point in the complete chain; two swaps cancel each other.
6

STM32 ST-Link header

Recovery/programming header for 3V3, GND, SWDIO and SWCLK. It is used only when the normal preloaded firmware cannot be recovered through FluidTerm UART passthrough.

Rule: use 3.3 V logic, verify all four leads and disconnect controller RJ12, VMOT, External V and loads first.
7

To Pendant

Downstream RJ12 socket for a compatible PiBot pendant or smart display after the expander is already communicating with the controller. The expander remains first in the chain.

Rule: disconnect the Pendant V4.2 battery before wired use and set its wired firmware/baud correctly.
8

External V and MOSFET #16/#17

The separate External V input supplies the two MOSFET output channels. Their load voltage follows External V; it does not come from VMOT or SW_VCC. Use these only for low-voltage DC loads with correct polarity.

Documentation limit: maximum 24 V DC and 3 A per channel. Use suppression for inductive loads and follow the terminal labels on the PinMap.
9

Buffered 5 V outputs #8–#13

Six digital or PWM-capable 5 V signals buffered through the board's 74AHCT125 stage. Each is intended for a compatible logic, optocoupler, relay-module or driver input.

Rule: these are signal outputs, not load power. Do not connect a bare relay coil, pump, valve or other current load directly.
10

PhotoMOS relay outputs #14/#15

Two onboard normally-open solid-state switches with individual indicator LEDs. They are convenient for isolated low-voltage on/off control and are the channels used by the M7/M8/M9 example test in section 9.

Documentation limit: maximum 1 A per channel; for extra voltage margin stay at or below 24 V DC / 12 V AC. Never switch mains voltage.
11

Reserved output / voltage access

The lower output-only and voltage-access area is reserved for output use shown by the V5 PCB and schematic. It is not another general-purpose input and is not a substitute for the numbered #0–#17 terminals.

Rule: use only a clearly labeled point documented by PiBot. Do not treat an unlabeled pad as a power output.

4. I/O numbering and electrical working limits

#0–#7 · Inputs

Eight optocoupler inputs. SW_VCC selects 5 V or VMOT (12/24 V) for the complete bank.

#8–#13 · Logic/PWM

Six buffered 5 V signals. Connect to compatible logic inputs or an external driver stage.

#14–#15 · PhotoMOS

Two normally-open isolated switches with LEDs. Documentation limit: 1 A per channel, low voltage only.

#16–#17 · MOSFET

Two External-V DC outputs. Documentation limit: 24 V DC / 3 A per channel.

About these conservative limits: the GAQY211G2S relay component has a 40 V / 2.5 A absolute rating and the HYG017N04LS1C2 MOSFET has a 40 V device rating. Those numbers do not include the complete board, connector, trace, ambient-temperature and transient limits, so this Wiki intentionally publishes lower working values.

5. Connect a PiBot controller

ControllerUARTTXRXController-side pathConfiguration note
V5.88 UltraUART2GPIO.0GPIO.35Direct PiBot RJ12OLED is independent.
V5.77 CarrierUART2GPIO.0GPIO.35Direct PiBot RJ12Same expander mapping as V5.88; no separate GPIO.0 startup warning.
V4.96 ProUART2GPIO.27GPIO.25Supplied PiBot 4.x adapterDisable OLED/I2C using GPIO.25/27.
V4.7BUART2GPIO.27GPIO.25Supplied PiBot 4.x adapterDisable OLED/I2C using GPIO.25/27.
  1. Finish the controller's basic checklist before adding the expander.
  2. Turn off controller power, VMOT and External V; disconnect any pendant battery.
  3. Set SW_VCC for the planned 5 V or 12/24 V input devices.
  4. Connect the direct RJ12 socket or supplied 4.x adapter to From FluidNC Mainboard.
  5. Keep all external loads disconnected while configuring and testing the two SSR indicator LEDs.
  6. Upload the matching YAML block from section 7, select that configuration and complete section 9.

V5.88 Ultra → Expander V5 → Pendant

V5.88 Ultra connected through Expander V5 to Pendant V4.2
Direct RJ12 · UART2 TX GPIO.0 / RX GPIO.35

V5.77 Carrier → Expander V5 → Pendant

V5.77 Carrier connected through Expander V5 to Pendant V4.2
Direct RJ12 · UART2 TX GPIO.0 / RX GPIO.35

V4.96 Pro → 4.x Adapter → Expander V5

V4.96 Pro connected through adapter to Expander V5 and Pendant V4.2
Supplied adapter · TX GPIO.27 / RX GPIO.25 · disable OLED

V4.7B → 4.x Adapter → Expander V5

V4.7B connected through adapter to Expander V5 and Pendant V4.2
Supplied adapter · TX GPIO.27 / RX GPIO.25 · disable OLED

6. Set the two RX/TX jumper groups

Controller side · callout 4

Start with both shunts in Group 1, as shown on the PinMap. If the board is powered but the expander is not found, first confirm the active YAML, UART2, the correct controller GPIO pair and 1,000,000/8N1. Only then power off and move both shunts to Group 2.

Pendant side · callout 5

Leave Group 1 selected while testing the expander alone. After the expander passes, attach the pendant. If only the pendant lacks data, power off and evaluate Group 2 on this downstream jumper pair.

One correction point per serial path: Expander V5, Pendant V4.2 and RJ12 Adapter V4.2 have physical RX/TX selection, while current ESP3D firmware can also use Swap RX TX. Two swaps cancel each other. Never move 3V3, 5 V, VMOT, VCC or GND to solve an RX/TX problem.

7. FluidNC YAML for normal operation

Normal operating profile: 1,000,000 baud and "8N1". The 57,600/8E1 passthrough settings in section 12 are only for transferring STM32 firmware.

V5.88 Ultra / V5.77 Carrier

uart2:
  txd_pin: gpio.0
  rxd_pin: gpio.35
  baud: 1000000
  mode: "8N1"

uart_channel2:
  report_interval_ms: 75
  uart_num: 2

V4.96 Pro / V4.7B

# Disable OLED/I2C on GPIO.25 and GPIO.27.
uart2:
  txd_pin: gpio.27
  rxd_pin: gpio.25
  baud: 1000000
  mode: "8N1"

uart_channel2:
  report_interval_ms: 75
  uart_num: 2
  1. Download or back up the machine's current YAML before editing it.
  2. Add the matching uart2 and uart_channel2 blocks at the top level with correct indentation.
  3. For V4.96/V4.7B, remove or disable the OLED/I2C block using GPIO.25/27.
  4. Upload the edited YAML through FluidNC WebUI, select it with $Config/Filename=your-file.yaml if needed, then restart FluidNC.
  5. Read the configuration messages and correct any duplicate pin, indentation or UART error before connecting loads.

8. Assign expander channels to machine functions

The format is uart_channelN.pin. All four documented PiBot controllers use UART channel 2 for this connection, so their V5 examples use uart_channel2.

Input example

# Example inside an axis section
limit_neg_pin: uart_channel2.4:low

Use #0–#7 only. Add :low only when the real input circuit must be active-low.

SSR test example

coolant:
  mist_pin: uart_channel2.14
  flood_pin: uart_channel2.15

This top-level block is used by the formal output test in section 9.

Output example

# Example configurable output
user_outputs:
  digital0_pin: uart_channel2.8

Use only a function supported by the installed FluidNC version and a channel of the correct electrical type.

Configuration does not prove safe wiring. Confirm SW_VCC, External V, polarity, default state, voltage and current before connecting the real machine device.

9. Configure and test M7/M8 outputs

This is the first functional test after the UART connection is configured. It checks the controller-to-expander path and the two onboard SSR channels using only their indicator LEDs; no external load is required.

9.1 Add the test configuration

  1. Keep #14/#15 load terminals empty.
  2. Add the following coolant block at the top level of the active YAML.
  3. Upload/select the YAML and restart FluidNC.
  4. Confirm the configuration loads without an error.
coolant:
  mist_pin: uart_channel2.14
  flood_pin: uart_channel2.15
Where to look: the two yellow SSR indicator LEDs are beside the #14 and #15 relay areas identified by callout 10 on the V5 PinMap.

9.2 Send the commands

Open the FluidNC WebUI command box or FluidTerm and enter these commands one at a time:

M7
Expected: the indicator for SSR output #14 turns on.
M7 uses mist_pin.
M8
Expected: the indicator for SSR output #15 turns on.
M8 uses flood_pin; #14 may remain on until M9.
M9
Expected: both SSR indicators turn off.
M9 turns off coolant outputs.
PASS · Test completed
M7 lights #14, M8 lights #15 and M9 turns both indicators off. The UART path, V5 firmware and these two mapped outputs are responding.
FAIL · Do not connect a real load
Confirm the active YAML, controller-specific GPIO pair, 1,000,000/8N1, uart_channel2, the From Mainboard socket and one RX/TX swap point. For V4.96/V4.7B, also confirm OLED GPIO.25/27 is disabled.

10. Connect and verify inputs #0–#7

Dry-contact switch or button

  1. Power off and select 5 V at SW_VCC.
  2. Wire the contact between the documented SW_VCC and Signal terminals shown in the PinMap.
  3. Assign the matching uart_channel2.N input in a backup YAML.
  4. With machine motion disabled, operate the contact and confirm the FluidNC input changes state.

Powered 3-wire sensor

  1. Confirm the sensor's rated supply and output type from its own manual.
  2. Select 5 V or VMOT (12/24 V) before connecting it.
  3. Connect supply, GND/reference and Signal exactly as shown for that sensor.
  4. Test one sensor with motion disabled, correct polarity if required, then repeat for other channels.
Do not copy V4/V4.1 white-connector resistor instructions. V5 uses optocoupler circuits on all eight inputs. A sensor's common wire, output type and polarity must still match the V5 circuit.

11. Connect the three output groups

#8–#13 · Buffered 5 V

  • Digital or PWM-capable logic signals.
  • Connect Signal and GND to a compatible control input.
  • Use an external relay/driver module for a coil or higher-current load.
  • Measure the unloaded state before connecting the controlled device.

#14/#15 · PhotoMOS relay

  • Normally-open isolated low-voltage switches.
  • Each channel has a local state LED.
  • Documentation limit: 1 A/channel, at or below 24 V DC / 12 V AC for extra margin.
  • Do not use for mains voltage.

#16/#17 · External V MOSFET

  • For low-voltage DC loads only.
  • Supply comes from the separate External V terminal, not VMOT.
  • Documentation limit: 24 V DC / 3 A per channel.
  • Observe polarity and add suppression for inductive loads.
Inductive-load protection: relay coils, valves, contactors and pumps can produce destructive voltage when switched off. Fit the correct flyback diode, TVS or other suppression at the load, or use an appropriately rated external power driver.

12. STM32 firmware download and recovery

Normal case: Expander V5 is programmed before shipment with the common FluidNC STM32 I/O Expander firmware. If section 9 passes, do not reflash it.
Download common STM32 expander firmware
Use the controller-specific configuration on this page. V5.88/V5.77 and V4.96/V4.7B use different UART GPIO pairs. Do not reuse a V4/V4.1 example package for Expander V5.

Method A · FluidTerm UART passthrough

For recovery only, add the passthrough lines under the same controller UART:

uart2:
  txd_pin: gpio.0       # gpio.27 on V4.96/V4.7B
  rxd_pin: gpio.35      # gpio.25 on V4.96/V4.7B
  baud: 1000000
  mode: "8N1"
  passthrough_baud: 57600
  passthrough_mode: "8E1"

uart_channel2:
  report_interval_ms: 75
  uart_num: 2
Two different serial profiles are intentional: 1,000,000/8N1 is the normal expander link. FluidNC temporarily uses 57,600/8E1 only while the STM32 loader is reached through serial passthrough.
FluidTerm STM32 expander firmware upload
FluidTerm: press CTRL+S, choose the supplied firmware.bin and enter -W when requested.

Upload sequence

  1. Back up the working YAML and enable passthrough.
  2. Open FluidTerm and select the controller serial port.
  3. Press CTRL+S, choose the supplied STM32 firmware.bin and enter -W.
  4. Hold BOOT0, press and release RESET, then release BOOT0.
  5. Complete the transfer, reset normally, restore the normal YAML if desired and repeat section 9.

Method B · ST-Link recovery

ST-LinkExpander V5 headerCheck
3.3V3V3Never use 5 V on this header.
GNDGNDCommon reference.
SWDIOSWDVerify label before power.
SWCLKSWCVerify label before power.
  1. Disconnect controller RJ12, VMOT, External V and all loads.
  2. Connect the four verified 3.3 V ST-Link signals.
  3. Program only the PiBot-supplied common expander image.
  4. Disconnect the programmer, restore normal power and repeat section 9.

13. Connect Pendant V4.2 downstream

Pendant battery rule: move the Pendant V4.2 side switch down so its 18650 battery is electrically disconnected before inserting the RJ12 cable. Also turn off controller and machine power while changing the connection.
  1. Complete the expander's M7/M8/M9 test without the pendant.
  2. Power off and connect the pendant to To Pendant, not to the controller-side socket.
  3. Use the pendant firmware/settings for the documented 1,000,000-baud wired path.
  4. Start with the expander pendant-side jumpers in Group 1.
  5. Power on with motors, spindle and laser disabled; confirm both expander I/O and pendant data update.
  6. If only the pendant lacks data, power off and change exactly one downstream RX/TX correction point.
For battery, firmware, button mapping and safe function configuration, continue to the PiBot CNC Pendant V4.2 Complete Manual.

14. grblHAL support (advanced)

Current grblHAL sources include an experimental FluidNC I/O Expander plugin that uses the FluidNC Channel I/O protocol. It can expose up to eight digital inputs and ten outputs, including compile-time PWM-output support.

grblHAL miscellaneous pluginsFNC expander sourcegrblHAL changelog

15. Size, downloads and source documents

70 × 90 mmPCB outline
18 channels#0 through #17
UART2Documented PiBot path
1,000,000 / 8N1Normal FluidNC link

The dimension drawing includes the mounting-hole centres and edge offsets. Use the original drawing when designing an enclosure or mounting plate.

PiBot Expander V5 dimension drawing, 70 by 90 millimetres
Click for the original 70 × 90 mm dimension drawing.

16. Troubleshooting

No power or status indication

  • Power off immediately.
  • Disconnect pendant and every external load.
  • Verify the PiBot controller/adapter path and cable orientation.
  • Do not move power pins while troubleshooting serial direction.

Power present, no communication

  • Confirm active YAML, UART2, correct GPIO pair and 1,000,000/8N1.
  • Confirm the cable uses From FluidNC Mainboard.
  • For V4.96/V4.7B, disable OLED on GPIO.25/27.
  • Power off and change one mainboard-side RX/TX group.

SSR LEDs do not follow commands

  • Confirm coolant maps #14/#15.
  • Confirm uart_channel2 is the active channel.
  • Send M9, correct the YAML and repeat section 9.
  • Do not connect a load until the LED test passes.

Expander works, pendant does not

  • Use To Pendant and disconnect the battery.
  • Match the wired firmware and baud.
  • Keep the expander mainboard jumpers unchanged.
  • Power off and change one downstream RX/TX correction point.
Version-specific manuals: Current Expander V5 · Legacy Expander V4/V4.1 · Shared RX/TX FAQ