4.3 Connect External Relay

Use the MOSFET terminals or an isolated logic-level interface

Wiring a PiBot IsoSwitch V4

The PiBot IsoSwitch V4 gives three relay channels, each with an NC / COM / NO changeover contact and an optocoupler input stage. It runs from its own 4.5–40 V DC supply (24 V by default) and takes three logic signals on S1 S2 S3. V5.77 Carrier offers two 5 V signal routes.

The GND wire is not optional. The relay board has its own supply, so its INPUT GND must be tied to the V5.77 Carrier GND — without that shared return the S1/S2/S3 inputs have no reference. And mains voltage never touches the controller: keep it on the contact side, in a rated enclosure.
PiBot V5.77 Carrier wired to a PiBot IsoSwitch V4
V5.77 Carrier to PiBot IsoSwitch V4. The boxed headers are alternatives — pick one and wire three signals plus GND. Click the image to view it full size.

Which outputs you can use on V5.77 Carrier

RoutePinsLevelNotes
5 V buffered output header
(labelled PWM 5V)
GPIO.4 GPIO.5 GPIO.45 GPIO.46 + GND5 V signalGPIO.4/GPIO.5 also drive the MOSFET channels; GPIO.45/GPIO.46 are spindle and laser PWM in the test YAML. This header is not a relay-coil supply.
I2SO outputI2SO.23 I2SO.21 I2SO.20 + GND5 V signalThe C-axis PH2.0 connector in the worked example; use it only when that axis is unused. Extra-I/O I2SO signals may also be assigned, but then they are unavailable to the optional 7th/8th axes.

Trigger jumpers on the relay board

Each relay has its own jumper block — JP4→S1, JP5→S2, JP6→S3. The silkscreen numbers the rows 1 (bottom), 2 (middle), 3 (top); each column takes one jumper, down bridging 1–2 and up bridging 2–3.

SettingLeft columnRight columnEffect
Active High — defaultdown (1–2)down (1–2)A high signal energises the relay.
Active Lowup (2–3)up (2–3)A low signal energises the relay.
Always onup (2–3)down (1–2)Stays energised, input ignored.
Always offdown (1–2)up (2–3)Stays de-energised, input ignored.
Active High ↔ Active Low reverses which input level energises the coil. At a given controller idle level this reverses the practical contact behaviour without changing the signal wire or YAML. It does not rename the terminals: with the coil de-energised, COM–NC is closed and COM–NO is open. Select polarity and the physical contact together, then verify boot, reset, alarm and power-off states with a continuity meter. Always on / Always off are bench overrides; return them to an active mode before operation.

Wire and prove the control side first

  1. Disconnect the V5.77 and relay-board supplies.
  2. Choose one route from the table; do not combine routes.
  3. Wire three signals and GND to S1/S2/S3/GND, then power the relay board from its own supply.
  4. Set JP4/JP5/JP6 and load the YAML mapping below.
  5. With no load attached, send one command at a time and check the click and LED.
  6. Measure COM–NO and COM–NC continuity before connecting the real load.

YAML and test commands

Matching the drawing, where I2SO.23→S1, I2SO.21→S2 and I2SO.20→S3. Substitute your own pins if you wired a different output.

coolant:
  mist_pin: I2SO.23        # S1 - M7 on, M9 off
  flood_pin: I2SO.21       # S2 - M8 on, M9 off
  delay_ms: 0

user_outputs:
  digital0_pin: I2SO.20    # S3 - M64 P0 on, M65 P0 off

Pass: each command changes only its assigned relay and the continuity reading agrees with the selected contact. Fail: a relay starts unsafe, more than one changes, or a command does not release it — disconnect both supplies and correct the YAML, jumpers or contact wiring before adding a load.

Full relay-board reference — terminal map, full-size jumper drawing, servo-enable use and troubleshooting →

Do not route mains voltage through the controller board. The V5.77 only supplies control signals. Keep mains wiring inside a rated enclosure and use a correctly rated relay, contactor, or SSR.

Alternative: Drive a 12–24 V DC Relay Coil Directly

  1. Choose a relay coil whose voltage matches VIN Main.
  2. Connect coil positive to Vmot-Main and coil negative to io.4-MOS-GND or io.5-MOS-GND.
  3. The onboard flyback diode protects a correctly polarized inductive load. Verify polarity before power-on.
  4. In the test YAML, use M7 for GPIO.4, M8 for GPIO.5, and M9 to turn both off.

Logic-level Relay / SSR Interface

You may instead use GPIO.4/GPIO.5 on the PWM 5 V header or one of the six reserved I2SO outputs. The interface input must accept the selected 3.3/5 V level and must not overload the logic pin. An optically isolated PiBot IsoSwitch or equivalent interface is recommended where electrical isolation is needed.

GPIO.4 and GPIO.5 feed both their header pins and their onboard MOSFET channels, so these are not independent functions.

Acceptance check: test without a mains load first. The relay changes state exactly once per command. Separately verify and record its state after reset, alarm, communication loss and removal of either supply; do not assume those states are identical.