Examples · examples/universal-controller/v0.3
Rosetta
A wireless universal controller with a screen, light rings, turbo and a fast-charged cell
One controller for a PS4, a PS5, an Xbox, a Switch, or anything over Bluetooth. A 5-position knob where an Xbox 360 pad has its guide button picks the console. The controller drops off the bus while the knob turns and comes back as the chosen console's own controller.
- v0.3
- 145.5 × 82 mm
- 6 layers
- 176 parts
- 2,813 track segments
- 291 vias
Drag to turn the board. KiCad's render of it, 36 views, 10 degrees apart.


The hard parts
What's hard about it, and where each part is
Thumbsticks on the board, with no drift
SL and SR take ALPS RKJXV122400R sticks, the stick of PlayStation and Xbox pads, or a Hall-effect drop-in in the same holes. KiCad has no footprint for it: footprints/make_footprints.py writes one from the catalog's mounting-hole drawing, and the drawing's "prohibited wiring area" under each stick is a keep-out on the front.
A ring of light round a stick whose body is a rectangle
Each ring is 8 WS2812B-2020s on a 15 mm circle, the first at 22.5 degrees, so each LED sits between the stick's 4 directions, where the stick's 20 x 23 mm body leaves room. The right stick moved 3 mm down from v0.2's place so its ring clears Home and Capture. The 16 LEDs follow the knob's 5 in 1 chain on LED_DATA, so 1 PIO program drives all 21.
A screen in a board with no spare face
DS1's module lies under the dip with its 4 pins in a column at its right end. Its I2C shares I2C0 with the IMU, the charger and the gauge: 0x3C, 0x6B, 0x6A and 0x55. The IMU moved from 0x6A to 0x6B (R52 now ties SA0 to +3V3), because the charger has 0x6A.
Turbo that a console sees
The firmware's turbo.c repeats a held button at 5, 8, 10 or 20 presses a second. Every console polls its controller at least every 8 ms; the fastest press is 25 ms down and 25 ms up, so each one is seen. The timing is fixed and regular, so the same hold gives the same presses every time.
3 A from USB-C, and only 5 V
U11 (BQ25895) takes up to 3.25 A, capped at 2.96 A by R12 (120 ohms on ILIM), and its input current optimizer finds what the source can give without its voltage sagging: 3 A from a USB-C charger, 0.5 A from a console's port. Its high-voltage modes (HVDCP and MaxCharge) stay off: VBUS also feeds the auth donor on J2, which takes 5 V only. D+ and D- are not wired to the charger, and the firmware clears both enables at boot.
A cell that may be flat
U11's power path holds VSYS at 3.5 V or more from VBUS whatever the cell does, so the RP2040 starts on the cable alone and enumerates on J1 as a wired controller while the cell charges.
3.3 V from a cell that ends below 3.3 V
U12 (TPS63001) bucks or boosts as the cell needs, from 4.35 V down to 2.5 V. v0.2's linear regulator dropped out near the end of the cell.
Knowing the charge
U17 (BQ27441-G1) counts the current through R14 (10 milliohms, in the cell's negative lead) and reports the charge in percent over I2C. J9 brings the cell's thermistor to U11's TS pin, so the charger stops outside 0-60 C.
A PS4, a PS5 and an Xbox talk only to a licensed controller
J2 is a USB host port for a licensed donor. The RP2040 runs a second USB port in software (PIO-USB, GPIO16 and GPIO17) and relays the console's challenge to the donor. U13 switches the donor's 5 V.
Bluetooth Classic and BLE
U3, an ESP32-WROOM-32E on the RP2040's UART, on the back. Its antenna hangs past the dip between the shoulder horns.
Triggers, rumble, gyro, 16 buttons, 2 paddles
v0.2's: DRV5055 Hall sensors under the triggers, a DRV8833 for 2 motors, an LSM6DSL, 2 74HC165s.
The board, track by track
Every track and part of the routed board, drawn from its file
The board as examples/universal-controller/v0.3/rosetta.kicad_pcb holds it: six copper layers, 2,813 track segments, 291 vias and 131 nets. Point at a pad to see its part, and click a track, a via or a pad to follow its connection across the board.
You can drag to move around, and pinch or hold Ctrl and scroll to zoom.
How it was built
Every step of the design, with what it changed
Each step as v0.1/TIMELINE.md records it, oldest first.
1 controller, 5 consoles, a knob that picks
The owner found the site's examples poor and asked for a prototype in the manner of Agentcast and Last Hit: a universal controller with a switch that picks a PS4, a PS5, an Xbox, a Switch or Bluetooth, with ideas that are hard to do.
The board is a Python file
design.pynames 140 parts and places them in a controller's outline, on 4 layers. The knob is 1 analog reading: SW1 taps a ladder of 6 x 1k, and position k reads (6 - k)/6 of full scale. A USB host port relays a console's signature to a licensed donor through a second USB port the RP2040 runs in software.Evidence:
design.py; the README's table "What is hard about it".The first deck found a sixth position
The knob's first deck held a 1 M pull-down on the wiper. With the ADC's input leakage it read 1 V between detents: a position the decoder would act on. The ladder is 1k and the pull-down 100k now, and 6 decks hold each position inside its window at every corner.
Evidence:
sim/mode_between.cir,sim/mode_p1.cirtosim/mode_p5.cir,sim/corners.json.An antenna turned into the board
The ESP32 module went on the back face at 180 degrees, to point its antenna out over the notch between the grips. On the back face the generator mirrors the footprint first, so 180 degrees pointed the antenna into the board. The DRC listed 41 courtyard overlaps against the antenna's keep-out and 8 through pads inside it. At 0 degrees the antenna hangs out as intended.
Evidence: mistake M126; process P19.
The Docker image could not route
The machine had no KiCad, so Via ran in the repository's Docker image. The image could not route: Debian's headless Java has no X11 library, and FreeRouting stops without it.
install.shnow adds the full Java runtime where the library is missing.Evidence:
install.sh; the changelog's Fixed entry.60 passes and no session
The first route ran FreeRouting with 60 passes, the number the skill gives for small boards. It ran for Via's 15-minute limit and was killed, and a killed run writes no session. 12 passes finished in 13 minutes; 20 passes in 12 minutes from a better placement.
Evidence: mistake M128; process P4.
The wired sheet's ERC found 3 faults
A label-only schematic passed the checks that ran, and the DRC does not see a net with 1 pin. The first wired sheet's ERC did: each stick's click was on a net named
L3orR3while the shift registers readBTN_L3andBTN_R3, the DRV8833's sense pins were tied straight to a rail, and so were the IMU's strap pins. The fixes areBTN_L3andBTN_R3, R50 and R51 (0.5 ohm, a 400 mA limit on each trigger motor), and R52. The board was routed again.Evidence: mistake M127; process P24.
Lanes for the RP2040
The RP2040's pins had no lanes until its capacitors moved to its corners and its vias shrank to 0.45 mm. From there FreeRouting closed every connection in 1 run of 4. The IMU's supply pins stayed apart in 3 runs; that link is drawn by hand.
Evidence:
rosetta.kicad_pcb.GREEN with 5 warnings
The 5 warnings are the silkscreen outlines of the 2 USB-C receptacles and the ESP32 module, which hang over the board's edge on purpose. The firmware's host tests pass:
make -C firmware test.$ workcenter gates examples/universal-controller/v0.1 PASS erc 0 errors, 0 warnings [0.48s] FAIL drc 0 errors, 5 warnings (0 unconnected, 0 parity), legend (no fab named: held to the least of the 4 fabs Via knows (height pcbway-standard, stroke oshpark-2layer)): 9 fail, 0 not judged [1.48s] - warning: silk_edge_clearance: Silkscreen clipped by board edge - warning: silk_edge_clearance: Silkscreen clipped by board edge - warning: silk_edge_clearance: Silkscreen clipped by board edge - warning: silk_edge_clearance: Silkscreen clipped by board edge - warning: silk_edge_clearance: Silkscreen clipped by board edge - legend overlap: text "CAPTURE" at (150, 120) mm on F.SilkS: on via at (146.571, 119.401) by 0.2 x 0.076 mm (rules/legend.json) - legend overlap: text "CAPTURE" at (150, 120) mm on F.SilkS: on via at (153.435, 119.844) by 0.2 x 0.2 mm (rules/legend.json) - legend overlap: text "PS4" at (157.07, 117.8) mm on F.SilkS: on via at (158.121, 118.447) by 0.2 x 0.028 mm (rules/legend.json) - legend overlap: text "XBOX" at (170, 109.6) mm on F.SilkS: on via at (170.881, 108.99) by 0.2 x 0.065 mm (rules/legend.json) - legend overlap: text "XBOX" at (170, 109.6) mm on F.SilkS: on via at (168.36, 109.675) by 0.2 x 0.2 mm (rules/legend.json) - legend overlap: text "XBOX" at (170, 109.6) mm on F.SilkS: on via at (169.594, 110.121) by 0.2 x 0.154 mm (rules/legend.json) - legend overlap: text "XBOX" at (170, 109.6) mm on F.SilkS: on via at (169.109, 109.645) by 0.2 x 0.2 mm (rules/legend.json) - legend overlap: text "SWITCH" at (177.99, 111) mm on F.SilkS: on via at (175.253, 111.477) by 0.2 x 0.198 mm (rules/legend.json) - legend overlap: text "OPTIONS" at (190, 108.2) mm on F.SilkS: on via at (189.802, 107.704) by 0.2 x 0.179 mm (rules/legend.json) RATINGS not asked for: no ratings.json beside the schematic RED: rosetta report examples/universal-controller/v0.1/build/gates.json
What is open
What's still left to do on this board
- The fuel gauge's capacity. The BQ27441 must be told the cell's design capacity once (TI's SLUUAC9, "Configuring the Design Capacity"). The firmware does not write it yet.
- The thermistor's divider is TI's EVM values for a 103AT (R13 5.23k, R15 30.1k). A cell with another thermistor needs them worked out again against the BQ25895's TS thresholds.
- The inductors' parts. L1 and L2 are the datasheets' values in Coilcraft's sizes; the saturation currents are not yet checked against the worst-case peaks.
- The screen's drawing, the rings' patterns and the back buttons' menu are not written; the firmware has the decisions (
turbo.c), not the drivers. - Everything v0.2 lists as open: the stick's switch pins, the triggers' magnets and pivots, the auth relay against a real console.