BeginnerMediate

Not a beginner — Not a comfortable intermediate — and certainly never done

View my projects on GitHub

Piano Playing Bird

21 Nov 2022

Trevor Clack


Unlike most posts on here, this project was not code-heavy, rather it was a physical engineering feat. I was in a mechanical system design project (at the University of Melbourne) and we were tasked with creating an interactive “pet”. After some discussion of mutual interests (music), we opted to make a pet that played the piano. A bird was chosen simply because it was the only animal our unimaginative brains could conjur that would strike a key note by pecking.

Credit where credit is due: The captivating images of the title were AI generated using a huggingface stable diffusion model.

Demo

Please enjoy this short video I made briefly explaining the project as well as a fun demonstration of it in action.


The Design Process

Throughout the project, components were designed and manufactured from scratch, using a laser cuter on MDF (Medium Density Fibreboard) or acrylic. This involved measuring and calculating the forces involved in pressing a key down on the electric keyboard available to us and calculating the torques and required motor power. Much of those mathematical details are too cumbersome to type up and in the end there was still a fair bit of trial and error with a splash of analytics.

Beyond designing parts, as an attempt to practice the 3 R’s, we salvaged components from previous disassembled projects, such as the primary cam performing the action, a few gears and an aluminum shaft we needed to tap to connect with other components.

The Shortcomings and Excuses

I’ve always believed that education gets in the way of true learning, and this simply confirms it.

I thought it would be really neat if the bird would hear a note then move to the desired key and then play it. I had written a note detector in python, the idea was to use python as a sort of API and the outcome of the note detection would then go to the Arduino an instruct it exactly how far to move to reach the note it heard. That unused code is available to browse here. (Also featured is the unused clap detector script. That ultimately was just enabled in the Arduino code). What happened with the plan? Our motor simply was not powerful enough. To imagine a motor of equal power moving the full platform would have been too daunting in the short time we had left. This university considers 4 simultaneous classes as full time and there simply wasn’t enough time to commit on top of it all. I’ve always believed that education gets in the way of true learning, and this simply confirms it.