Raspberry Pi Music Fingers




Introduction: Raspberry Pi Music Fingers

About: Born as a farmer, studied electronics ,working as a Consultant and a 3D printing enthusiast by night..

Creating music is always fun, but making it with your own DIY musical instrument is much better !!

Whether you are a professional musician looking for that next new instrument to try or an amateur enthusiast who has basic knowledge of electronics, use the Raspberry Pi to create your own DIY Music fingers.

So now set aside about half a day to complete the build of the new instrument shown in the pictures above.Start by 3D printing the STL files attached in steps 2 and 3.

And use hot glue to secure the wires and coins to the Adafruit Capacitive Touch HAT for Raspberry Pi.The Capacitive Touch HAT senses when your finger touches the coin which in this case are dimes, which then sends a signal to the Raspberry Pi python program, that trigger a wave file via the Portable speakers.

Step 1: Things You'll Need

Gather all the Components you'll need

Raspberry Pi model A+

Adafruit Capacitive Touch HAT for Raspberry Pi - Mini Kit - MPR121

SD card

Portable Speaker or you can use you any speaker with an Audio Jack at home.


3D printing Filament

Hot glue sticks

5 Coins - dime's are an ideal size

Bread boarding

Tools you'll need

3D printer

Hot glue gun

Soldering Iron

Screw driver

USB stick

Wi-Fi dongle

Monitor+HDMI cable and wireless keyboard if you are not running Pi headless.

Step 2: 3D Print the Hand

Download the 3D printing software that your printer supports, in my case I am using the Printrbot Simple Metal which use Repetier-Host as a software to

  • Slice the STL files attached,which basically means cutting the part into various layers
  • And send commands to the 3D printer while printing

In my case I am using the Makerbot True Red PLA.

Download the STL files attached for the PiHand_v2.stl

  • slicing should take about a 45-50 seconds
  • and printing should take about 35- 40 mins base on your printer settings.

Step 3: 3D Print the Raspberry Pi A+ Case and Lid

Download the STL files attached

For the PiBasev2.stl

  • slicing should take about 5-7 mins
  • and printing should take about 1Hour 5mins to 1Hour 10 mins base on your printer settings

And for PiLid_CapTouchHatV2.stl

  • slicing should take about a 4-5 mins
  • and printing should take about 30- 35 mins.

Step 4: Preapre SD Card for the Raspberry Pi

If you have just bought a Raspberry Pi, download Raspbian which is operating system for the Raspberry Pi from the link


Follow the installation link to prepare your SD card from the img you just downloaded https://www.raspberrypi.org/documentation/install...

Insert the SD card in the slot of the Pi and boot the Pi up, follow a couple of tutorial to get familiar with the Pi, follow the links below


Step 5: Enableing I2C on the PI

Now for the Adafruit Capacitive Touch HAT to talk to the Raspberry Pi , you will have to enable I2C on your Raspberry PI.

In you Terminal window on the Pi type in the following command

pi@raspberrypi ~ $ sudo raspi-config

Then follow the prompts as shown in the screen shot above

Once done Reboot Pi for the changes to take effect.

pi@raspberrypi ~ $sudo reboot

Now to install python-smbus and to run the commands below you will have have the Pi connected to the Internet , basically run the Pi headless using a Wi-Fi dongle.

Or if you have another Raspberry Pi B,B+or 2 that is already connected to the Modem/router via a LAN cable, pop the SD card and run the commands below.

pi@raspberrypi ~ $sudo apt-get install python-smbus

type Y to accept the changes

pi@raspberrypi ~ $sudo apt-get install i2c-tools

For more details, refer to the following link


Step 6: Download the Code

Now to get the Zip file on to the Pi from


Download the Zip file(using the "Download Zip button")

If you are running your Pi headless just use git to download the code to the folder under /home/Pi, or you can take a short cut by using an USB drive to download it from your Laptop to the USB.

Connect the USB drive to the Raspberry Pi as shown in the picture above and copy the folder into the folder from /media/USB DISK to /home/pi/

Note: If you are running you Pi headless you can use a tool like FileZilla or WinSCP to upload the folder to the Raspberry Pi using the SFTP protocol

The code is based on the famous beetbox project..

Step 7: Setting Up the Pi to Output Via the Audio Jack

By default the Pi output audio via the HDMI cable, to change it to output sound via the Audio jack run the following commands

pi@raspberrypi ~ $amixer -c 0 cset numid=3 1

In addition, run the command shown in the picture above to test to see if you are able to hear the sound via the speaker.

Step 8: Adding the Pi Hat and Running a Quick Test

Connect the Pi onto the GPIO header of the Raspberry Pi as shown in the picture above.

Connect the Pi to Monitor,Portable speakers and using a wireless keyboard , type in the following command and test the Capacitive touch Pi Hat as shown in the Video above

pi@raspberrypi ~$cd BeetBox

pi@raspberrypi ~/PiHand $sudo python beetbox.py

Step 9: Setting the Program to Start Up Every Time the Pi Boot

Before you disconnect the monitor from the Pi , type in the following command to edit the Cron file, so that the python program starts every time the Pi boot. This will eliminate the need of the Monitor in the future.

pi@raspberrypi ~/BeetBox$sudo crontab -e

Add the line

@reboot python /home/pi/BeetBox/beetbox.py &

Once done hit ctrl+X to save(Y) and exit

Step 10: Hot Glue and Screw the Pi to the 3D Printed Base and Pi Hand

Before you add screws to the 3D printed part Hot glue the Pi Hand and the Base part as show in the picture above. Leave it for about 5 mins to dry.

Add the Raspberry Pi A+ to the base and secure the Pi to base using screws.

Step 11: Soldering Wire to the Pi Hat

Approximately measure bread boarding wire from the end of the Pi base to the end of the finger, and use a set of plier to cut and strip the wire.

Bend the wire into the holes from 0 to hole number 4 as shown in the second picture above.

Solder the wire to the Pi hat.

Step 12: Securing the Pi Hat to 3D Printed Lid

Now add a couple of screw's to the on the 3D printed lid and screw the Pi hat to the Lid as shown in the picture above.

Place the Lid on top of the Pi so that the female header on the Pi hat fit on the GPIO pins of the Raspberry Pi.

Once done add the remanning screws .

Step 13: Using Super Glue to the Secure the Wires to the Pi Hand

Strip the ends of the wires. And curl them as shown in the picture above

Using hot glue, attach coins (fingers are size of Dime) to the 3D Pi hand, with the striped wire sandwiched between them.

Press and hold the coin for a couple of minutes

Use a couple of super glue sticks and fill Pi hand level with the edges of the 3D printed part.

Step 14: Learning- How to Finger Drum

Congratulations you have successfully made you own instruments !!

Now make a note of which finger plays what sound, as shown in the picture.

Feel free to modify the code and change the sample wave files attached to fit your style and type of music.

Hot Glue Challenge

Runner Up in the
Hot Glue Challenge

3D Printing Contest

Participated in the
3D Printing Contest

Pi/e Day Contest

Participated in the
Pi/e Day Contest

2 People Made This Project!


  • Make It Bridge

    Make It Bridge
  • Big and Small Contest

    Big and Small Contest
  • Game Design: Student Design Challenge

    Game Design: Student Design Challenge



7 years ago on Introduction

Very nice and innovative. The video is very nicely made and explains how to use this cool musical device


Question 3 years ago on Step 12

Hello, if someone could answer my question it would be really nice.

So I downloaded the beetbox file and ran it on my computer and it came up with this error.

Traceback (most recent call last):
File "/home/pi/BeetBox-master/beetbox.py", line 22, in <module>
File "/home/pi/BeetBox-master/mpr121.py", line 74, in setup
bus.writ_byte_data(address, ELE_CFG, 0x00)
OSError: [Errno 121] Remote I/O error

Does anyone know what this means and how to fix it?

I'm also using all the same gear in step 8 except I'm not using the speaker.


3 years ago

I have made this, works fine, however starting it on startup seems to be a pain in the neck, I can get the script run with the method mentioned but it does not play sounds, have tried about 10 different ways and only sound coming trough is sort of static tick. Any ideas why?


Question 5 years ago

Hi everyone!
I intend to buy this sensor but I'm wondering it's possible to use your own sounds?



Answer 3 years ago

Yes you can, however I think you can only use 24 bit sounds, so need to convert them


6 years ago

I keep getting this error. It seems like I need to fix the code but i don't know how.

Photo on 12-12-16 at 8.27 PM.jpg

Reply 5 years ago

Hi! I have the same problem. Did you finde an explanation to why it reacts that way?


Reply 5 years ago

Sorry for delayed response, but did you enable I2C ? using the command sudo raspi-config

In addition please can you let me know the version of Raspbian you have flashed on your SD card.. Thanks - Carmelito


Reply 6 years ago

Hi !

I have the same error, did you find why ??



6 years ago

Anyone made it. i am going to try I bought all the devices and ready to start. if needed i will post the queries


6 years ago

Thanks, I was having a heck of a time getting mine working. I didn't realize I had to enable i2c on the pi. Your instructions were great, and I got the hat working in no time (though I have to figure out the threshold values; the defaults aren't working if I have the inputs actually connected to anything, but work pressing them with a finger directly).

Tze WeiT
Tze WeiT

6 years ago

Hey, this is amazing. just a question, i was wondering how can you connect these to fruits and conductive material via crocodile clip? it doesnt seem to read off my touch when i do.


Reply 6 years ago

Yes, you can use crocodile clips or regular breadboarding wire..


7 years ago

Nice concept!