Hardware build guide
Build the card sorter
01 / Set up
Set up your build
Choose how you're building the sorter. The parts list, wiring and assembly steps below follow these choices, which are saved in this browser.
Where are your parts from?
Controller board
ESP32 mounting
Sorting modules
Each module has an IR sensor and three servos: a bottom paddle that acts as its floor, a side paddle gate and a left/right pusher. A card falls through every open bottom paddle until it lands on a closed one, then that module's pusher sweeps it into the left or right bin. With every bottom open it drops into the catch-all.
02 / Parts
Bill of materials
Quantities follow your module count: 3 modules × 3 servos plus 1 feeder servo, and 4 IR sensors. That uses 10 of the PCA9685's 16 channels, and one PCA9685 runs up to 5 modules. Check off each part as you gather it. Checkmarks are saved in this browser.
Electronics
Sensing
Power
Structural
Fasteners & wiring supplies
Optional
Some "Buy" links are Amazon affiliate links. We may earn a small commission on qualifying purchases at no extra cost to you.
03 / Assembly
Assembly
Work through the phases in order, structural work first. Checkboxes are saved in this browser, so you can close the tab mid-build and pick back up later.
Stuck on a step? Join the Discord if you need help.
Print the structural parts
Every printed part of a 3-module sorter, colored by what to print. The key lists how many of each you need, numbered by plate in the print file. Change the module count or board in the setup above and the model and counts update.
Drag to rotate, scroll to zoom, right-drag to pan. Hover or tap a part in the key to show only that part.
Optional: Plate 2 "Alternative Horns" has loose fit and snug fit versions of every servo horn, for servos whose shafts fit the standard horns too tightly or too loosely.
If roller servo horn (MG90S) fits your feeder servo too tightly or too loosely, print roller servo horn, roller servo horn (loose fit) or roller servo horn (snug fit) from Plate 2 "Alternative Horns" instead. Using the optional ball bearings? Print Plate 4 "Alternative Feeder Base" (feeder base (flat, bearing version) and feed roller (bearing version)) in place of the feeder base and roller.
Optional: Plate 13 "Optional - Regular Bin Holders" has fixed wings (bin wing left, bin wing right and bin wing end) to use instead of the folding wings on Plates 7, 8 and 9.
Assemble the modules
Leave every horn off its servo shaft in this phase. You fit the paddles and pusher arms to their horns now, but the horns only go onto the servos in the app's setup wizard (Wire and calibrate), once each servo has moved to the right position.
The linkages are labeled LEFT and RIGHT, matching the left and right of the platform.
The horn is the small piece that fits the servo shaft. Neither roller part has "servo" printed on it.
Same as the feeder roller, these give it grip on the card face.
Wire and calibrate
Everything hangs off one I²C bus (PCA9685) and 4 digital input pins (IR sensors). The ESP32-S3's onboard supply powers the PCA9685's logic side. Its V+ servo rail must come from the external supply, and that supply's ground must be tied back to the ESP32-S3's ground.
The PCA9685's header pins point straight out to the side. You may need to bend them 90° upward so they clear the panel and stay easy to reach when wiring to the ESP32-S3. Use the table below.
I²C bus
| PCA9685 pin | ESP32-S3-WROOM-1 | Wire in diagram |
|---|---|---|
SDA | GPIO8 | |
SCL | GPIO9 | |
VCC (logic) | 3.3V | |
GND | GND |
Wire PCA9685 VCC to the ESP32's 3.3V pin, not 5V. The I²C pull-ups follow whatever powers the PCA9685, and feeding 5V into an ESP32 GPIO can damage it. The PCA9685 chip itself runs its logic fine at 3.3V, so this costs nothing.
Wire channels in the side of the base, with zip-tie points, keep the cables tidy.
PCA9685 channel map
| Ch. | Assignment |
|---|---|
| 0 | Module 1, bottom |
| 1 | Module 1, paddle |
| 2 | Module 1, pusher |
| 3 | Module 2, bottom |
| 4 | Module 2, paddle |
| 5 | Module 2, pusher |
| 6 | Module 3, bottom |
| 7 | Module 3, paddle |
| 8 | Module 3, pusher |
| 9 | Unused, available for additional sorting modules |
| 10 | Unused, available for additional sorting modules |
| 11 | Unused, available for additional sorting modules |
| 12 | Unused, available for additional sorting modules |
| 13 | Unused, available for additional sorting modules |
| 14 | Unused, available for additional sorting modules |
| 15 | Feeder (continuous rotation) |
The sensors share power and ground: join the 4 power wires into one and the 4 ground wires into one, using Wago connectors, a breadboard or solder. You'll set each sensor's range in a later step.
IR sensors
All 4 read active-LOW (pin goes low when a card is present) using the ESP32-S3's internal pull-up. Wire the sensor's digital OUT straight to the pin, no external pull-up resistor needed.
| Sensor | Pin | Signal wire in diagram |
|---|---|---|
| Module 1 gate | GPIO4 | |
| Module 2 gate | GPIO5 | |
| Module 3 gate | GPIO6 | |
| Hopper throat | GPIO16 |
Power these sensors' VCC from the ESP32's 3.3V pin if the module supports it, not 5V. Their digital OUT tends to swing up to whatever VCC they're fed, and 5V on OUT risks damaging the GPIO it's wired to. Check your specific sensor's datasheet accepts 3.3V.
Skipping the common ground is the #1 cause of servos that twitch but never move correctly.
Servo power
| From | To | Wire in diagram |
|---|---|---|
| External 6V PSU, + | PCA9685 V+ via barrel adapter + | |
| External 6V PSU, − | PCA9685 GND via barrel adapter − |
The wizard opens the first time the sorter connects, and any time from the help (?) menu on /app/calibrate. A horn fitted off-center biases the whole linkage. The exact positions get fine-tuned in the next step.
For the pusher's left and right positions, swing the arm toward the inner wall but stop before it touches, about 15-16% away from neutral. The pusher doesn't need to hit the wall to fling the card, and pressing against it strains the servo. The app warns you past 16%.
Check it by pulling the card back to about 2 inches (5 cm): the LED should go off again. If it stays on, back the screw off a little. A sensor set too far reaches past the card path and reports cards that aren't there.
If a sensor doesn't trigger, or triggers with nothing in front of it, repeat the previous step for that sensor.
Getting a better calibration
- Remove the rear shim if you have one.
- Turn the screw clockwise until two cards fit in easily.
- Place 2 cards between the feeder roller and the top roller, lying flat on the hopper.
- Slide the top card back and forth while turning the screw counterclockwise, until the top card spins the top roller.
- Refit the rear shim.
- Load some cards.
- Test the feed.
- If more than one card comes out, turn the screw counterclockwise 1/8 of a turn.
- Test 5-10 cards.
- If more than one card still comes out, repeat from step 6 as many times as needed.

















