## Introduction: Simple Electronic Piano

Electronics can make sounds very easily with just a handful of parts. Here's how to make a simple piano using a 555 timer. I designed and tested this circuit using 123D Circuits, and then built the real thing.

Here's everything you'll need:

• 1 x 555 timer (Jameco)
• 8 x pushbuttons (Jameco)
• 1 x 100 nF capacitor (Jameco)
• 1 x Resistor assortment - 390Ω, 620Ω, 910Ω, 2 x 1kΩ, 1.1kΩ, 1.3kΩ, 1.5kΩ, 6.2kΩ (Jameco)
• 1 x Piezo buzzer (Jameco)
• 22 AWG hookup wire (Jameco)
• 1 x 9V battery connector (Jameco)
• 1 x Solderless breadboard (Jameco)
• 1 x 9V battery

## Step 1: A Little Background

If you don't care about how this thing works and want to get straight to putting it together, then skip on ahead to the next step.

This piano uses the astable mode of a common 555 timer integrated circuit to produce the tone that drives the speaker (piezo buzzer). If you are curious about how a 555 timer works, and the different configuration modes, there's a good Instructable about it here.

Each musical note has a main frequency, which is how many times per second the thing producing the sound vibrates back and forth per second. The frequency produced by a 555 timer in astable mode relies on the values of the capacitor (C) and two resistors (RA & RB). This relationship is

I decided to design this so that RA and C are the same for all the notes (RA is 1kΩ, and C is 100 nF). This leaves RB to set the tone. So for any particular frequency,

The way this thing is wired, for any particular button RB is the value of all of the resistors from the button to the end of the resistor chain to the right added together. So it was a matter of finding the right chain of resistors to make this work. The following table shows how the resistors were chosen. Starting with the highest note, RB was calculated for each note, and commonly available resistors were chosen to approximate RB.

Notefreq. (Hz)RB (Ω)Resistor(s)
C5523131511.5kΩ + 1.3kΩ + 620Ω + 1.1kΩ + 1kΩ + 910Ω + 390Ω + 6.2kΩ
D5587116621.3kΩ + 620Ω + 1.1kΩ + 1kΩ + 910Ω + 390Ω + 6.2kΩ
E565910335620Ω + 1.1kΩ + 1kΩ + 910Ω + 390Ω + 6.2kΩ
F569897271.1kΩ + 1kΩ + 910Ω + 390Ω + 6.2kΩ
G578486111kΩ + 910Ω + 390Ω + 6.2kΩ
A58807617910Ω + 390Ω + 6.2kΩ
B59886731390Ω + 6.2kΩ
C6104763256.2kΩ

Because of the choice to use commonly available resistors to approximate the values desired, the tones are a little bit off, but not by much.

## Step 2: Try Before You Buy Parts

I first "built" this circuit in 123D Circuits to try it out and make sure everything worked before putting the real circuit together. This allowed me to try different resistor values and configurations (for free!) before settling on the final design. I was even able to hear what it sounds like in my browser.

Here's the piano in 123D Circuits. Press "Start Simulation" to try it out.

## Step 3: Put It Together

After collecting the parts from the list at the beginning of this Instructable, it's time to put it together.

The long rows at the top and bottom of the breadboard are intended to to connect power (+9 volts and ground) from the battery to the rest of the circuit. These rows are electrically connected all of the way across and act as a wire between components pressed in their holes. Eventually, the black wire (ground) will be connected to the row at the bottom, and the red wire (+9 volts) will be connected to the row at the top. Don't do this yet. You will connect the battery last.

Similarly, each column of 5 holes in the center area is electrically connected. So any two things plugged into the same column are connected as if by a wire. Note that the columns above and below the empty area in the middle are electrically separate.

Start off by placing the 555 timer chip in the breadboard. It will be aligned so that the dot on top of it (pin 1 indicator) is in the lower left when you are looking at it. Place it toward the right side of the breadboard so that the pins straddle the empty channel running down the center of the breadboard. Carefully press it down with even pressure until all of the pins have entered their holes and the chip sits flat on the surface of the breadboard.

The pins of the 555 are numbered 1, 2, 3, 4 on the bottom from left-to-right and 5, 6, 7, 8 on the top from right-to-left. They run counter-clockwise starting at the lower left.

Connect pin 2 to pin 6 of the 555 using an appropriate length of hookup wire. You can see this as the green wire in the pictures above. Connect pin 1 to the ground row at the bottom. Connect pins 4 and 8 to the +9 volts row at the top of the board.

Carefully bend the leads of one of the 1kΩ resistors (brown-black-red) and connect it between pin 7 of the 555 and the +9 volt row at the top.

Connect the capacitor between pins 1 and 2 of the 555.

If the piezo buzzer that you have has bendable wires, then connect the positive (red) wire to pin 3 of the 555 timer. Connect the negative (black) wire to the ground row at the bottom. Otherwise, if your piezo has rigid pins, then place it over the breadboard to the right of the 555 with the negative pin somewhere on the ground row. Locate where the positive pin will connect with the breadboard, and put a hookup wire to connect that column with pin 3 of the 555. Then press the piezo in place.

Now, for the buttons. Start by putting a small hookup wire between pin 7 of the 555 and some column to the left (see the orange wire in the picture above). Locate the 6.2kΩ resistor (blue-red-red) and connect it between the other end of this hookup wire and another column to the left.

Place one of the pushbuttons so that it straddles the channel in the middle of the breadboard with the top-right pin on the same column as the resistor. Carefully push it into place so that it is fully seated in the breadboard. Connect an appropriate length hookup wire between the lower right pin of the button and pin 2 of the 555.

Now it is time for a quick test! Connect the black wire of the battery connector to the bottom (ground) row and the red wire to the top (+9 volt) row. Connect the battery to the battery connector. Try pressing the pushbutton and you should hear a tone! If you don't hear sound, then recheck all of your connections, make sure the battery is good and try again. After this test, disconnect the battery.

Now each of the remaining buttons are added from right-to-left. Connect the resistor from the column of the previous resistor to where the next button will be (4 rows to the left in the pictures above). Place the next button in place with the top-right pin at the other end of the resistor. Connect a small hookup wire between the lower-left pin of this button and the lower-left pin of the button to the right. Do this for all of the buttons. The resistors in order from right to left will be:

• 390Ω (orange-white-brown)
• 910Ω (white-brown-brown)
• 1kΩ (brown-black-red)
• 1.1kΩ (brown-brown-red)
• 620Ω (blue-red-brown)
• 1.3kΩ (brown-orange-red)
• 1.5kΩ (brown-green-red)

After all the resistors and buttons are in place, reconnect the battery and start playing!

jqubrfoe (author)2016-12-22

Is there a way to have a led for each individual button, which goes on when you push the button? I can't get a led working and a sound at the same time. Can you tell me how to wire it? Thanks

joshua.brooks (author)2016-12-22

The easiest way to do this is to replace the switches with DPST (double-pole single throw) pushbutton switches. One pole would operate exactly as it does now. The other pole would connect an LED/resistor circuit.

You can simulate this here: (https://circuits.io/circuits/3581159). I replaced the low C pushbutton with a DPST DIP switch and connected an LED and resistor to the other pole. In practice, you'd want a momentary switch (only closed as long as it's being pushed) instead of a flip switch. But this illustrates the point.

JieL5 (author)2016-09-13

Just one question...the pitch it makes is incredibly high and it increases slowly...then a single frequency is made....confused

JieL5 (author)2016-09-01

Thank you Joshua! Your detailed explanation helped a lot! I am trying to make it with adjustable resistors and a switch between an configuration of Major and Minor key. Hopefully I can make it!

scienceclassstruggles (author)2016-05-24

I am still having trouble understanding how the frequency works with the 555 timer. What is the "thing" producing the sound?

2016-05-24

In the astable configuration, the 555 is designed to oscillate its output (pin 3) by alternately charging and discharging the capacitor. Take a look at this instructable: https://www.instructables.com/id/555-Timer/step5/555-Timer-Astable-Mode/
It discusses the 555 astable mode in great detail.

scienceclassstruggles (author)2016-05-23

Hi, I was wondering if we could replace the 555 timer chip for something else? If so, with what?

2016-05-23

Also what is the purpose of the resistors in this circuit?

2016-05-23

The resistors are used to set the frequency of oscillation (i.e. the note produced).

2016-05-23

It could be replaced with any simple oscillator that works in this audio frequency range. For example, an inverting Schmidt trigger oscillator could work. Here's a page that discusses the Schmidt trigger oscillator: http://electronics-course.com/schmitt-trigger-oscillator. The circuit would have to change to accomodate the different parts, though. This would include the choice of resistors and capacitor used.

RobertT93 (author)2015-12-01

I'm having some difficulty building this. I've tried several different 555 chips and several different buzzers. All I can manage is a constant ringing tone. I've duplicated your work as closely as I can. Help!

joshua.brooks (author)2015-12-01

There are some piezo buzzers that are designed to produce a constant tone when a voltage is applied. Is it possible that your buzzers are this type? The way to determine this is to apply a voltage directly across the piezo terminals without the rest of the circuit. If you hear a tone from it, then this piezo cannot be used for this project.

2016-05-23

Hi, I was wondering if we could replace the 555 timer chip for something else? If so, with what?

RobertT93 (author)2015-12-08

that was part of it. the other part was that I was using an electrolytic capacitor instead of a ceramic. changed those two things and it works like a charm.

joshua.brooks (author)2015-12-09

So glad to hear it. I hope that this project was fun and instructive!

I was able to finish the circuit, but the buzzer makes a continuous sound rather than a Tone, so what might be the error?

mjihan96 (author)2016-03-20

we're you able to fix the problem with your buzzer ??

mjihan96 (author)2016-03-20

were you able to get the exact value for the resistor. if so from where

JoãoC47 (author)2016-02-04

I got the same problem but only when I solder it into a circuit board. were you able to solve it?

Dear Joshua,

thanks again for this wonderful circuit. Ever since i made it on the breadboard i wanted to do a version for my son, including an on/off switch and wrapped up into a housing. Finally i finished it and he loves it - as well as i do!

joshua.brooks (author)2016-01-25

That looks great! This is a good project for kids learning electronics, so well done.

hmanwhite (author)2015-12-02

Joshua,

I am trying to add an amplifier to this circuit to control the volume of the pitches played. Can you help me out with that?

joshua.brooks (author)2015-12-08

The output of the piezo on this is already pretty good. Adding an amplifier that uses the same 9V power source will not increase the volume, but can be used with a feedback potentiometer to adjust the volume down. A far simpler way to achieve this however is to put a 10k potentiometer between the output of the 555 and the piezo. Connect one of the outside pins of the potentiometer to the output of the 555 (pin 3). Connect the other outside pin of the potentiometer to the negative side of the battery (same as pin 1 of the 555). Connect the wiper (center pin) of the potentiometer to the positive input of the piezo. Here's a modified version of the 123D Circuits design that you can use to try this out: https://123d.circuits.io/circuits/1346358-simple-555-piano-with-volume-control

JulianS5 (author)2015-12-01

could I somehow add another resistor to go to the 555 like the ones for having the buttons at a certain frequency, but to drop the tone an octave? and if so, what resistance would i need?

joshua.brooks (author)2015-12-01

This is a great idea! A resistor won't do it, but adding another 100nF capacitor in parallel to C would drop the frequency in half (lower the tones by an octave). Here's a circuit to show how to do it: https://123d.circuits.io/circuits/1319355. You can simulate the circuit to try it out. Shift+click the button by the capacitors to engage the second capacitor and lower the tone by an octave.

Danielle94 (author)2015-11-19

Hi. I'm wondering if i can add a LED diode here in the circuit, the idea is if i press the button, it will make a sound and light the LED. What modifications should i do?

joshua.brooks (author)2015-11-19

You can add an LED with a 510 Ohm resistor, controlled by an NPN transistor. One side of the resistor is connected to +9V (positive terminal of the battery). The other side is connected to the anode of the LED. The cathode of the LED is connected to the collector of the NPN. The emitter of the NPN is connected to ground (negative terminal of the battery). The base of the NPN transistor is connected to the output from the 555. I've put a simulation example of this on 123D Circuits: https://123d.circuits.io/circuits/1265548. I hope this helps!

Danielle94 (author)2015-11-20

Thank you for the special schematic! But what i meant is that in every button, there is a designated LED that will light every time that button is pushed. I run simulations on livewire, but the LED keeps on exploding everytime i play the simulations :(

joshua.brooks (author)2015-11-20

If I understand you correctly, the button that you are using has an internal LED that is supposed to light when the button is pushed, correct? If this is the case, typically these buttons have 4 connectors: 2 for the switch, and two for the LED (anode & cathode). This LED is just like any other and needs an external resistor added in series to limit the current through the LED. If you don't have this limiting resistor, too much current will go through the resistor and it will "explode" in simulation. So instead of connecting power directly through the LED, try replacing your direct connection to one of the LED terminals (doesn't matter which one) with a 510 Ohm resistor.

Kiteman (author)2015-11-18
NW66 (author)2015-11-09

i'm wondering if a NE555N can be used instead of the LM55t?

This was really fun to make. I had to shorten everything since I only have small breadboards and use a 1,2k resistor instead of the 1,1k but overall it's really great!

I don't have any backgrounds with electronics so this was a good way to start :)

joshua.brooks (author)2015-10-23

Wow great! I love it.

Somehow it's not working with my piezo buzzer (DC-9V) since it's making a permanent buzz (and a very loud one)... Luckily the speaker is doing its supposed job. Anyone an idea how to deal with the piezo?

LittleHairyApe (author)2015-10-22

Chuck it. Piezo buzzers only produce a very narrow band of frequencies or a single frequency. It sounds like you've got one of those, since the rest of the circuit works with a speaker.

Mark 42 (author)2015-10-22

I wonder how much more it would take to make this into a simple (crude) MIDI trigger.

terrible tinkerer (author)2015-10-22

Very, very cool! Thanks for posting.

Raphango (author)2015-10-22

Great use for the 555! xD

PatrickP10 (author)2015-10-19

I don't have any problem for the parts' names they already showed to us, if I Google each of them I will find a result positive, but my frustration is for example : if I go in a store to buy a piano I may find the complete piano I am looking for, this mean if after couples years I have an issue with the sound board of the piano I will to use screw drivers to open the chassis of the piano and to figure out what component or components inside of the piano need to replace. Next example: if I go to buy a computer in a store I will see a full computer, if I want to upgrade it or adding hardware inside that computer I have to remove the box. I would like to see the size of the chassis or the box to fit all the piano's components; I only see just the components, but without the chassis how am I going to buy a perfect Chassis to screw that board inside it?

joshua.brooks (author)2015-10-19

Links to the components used for this project are on the parts list (click the Jameco links). This is not intended to be a commercial project. This instructable is just to show what can be done with simple hobby electronics.

PatrickP10 (author)2015-10-19

Okay,

I understand that,

I would like you to understand that, but I don't believe people in U.S - Canada and others countries have money to throw in the garbage, the way the company try to open a way to make some money a lot of us want to make some money too, we can't learn for fun. The way you talk this mean the company is wasting my time time because what the company is looking for I want it too, what is the point of learning something I can't even make a profit? If I want a piano I will just buy one in a store.

DonD10 (author)2015-10-22

Wow, it appears you have really missed the point of this 'ible and perhaps the point of this site.

1. Many people learn better by doing than by reading.
2. Because this is not permanent, no money is "thrown in the garbage" as all of these parts can be used in the next project.
3. Even if you were to toss this in the trash after building (not that I would), the build cost is worth it if it inspires a child to build bigger, better things based on the principles that are learned.
4. For most of us, this is FUN :) I could spend a couple hundred dollars on an XBox plus hundreds more for games, or I could spend a small fraction of that on misc. diodes, resistors, ICs, etc that I will get the same joy from while actually learning while I 'play'

We share ideas via 'ibles to learn, not merely to build something that can be built cheaper by slave labour in China - to learn /how/ things work. Once we really understand /how/ things work, we can make things that are unique that fill a need or desire in our lives. I will build this with my daughter not because we need a tiny keyboard, but as a learning exercise as I have almost all of these components on hand anyway and since we'll take it apart after, the whole learning exercise will cost about \$2USD plus the time spent together.

I'm currently building worthless stepper motor projects to gain a better understanding of how they work in the hopes of building a robotic tripod head (panoramic photos) for my DSLR (which, of course, I'll make an 'ible for). I only ever intend to make 2 (my daughter is a photographer too), but with an estimated build cost of \$25-50 compared to a commercial product that costs about \$1000, my motivation is to make something I want that I couldn't possibly afford.

I hope this helps you wrap your head around why we waste time building things we don't necessarily need and hope you find joy in whatever your hobby is.

Insonicbloom (author)2015-10-22

you have come to the wrong place to make money - this is a place where people make things for fun, learn things because they can and share knowledge because that's what being human is about. if you can only learn for money then I suggest you go to university or something.

when it comes to a chassis - use your imagination or a ruler

AttilaTheHun (author)2015-10-22

Hi Patrick, I think you're missing the point of the exercise. The idea is to construct a version of a simple electronic organ using very basic parts. What you get out of it is knowledge about how this stuff works and a sense of satisfaction in having mastered a concept that is arcane to most of the population. This is not about making a working organ/piano.

Here is what the project is not: 1) high quality electronic organ, let alone a piano, 2) complete instrument (only covers one octave), and 3) permanent construction. These features would only add complexity, cost, and troubleshooting headaches to the project, not to mention significant risk that it wouldn't work at all. None of these are part of the overall project goals.

As far as suppliers go, I'd suggest checking the usual suspects -

mouser.com, digikey.com, newark.com, allelectronics.com, jameco.com, sparkfun.com, adafruit.com and whoever else strikes your fancy.

P.S. This project is about knowledge of electronics and circuitry and how they relate to the real world. This is definitely valuable to employers. In other words, you can definitely make money from it.

PatrickP10 (author)2015-10-19

Hi,

My question is about, for example: if the company teach us about a keyboard, I would like to see a proper keyboard with the keys, knobs, all the buttons with the future, the On/Off button etc. the caisse or the chassis and the components who suppose to come inside.

tinaciousz (author)2015-10-19

Excellent ible Joshua!

BlueCoyote (author)2015-10-18

Gracias. Buen artículo para experimentar con el 555, lo voy a hacer.

brinesharks (author)2015-10-18

Thanks for a great Instructable - building it now with my kids. Had most parts lying around! The 123D Circuits is very nifty especially with it generating a circuit board layout too. If the kids have fun, I might make the board so they can see how prototyping ends up as a finished circuit.

joshua.brooks (author)2015-10-18

Yay! That's agreat idea. I've ordered circuit boards to build with my kids too!

mxx (author)2015-10-18

How nice, and great presentation!