03 — Wiring
Cameras, relay, arm and cards — with the pin numbers from the code, not from memory.
Do the wiring with everything unpowered. Label both ends of every cable and every card slot before the first boot; you will need the labels in chapter 05 and 11.
Cameras
Two CSI ports on the Pi 5. Which physical port becomes "1. Cam (left)" and which "2. Cam (right)" is decided in the UI by the mounting position, not by the port. Route the ribbon so it cannot be pulled when the arm moves — a half-seated cable is the most common cause of black frames (Camera frontend has timed out).
Conveyor relay (GPIO 18)
Pin counting on the 40-pin header: count in pairs from the SD-card end; pin 1 has the square pad. Pin 12 = GPIO 18, pin 6 = GND.
Order of connections:
- GPIO 18 (pin 12) → relay
IN. - Pi GND (pin 6) → the common minus bus. Relay
DC−, belt supply−and motor−all go to that bus. Common ground is mandatory. - Belt supply
+→ fuse (3–5 A) → relayDC+. - Behind the fuse, a branch → relay
COM. - Relay
NO→ motor+. - Flyback diode 1N4007 across the motor, stripe towards
+.
Jumper on the module: H (high-trigger). Determined at the bench on 2026-09-04: the H input switches reliably from the Pi's 3.3 V, while in L mode "off" would need 12 V that the Pi cannot deliver, so the relay stayed pulled in. (The older wiring sheet in the repo says L; the code in vorsa/linie.py is the newer truth.) A bonus of H mode: the Pi's pins boot low, so the belt is off from the first second.
Use NO, not NC: if the Pi crashes, the relay releases and the belt stops. The Pi runs from its own USB-C supply, never from the 12 V.
Test without 12 V first: start the server normally (belt in simulation). Then power the 12 V and start with VORSA_BAND=relais; the line tile shows "Relais (High-Trigger) an GPIO 18" instead of "Simulation". A different pin: VORSA_BAND_PIN=<n>.
Robot arm (RAMPS 1.4 / Arduino Mega)
Pins as defined in arduino-sketch/VorsaArm/VorsaArm.ino (identical to the original RAMPS mapping):
| Axis | STEP | DIR | EN | MAX end stop |
|---|---|---|---|---|
| X (base) | 54 | 55 | 38 | 2 |
| Y (shoulder) | 60 | 61 | 56 | 15 |
| Z (elbow) | 46 | 48 | 62 | 19 |
| Pump | D10 |
Direction switches are the only lines you may ever have to touch in the sketch:
bool DIR_INV[3] = { false, true, false }; // x, y, z — flip if "+" moves the wrong way
bool HOME_PLUS[3] = { false, true, true }; // homing direction towards the end stop
The Arduino connects to the Pi 5 by USB (data cable) and appears as /dev/ttyACM0 (a CH340 clone appears as /dev/ttyUSB0 — set VORSA_ARM_PORT). The 12 V for the RAMPS comes from its own supply, ground shared with the Pi through the USB connection.
Flash the firmware with the Arduino IDE: board "Arduino Mega 2560", 115200 baud. In the serial monitor, help lists the commands; endstat shows the end stops; test x moves one axis a few steps.
AKD1500 cards
Seat the M.2 cards in the carrier (Geekworm X1011), connect the PCIe FFC cable to the Pi, then power the carrier's 5 V DC jack — it feeds the Pi as well, so the Pi's USB-C stays unplugged (never both). Write the slot number on each card. After the first boot (chapter 05) note which PCIe address (0001:0x:00.0) belongs to which slot — the card watchdog and the reset button use those addresses.
Checkpoint: nothing is powered yet; every cable is labelled; the relay jumper is on H; the fuse is in the belt's + line.
