Sunday, 15 September 2013

How to - DIY Mini Piano V1.0




Hey guys ! Some of you might know I made a mini piano for my friend using arduino.

So, in this post, I would just roughly explain about the mini piano by providing the Eagle file, the coding and some simple explanation!




So here starts the idea :  

Initially, I plan to build a stylophone instead but due to time constraint and some other reasons, I made a mini piano by using DIY arduino - Atmega328 chip and program the chip using arduino IDE.

You can read more about DIY Arduino from my post :

DIY Arduino

The Mini Piano V1.0 is a double decker board. The bottom PCB board is the controller circuit while the top PCB board is the 13 'piano key' - 5 black key and 8 white key(one octave), speaker, and one LED.



The Mini Piano V1.0 can be powered up either by USB cable or DC power jack. 

Both the boards are done using DIY PCB process and you can read more about DIY PCB here :

How to - DIY PCB 


I used both the 2.54mm male and female headers as a connection between the 2 boards.

Below is the schematics and layouts for both the top and bottom PCB :

Eagle file download

I was making a single layer PCB board. So there were still some jumpers and I just connected them manually using wires.

For the coding part, I am actually using the simple concept of digital button and the tone function to generate melody by using arduino IDE.

Reference for tone function 

Attached together with this post is the coding that I am using for my Mini Piano V1.0 :




Download Code 

I am making this for my friend's birthday ! So, after done everything, by using the Mini Piano V1.0, I played the 'Happy Birthday' and 'Twinkle-Twinkle Little Star' melody. You can have a look at the video below :

Happy Birthday melody :

Twinkle-twinkle little star melody:



This is still my first version of mini piano. So, it might have some problems and to be improved in the next few versions in future.

Any comments and suggestions are welcome !

Thank you for reading and hope you do enjoy reading this post.

Thank you :)



-VK