Arduino Piano/ Sound Board

Arduino Piano made for Alien3d UFO Mystery Box for Oct 2022
44
333
2
2080
updated November 29, 2022

Description

PDF

This is a piano that runs on an Arduino with a MP3-TF-16P mp3 player module. When the note keys are pressed the Arduino reads that and send the proper command to the mp3 module to play that note. It can be used as a piano by using the mp3's I have provided or can be a soundboard by placing your own mp3 files on the SD card.

 

UPDATE:

For anyone who downloaded the Arduino code before the Nov 5th please download the one available now (pianov3) as the old code would not work with the boards sent out in the ufo project box.

Wiring Diagram updated as mp3 moldule was upside down.

 

Printing:

All parts saved as STL are in the correct orientation, and no supports are needed if printed in that orientation.

 

Components:

  • 1x ESP-WROOM-32
  • 1x MP3-TF-16p w/ SD card
  • 1x 8ohm 2W speaker
  • 12x 6mm push buttons
  • 8x M3x6 screws (not included in UFO box) [3d printable peg included in model as alternative]
  • Wires (not included in UFO box)

 

Wiring Diagram:

Note: The piano pdf included below is the same wiring diagram as here but you can zoom in for better detail.

 

Assembly:

Place the push buttons into the button holders. Then solder wires onto the buttons. I highly suggest you follow the wiring diagram picture and solder the buttons diagonally as the pins are in pairs and is you do it diagonally you avoid soldering a pair together and shorting the button. Place the buttons in the holder into the bottom using a screw/peg to hold them in place then thread the wires under the opening leading to the back so it can be connected to the Arduino. Solder wires into the speaker and place it into the grill location on the bottom and then you can place the Arduino in place and the mp3 module and finish wiring things up. 

The piano keys pop into place, followed by the key guard sliding in from the top. The Lid hinge pops into the key guard and the lid pops into the base.

 

Preparing the MicroSD Card:

First you will want to download the mp3.zip that I included below and extract the contents of the zip file to the root of the sd card. You should end up with an mp3 folder in the sd card and inside that folder are 12 mp3 files.
If you wanted to make a soundboard instead this is where you would replace the mp3 files in that folder with your own mp3 files but the must be named in the same format of 00XXname.mp3 where XX is a number from 01-12 and name can be whatever you like (you can actually skip the name part and just save them as 0001.mp3 for example)

 

Programming:

There are 2 ways you can program the board.

Arduino Web Editor:

One way is to use the Arduino web editor. I have uploaded the code to the Arduino website and shared it below this should make it simple to use and program. Just follow the websites directions on getting the needed plug in installed. The board you would select is the esp32 dev module

https://create.arduino.cc/editor/dsk001785/f33cd6a5-d6aa-43c8-b625-73dd2cf9dc73/preview

Locally on PC:

To flash the board locally on your pc you will need a few things.

First you will need the Arduino IDE installed on your computer. Which you can install from 
https://www.arduino.cc/en/software . If you are using windows 11 I would suggest to download and install the legacy IDE version as new one gets some access denied errors.

Once the IDE is up and running you will need to install a few libraries and the esp32 board.

First thing you will need is to install the Espressif esp32 board library. You can do so by following the tutorial on the website below: [Note for our board select the esp32 dev board]

https://randomnerdtutorials.com/installing-the-esp32-board-in-arduino-ide-windows-instructions/

Next you will need some libraries which you can install by following:
https://create.arduino.cc/projecthub/akshayjoseph666/adding-library-in-arduino-ide-7deb01

The libraries you will need are:

  • DFRobotDFPlayerMini

After the board and libraries are installed you can open up the piano.ino file included. It will give you a pop up that the piano.ino needs to be inside a sketch folder named piano, you should be able to click ok and it will do it for you.

You can the select the board Esp32 Dev Module and the correct port and click upload.

This should compile the code and send it to the board for you!

 

Special Thanks:

I would like to thank SingleInfinity on Reddit who created and shared the mp3 sounds that I used for the piano
https://www.reddit.com/r/piano/comments/3u6ke7/heres_some_midi_and_mp3_files_for_individual/

 

Post and Share
I love seeing  the community makes please feel free to tag me @dsk001_3D and @alienslacker on Instagram and twitter  


 

Tags



Model origin

The author marked this model as their own original creation.

License