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 three servos, a bottom paddle, a side paddle gate, and a left/right pusher, plus an IR sensor. Closing every bottom paddle above the target bin and opening only the ones beneath it lets a card fall to the right module before the pusher ejects it.
02 / Parts
Bill of materials
Quantities scale with the number of modules you're building: 3 modules × 3 servos, 1 feeder, 4 IR sensors, 10 of the PCA9685's 16 channels in use. The remaining channels are free for additional sorting modules (up to 5 modules on a single PCA9685). 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
Eight phases, 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 swaps: Plate 2 "Alternative Sorting Platform" has another platform, pusher left and pusher right to use instead of the ones on Plate 1. Plate 3 "Alternative Horns" has loose and snug versions of the horns (bottom paddle horn loose, bottom paddle horn snug, side paddle horn, side paddle horn loose, pusher horn loose, pusher horn snug) for servos whose shafts fit the standard horns too tightly or too loosely.
roller horn mg90s fits the MG90S feeder servo from the parts list. If it fits your servo too tightly or too loosely, print roller horn, roller horn loose or roller horn snug from Plate 3 "Alternative Horns" instead. Bought the ball bearings? Print feeder base with bearings from Plate 5 "Feeder With Bearings" in place of feeder_base.
Optional: Plate 15 "Alternative Bin Holders" has fixed wings (generic base wing, generic base wing (1) and card_base_wing_end) to use instead of the folding bin holders and hinges on Plates 12, 13 and 14.
Assemble the modules
The linkage's TOP/BOTTOM labels describe how it's installed, not which way the module faces. Since you build with the platform upside down, TOP points away from the platform. This is the paddle that opens to drop a card to the next module, or the current one on a match. The horn gets seated onto the servo once the module is calibrated from the app. See Calibrate from the app below.
The linkage's TOP/BOTTOM labels describe how it's installed, not which way the module faces. Since you build with the platform upside down, TOP points away from the platform. One paddle servo drives both flappers together. They open and close as a pair, not independently. The horn gets seated onto the servo once the module is calibrated from the app. See Calibrate from the app below.
The feeder roller is printed in two parts: roller and roller horn mg90s. Neither part has "servo" printed on it. The roller horn is the small piece that fits onto the servo shaft.
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 PCA9685's logic side runs off the ESP32-S3's onboard supply; 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. A floating servo ground is the most common reason a freshly wired unit won't move.
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. The logic voltage is 3.3V on ESP32, not 5V.
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.
There are wire channels, that use zip ties, in the side of the base to help keep everything neat.
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) |
For the power and ground, you will have to combine 4 wires into one, either with a breadboard or by twisting and soldering them together. You will need to manually calibrate the sensors to have a shorter throw, as to not get false positives.
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 − |
Fitting a horn off-center biases the whole linkage. The exact open/closed and left/right pulses get fine-tuned in the next step.
For pusherLeft/pusherRight, 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.

















