In previous projects I used some kind of Arduino, but I fancied trying CircuitPython for this project. This has the advantage of the code being stored on the module, allowing anyone to modify it without the faff of toolchains and the relative complexity of C++.
Some requirements to start with:
- It needs to be powered from Andy's existing 9V daisy chain.
- The MIDI cable should be captive so the cable can't become separated from the footswitch, and to simplify setup.
- Each footswitch has a corresponding LED.
- It must be mechanically robust.
I happened to have a Seeed Studio XIAO RP2040, so the design is based on that. I considered hacking it together on Veroboard, but the ridiculously low cost of PCBs from JLC PCB made a custom PCB too tempting. It also makes it easy to allow for five switches and LEDs in case that's needed in a future project.
The schematic:
The XIAO can only handle 5V. The current requirement is only tens of milliamps so an old-fashioned voltage regulator is fine. Here's the final layout:
And KiCad's 3D view:
The box needs some holes:
The PCBs took about about three weeks to arrive: