DIY Electric Handpan v1 didn't quite work out the way I wanted - the piezo sensors were just too much of an RNG. So in this version I'm going to switch to using capacitive touch sensors instead.
In order to simulate some level of 'strike weight', I'm going to give each note plate a pair of touch 'zones': striking a 'central' zone will sound at a 'medium' volume; striking a 'peripheral ring' zone will sound at a 'low' volume; and striking across both zones simultaneously will sound at a 'high' volume.
OnShape
Once again I'll be using OnShape to do my physical design work. The design for v2 differs from v1 in a number of ways, not-least-of-which is a scaling down of the whole build to around 80% that of a 'real' handpan. The updated design also includes a few simplifications (e.g. a single thickness of MDF throughout; struts to join note plates, instead of the more challenging bevelling-plus-edge-gluing seen in v1). The assembly process is similar enough to v1 to skip documenting that again here.
Electronics
The bulk of the sound system (Raspberry Pi Zero 2W; Raspberry Pi DigiAMP+; speakers from an old TV) is unchanged from v1. What is new is how the Raspberry Pi gets its instructions as to which note to play, and at what volume.
This time around hit detection is being done using a set of capacitive touch sensors (CTS) plumbed in to a pair of Adafruit MPR121 12-key CTS breakout boards. Each of my CTS pads has two touch areas - a 'central' zone surrounded by a 'peripheral ring' zone. Both zones (plus the 'dead' zone between them) have the same surface area (believe it, or not!).
PCB assets for my CTS pads - suitable for submission to Elecrow.com, for example - can here found: here.
Wiring is pretty simple: each Adafruit MPR121 12-key CTS breakout board is dedicated to a set of 9 zones ('central' zones or 'peripheral ring' zones), one per note; and the breakout boards are wired together font-to-back to parallel up the 4 output wires (Vin, SCL, SDA, GND) that get fed into the Raspberry Pi. I've also added a pair of MC buttons to provide volume control (plus long-press to shutdown).
Code
GeoPan.py is the code I'm running (via a service) on the Raspberry Pi. You'll need to source your own audio assets for the handpan notes (plus a 'blips.wav' that gets played at start-up and shut-down). Hopefully the code is pretty self explanatory...
In order to set-up everything you need on the Raspberry Pi (CircuitPython, etc.), please see: Adafruit MPR121 12-key Capacitive Touch Sensor Breakout Tutorial.
One further note about the 'service' I'm using to run my code: I include the following flags to make sure the sound-making code gets the highest process priority it can have:
CPUSchedulingPolicy=fifo
CPUSchedulingPriority=99
Misc. Links
First Notes
That's a bit more like it! Now I just have to learn to play... ;-)
¤ Copyright 1999-2024 Chris Molloy ¤ All rights reserved ¤