Raspberry Pi Music Fingers

by CJA3D in Circuits > Raspberry Pi

31498 Views, 219 Favorites, 0 Comments

Raspberry Pi Music Fingers

Pi Hand Finger Drumming Demo
IMG_5046 copy 2.JPG
IMG_5036 copy.JPG
IMG_5014.JPG

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.

Things You'll Need

IMG_4938.JPG

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.

Screws

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.

3D Print the Hand

IMG_4909.JPG
IMG_4906.JPG
Screen Shot 2015-04-19 at 6.49.36 PM.png

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.

Downloads

3D Print the Raspberry Pi A+ Case and Lid

IMG_4910.JPG
IMG_4888.JPG
Screen Shot 2015-04-19 at 9.42.42 PM.png

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.

Preapre SD Card for the Raspberry Pi

Screen Shot 2015-04-19 at 9.55.22 PM.png

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

https://www.raspberrypi.org/downloads/

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
https://www.raspberrypi.org/resources/learn/

https://www.raspberrypi.org/help/

Enableing I2C on the PI

learn_raspberry_pi_advancedopt.png
learn_raspberry_pi_i2c.png
learn_raspberry_pi_i2ckernel.png
learn_raspberry_pi_wouldyoukindly.png
IMG_4850.JPG

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

https://learn.adafruit.com/adafruits-raspberry-pi...

Download the Code

IMG_4936.JPG

Now to get the Zip file on to the Pi from

https://github.com/CJAndrade/BeetBox

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..

Setting Up the Pi to Output Via the Audio Jack

IMG_4862.JPG

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.

Adding the Pi Hat and Running a Quick Test

IMG_4916.JPG
IMG_4921.JPG
Testing Adafruit Capacitive Touch HAT for Raspberry Pi

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

Setting the Program to Start Up Every Time the Pi Boot

IMG_4954.JPG

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

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

IMG_4952.JPG
IMG_4946.JPG
IMG_4948.JPG

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.

Soldering Wire to the Pi Hat

IMG_4958.JPG
IMG_4961.JPG
IMG_4967.JPG
IMG_4968.JPG

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.

Securing the Pi Hat to 3D Printed Lid

IMG_4973.JPG
IMG_4974.JPG
IMG_4979.JPG

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 .

Using Super Glue to the Secure the Wires to the Pi Hand

IMG_4983.JPG
IMG_4984.JPG
IMG_4986.JPG
IMG_5008.JPG

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.

Learning- How to Finger Drum

IMG_5036.JPG
IMG_5026.JPG

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.