4.1 Connect Limit Switches and Sensors
V4.7B has 8 optocoupler-isolated inputs (TLP521GB-S) on two headers along the board edge. All eight channels are electrically identical.
- The board sources the current, not your switch. Current leaves the internal 5 V rail, passes through the optocoupler LED and the on-board 300 Ω resistor, and exits at the Signal pin. An input triggers only when your device pulls Signal down to GND.
- Everything is already on the board — you never add a supply or a resistor to an input.
Input map in the test YAML
| Terminal | Assigned function | Terminal | Assigned function |
|---|---|---|---|
| GPIO.33 | X limit − | GPIO.32 | X limit + |
| GPIO.35 | Y motor 0 limit | GPIO.34 | Y motor 1 limit |
| GPIO.39 | Z limit | GPIO.36 | A limit |
| GPIO.2 | Probe (pull-up, active low) | GPIO.26 | Tool setter (pull-up, active low) |
:pu. In the supplied test YAML they are written gpio.2:pu:low and gpio.26:pu:low — the internal pull-up must be enabled for these two to read correctly. See item ① on 1 Pinout Reference.
Any dry-contact switch or button. This is the simplest and most common option on V4.7B, and it works on all eight inputs.
- Wire the switch between the Signal pin and the GND pin of that input. Two wires, no supply, no polarity.
- Prefer the normally-closed contact where practical, so a broken wire shows up as a triggered endstop instead of a dead one.
- Match the YAML polarity to the contact you chose, then confirm with $limits.
motor0: limit_neg_pin: gpio.33:low limit_pos_pin: gpio.32:low probe: pin: gpio.2:pu:low toolsetter_pin: gpio.26:pu:low
A powered endstop such as the PiBot Optical Endstop V5 or Mechanical Endstop V5 repeats far more precisely than a bare micro switch. When triggered, their output pulls Signal down to GND, which is what this input needs.
- Connect the sensor Signal to the input Signal pin and the sensor GND to the input GND pin.
- The input header has no supply pin. V4.7B input connectors are XH2.54 with only two positions, Signal and GND, because this board was designed around plain mechanical switches. Take the sensor's +5 V from any 5 V source on the board — the RJ12 port and the board's +5 V header pins both provide it — and share the same GND. Any of them works; there is no dedicated SW-VCC pin to use.
- Check the module LED, then verify with $limits.
If your machine needs industrial proximity sensors, you have two workable routes:
- Use an isolated interface — a relay module or an opto-isolator module powered from your 12–24 V supply, with its output contact wired to the V4.7B Signal and GND pins as a dry contact. This is the safest general solution.
- Choose a board with native support — V4.96 Pro, V5.77 Carrier and V5.88 Ultra all have a SW-VCC jumper that can feed 12–24 V sensors directly.
NPN, via an interface
An NPN (sinking) sensor driving a relay or opto module, whose isolated contact then behaves as a plain dry contact on the V4.7B input.
PNP, or any direct connection
A PNP (sourcing) output pushes V+ into Signal, which this input cannot read at all — and at 12–24 V it will damage the optocoupler. Never wire either type straight to the input.
- Every input reads inactive at rest, changes state only when its own switch is operated, and returns cleanly when released.
- A disconnected normally-closed circuit produces the expected fault state.
- Run the bench test in 2.5 Test Probe and Input Signals before the switches go anywhere near a moving axis.
Quick troubleshooting
- Probe or tool setter never reads correctly. GPIO.2 and GPIO.26 need
:puin the YAML — without the internal pull-up they will not behave. - A three-wire sensor never responds at all. Confirm it is a sinking (NPN / open-collector) type. A sourcing PNP output cannot trigger these inputs.
- An input is triggered before anything is touched. Check for a short between Signal and GND, and confirm the YAML polarity matches the contact type you wired.
- An input stopped working after connecting an industrial sensor. A 12–24 V source applied to a Signal pin damages the optocoupler — see section C for the correct approach.
- Intermittent triggering on a long cable run. Use shielded cable, keep sensor wiring away from motor and spindle leads, and ground the shield at one end only.
