⚠ Under heavy construction

As of July 11, 2026, Sorter V2 is not yet in a position to be built.

The documentation that exists is incomplete. Any given page may be accurate, inaccurate, present only as an example, or badly out of date. We do not yet recommend that anyone attempt to build Sorter.

For the most live updates on our progress, join our Discord.

Design and research — Electronics

How the electronics talk to each other

Explanation

How the Orange Pi talks to the Pico: the cable, the messages, and where to find each part in the firmware.

AI-generated first draft. Written from the Pico firmware, the control program and the board's KiCad files, not from an actual build. The part names, pins and numbers are read from those files and have not been checked against a built machine.

The Pico is the small control board on the machine, and the program stored inside it (the firmware) is deliberately simple. Everything that decides what to do runs on the Orange Pi, the machine's computer, which sends the Pico short commands. This page is about how those two talk to each other. What is connected to the Pico is on What is connected to the Pico.

This page describes the basically board v1.3. How the cables are wired is in Wire harness and Connecting the components.

The big picture

Orange Pi to Pico

The Pico reaches the Orange Pi through the USB hub, as described on The USB connections and the hub. The Orange Pi finds the Pico by its USB ID and opens it as a serial port (a connection that sends one byte after another).

Every message, in either direction, has the same layout, called a frame. It is a 4-byte header (device address, command, channel, payload length), then the payload, which is the data itself, then a CRC32 checksum, a number the receiver uses to check that nothing was damaged on the way. The frame is wrapped in COBS, an encoding that makes a zero byte appear only at the end of a message, so the receiver always knows where one message stops. A frame is at most 254 bytes. The Orange Pi sends a command, and the Pico answers it.

The commands are grouped by what they act on: the board itself (INIT, PING, GET_VERSION), the stepper motors, the stepper drivers, digital inputs and outputs (pins that are on or off), and the servos. The number in the header says which stepper, output or servo is meant.

If something does not work

Where to look first. Each line points to the page that has the fix.

  • The setup wizard finds no controller (No MCU buses found). A new Pico has no firmware yet, which is normal. Flash it first: Flashing the control board. If it still does not appear, check the two USB cables, USB6 (Pico to hub) and USB5 (hub to Orange Pi).
  • One motor never moves and the others do. On a v1.3 board, check the address jumpers of its driver (v1.4 and later have none). A wrong or missing jumper fails silently. Preparing the control board, step 3.
  • A motor stops and the machine reports a stepper stall. Something is blocking that motor. Look at the machine. The motors explains what the machine does.
  • The chute does not find its home position. Check that the limit switch lead (LIM1) is in the socket the board prints HALL_SW_0. Connecting the components.
  • The doors open on the wrong layer, or not at all. Check that every ribbon cable runs from J4 of one layer board to J3 of the next, never the other way round. The servos and the layer adapter boards.
  • A lamp is dim. On a v1.3 board, check that the solder jumper beside its port is bridged (v1.4 and later have none). Preparing the control board, step 4.

What happens at start-up

When the machine is started, the Orange Pi brings every motor and servo up in a fixed order. This is the order in the canary release of the control program (v0.4.15). Only the purpose of each step is listed, not every message.

  1. Find the boards. The Orange Pi opens each USB serial port and sends a ping (a short "are you there" message) to every address from 0 to 15. A Pico that answers is a board. If a stepper the machine needs is missing, it tries again, up to 8 times. If no board answers, start-up stops with Control boards not found.
  2. Reset each board and ask what it has. The INIT command puts a Pico in a known state: lamps off, steppers not powered, servo chip reset with every output off. The Pico answers with its name, how many steppers, servos, inputs and outputs it has, and what each stepper is called. The Orange Pi uses the names to tell which stepper is which.
  3. Set the lamps. The saved brightness of each lamp is sent to its output.
  4. Set up each stepper driver. For every stepper the machine uses, the Orange Pi sends the driver its saved settings: UART mode (the driver takes its commands over a serial wire), microsteps, motor current and the stall detection threshold. It then sets the speed limit and acceleration. The driver counts the settings it accepts. The Orange Pi reads that counter before and after sending, and compares the difference with the number of settings it sent. If the driver took fewer, start-up stops with Stepper settings not applied. A driver that never answers also stops start-up, with Stepper setup failed, after 4 tries. Channels that no stepper uses are left alone.
  5. Set up the servos. The Pico reports whether it found the servo chip. The Orange Pi gives each layer's servo its speed and its calibrated open and closed angles, and moves each servo back to the open or closed position it had when the machine last stopped. A servo that is not calibrated is not moved.
  6. Open the doors. Every calibrated door is opened, at a slow speed. An uncalibrated servo is switched off instead, so it goes slack and cannot twitch. If no servo answers at all, start-up shows an error to check the servo cable and power.
  7. Line up the classification channel. The carousel is turned forward until the camera sees the channel is empty, then turned a little more until one of the platter's five spokes is at its reference mark. This is skipped, with a warning, if there is no live camera picture yet.
  8. Power the steppers and home the chute. The steppers are powered. The Orange Pi then tells the chute stepper to turn slowly until its limit switch is pressed. The Pico watches the switch itself, stops the stepper and sets that position as zero. Meanwhile the Orange Pi asks every 10 ms whether the stepper has stopped. It then backs the chute off to the first bin. If the switch is never reached, start-up fails with Chute homing failed.

After that the machine is ready and paused, until you resume it. Only the chute has a limit switch, so it is the only stepper that is homed.

Where to look in the control program

The control program on the Orange Pi is Python, under software/sorter/backend. These are the places that match the steps above, in the canary release (v0.4.15).

Where to look in the firmware

The firmware lives in software/firmware/sorter_interface_firmware. Its README has the build and flashing steps.

The commands named in the start-up steps, each linked to the function that handles it in the canary release (v0.4.15). The command list is at the top of the same file.