↖️ Blog Archive

Self-Playing Piano, Part Five

Bradley Gannon

2025-11-20

TL;DR: I updated my CAD models, driver circuit design, and software to account for the new key arrangement I wrote about last time. I also added JST connectors to the PCBs and solenoids, which has simplified cable management. The system is generally more reliable and sturdy than it’s ever been, and it seems like I’m approaching a point where more and more of my effort will go to expanding the system horizontally and tweaking the software for better performance.

Closer view of the solenoids in their new support cradle Closer view of the PCB, which I made on my CNC mill

This project has been full of challenging problems, so I was suspicious and surprised this week when nothing really broke or misbehaved. There were problems, of course, but I didn’t suffer the same kinds of fundamental obstacles that I’ve encountered in the past. At no point did any of my design decisions turn out to be deeply flawed or require me to completely start over on that part of the block diagram. The problems I handled this time around were more mundane, like breaking a pair of end mills due to careless mill jogging or tracking down short circuits due to shoddy soldering.

These kinds of problems aren’t interesting—or at least they aren’t the kind of thing I want to post about—so I’ll keep this one short. Most the progress I made is visible in the video above, and the rest is in the git log. I did find a mildly interesting bug where the key driver was running too slowly, but this was easy to fix once I realized I could send the desired pin settings as i8s and write them directly to the output ports with some AVR assembly.

So: onward. Next time I’d like to expand to a second module, which will require some changes to the host-side code. At that point I’ll have up to two full octaves covered, which is enough to play some legitimate but constrained music. I think I’d like to spend some time improving the key motion model at that scale and make a more permanent power distribution system. Somewhere in there I’ll also want to get better solenoid plunger designs, PCB supports, and probably other incremental improvements. The limiting factor is likely to be my own time and patience for winding solenoids and soldering, which in a way is a nice problem to have.