top of page

How to make a Piano using Arduino?

Updated: May 22

In this DIY project, we will make a piano using Arduino UNO, buzzer and few buttons.

Hardware requirements:

Arduino UNO:

Arduino UNO
Arduino UNO

The Arduino is a programmable #microcontroller, it's an open-source electronics proto-type platform. It interacts with the user by receiving input with the aid of sensors and provides the output employing LED, buzzer, etc.,

In order to know more about the Arduino UNO, refer to this article.



The Buzzer is an audio signaling device, in this case when it detects an object, the buzzer gives a beep sound.



A breadboard is a flat piece of wood that is provided with holes that allow users to build a circuit including the components and connections without the need for soldering due to which it is reusable and finds its best usage for the students who are new to build circuits. The holes in any horizontal line will be in series whereas the vertical holes remain at an equipotential state. There are different sizes of breadboards available in the market which include "full size", "half size" and, "mini size" breadboards.

Connecting wires:

Connecting wires
Connecting wires

Connecting wires are used to establish connections between different components in the circuit.



Resistor as the name signifies, opposes the flow of electrons. The Resistor is a passive element and has two terminals. They are basically used to monitor the current flow and also as voltage dividers. The #resistor that we would use in this circuit is a 10 k-ohm resistor and the color code for this resistor is Brown, Black, Orange & Gold.

Pushbutton switch: Pushbutton switches are mechanical devices that make or break an electrical connection by the closing or opening electrical contacts or solid state circuitry when actuated by human or mechanical interaction.

Pushbutton switch
Pushbutton switch

Software requirements:

Arduino IDE:

Arduino IDE logo
Arduino IDE logo

The Arduino Integrated Development Environment (IDE) is a cross-platform application (for Windows, macOS, Linux) that is written in functions from C and C++. It is used to write and upload programs to Arduino compatible boards, but also, with the help of third-party cores, other vendor development boards.

Circuit connection:

Circuit connection involves the following steps:

  • The breadboard is powered using the Arduino.

  • The positive terminal of the buzzer is connected to 13th pin of the Arduino, negative terminal is connected to the ground.

  • Connect 8 pushbuttons to digital I/O pins of the Arduino from pin2 to pin9 respectively, they act as tone input pins.

  • Pull up resistors are connected to the terminals of the pushbuttons and the remaining terminals are grounded.



After powering and uploading the code into Arduino, once we execute the code, our setup will be now ready to test. We can press the push buttons to get sound in different frequencies allotted to each of the buttons. You can change the frequency of any button if required (and it has to be done by specifying the required frequency in the code).

Video By - Amber Bhattacharya


See also:

Follow us -

Please do follow us i.e #learnelectronicsindia to get daily updates about new blogs, videos, courses, quizzes and contests.

Content Written by-

Name - Kiranmai Chigurupati

Portfolio Link - click here

1,112 views2 comments

Related Posts

See All


LearnElectronics India's explanation is spot-on. Great work!


Anushka Gupta
Anushka Gupta

This blog post is simply phenomenal! The clarity of instruction, along with the attention to detail, makes it stand out as an incredible resource for DIY electronics enthusiasts. The fact that Learn Electronics India made building a piano using Arduino so accessible is commendable. I'm excited to dive into more projects like this.

bottom of page