While the restored piano was originally a present for my wife as living room decoration, it somehow morphed into one of my favorite multi-year projects. While it's already close to the finish line (I'm saying this since two years), I decided to share it in case somebody also wants to build one.The basis is an old upright piano from Ferdinand Manthey, produced in Berlin probably sometime around 1920. As you can see in the pictures it was in a bad shape. (Sorry for the quality of the pictures, when I took them I did not think of publishing them). It spent a couple of years outside only partially protected from the rain which is why the top cover rotted away underneath the ugly plastic cover that was glued on top of it. The frame of the piano was beyond repair.

Hence, before starting the restoration I first of ripped the whole piano apart in order to remove the thick wooden backplane and steel frame to make some room. Luckily somebody gave me the hint that it's a bad idea to simply clip the strings. The released tension on one might lead to other strings ripping and could finally make the frame "explode". So in order to avoid injuries the strings were unscrewed first.

The parts were then sanded, veneer patched where necessary and finished wax. The results already looked good enough to move the whole thing from the garage to the living room.

The missing lid was replaced with a completely new upward drawer which is high enough to hold large bottles and hide them behind the hammer mechanics when closed. The small board on the hammers in the front can be used for jars or similar:

For the opening mechanism steel cables are fixed to the drawer and run over a pulley to the front lid. A 20kg part of the old steel frame is reused as a counterweight on the backside of the piano.:

So, the most important goals (looks good, has a cupboard in the bottom and booze in the top) are achieved. However, the electronic part of the project still has some open issues.

I first tried to use piezo speakers mounted on a board as sensors. However, this was a bad idea. the impact is reliably transmitted to the neighboring sensors, resulting in uncontrollable cross talk. Luckily in some forum post (which I can't find anymore, but many others posted this idea as well) somebody mentioned the idea to use optical reflective sensors to measure the key or the hammer position. As I wanted to keep the inertia of the hammers for a realistic haptic I decided to measure the hammer head movement.

I designed ATMega8 based sensor boards with eight ITR20001 optical distance sensors each. I also made three versions of these with different sensor pitch (12.7mm, 13mm, 14,5mm) to accommodate the varying pitch along the octaves. Also the boards are design in a way that I can cut off sensor by sensor in order to match the respective hammer bank length. A 3D printed housing and a felt layer absorb the hammer impacts nearly without noise.

Each board reads the sensor values and if a hammer comes closer than a certain threshold, their velocity is determined (difference to previous position) and transformed into a impact strength. A central Arduino Due then collects all key presses and strengths from the sensor boards via SPI and hands them to a Raspberry Pi over USB-MIDI. The Raspberry Pi runs FluidSynth and finally produces some sound.

During the prototype phase this concept worked great, with a single sensor board, but after adding the remaining boards some problems appeared:
- the current SPI readout protocol is quite slow (each board is asked for each key individually, instead of "Were there keypresses"), which leads to high latency and an awkward feeling when playing. But this is just a software problem and should be easy to solve/optimize.
- The SPI bus only works for up to four connected boards. With more boards, only garbage arrives at the Arduino. I suspect a too  high capacitive load on the bus due to the long leads (see picture). I'll have...
Read more »