# Toy Piano Project

Discussion in 'The Completed Projects Collection' started by edwardholmes91, Apr 29, 2013.

1. ### edwardholmes91 Thread Starter Active Member

Feb 25, 2013
201
20
555 Timer Toy Piano

Hello everyone, I am an electronic engineering student studying at Staffordshire University and currently completing an industrial placement. I was given the most amazing opportunity ever at Christmas, the chance to visit the USA for 3 months during the summer and teach children, but not only that, I would be teaching them electronics! For two months I will be working at a Science and Engineering Camp in PA teaching children ages 8 – 17 electronics and touring for a month before returning to the UK to complete my final year of studies.

I have been told that the camp has projects available for the children and the children may also design their own if they wish. I was also asked to bring an idea/project with me to camp that I could teach the children.

I set about looking for suitable projects. Having just purchased a series of Mini Engineers notebooks written by Forrest M. Mims I started to flick through the circuits listed, looking for one that may be suitable. I immediately stumbled upon a 555 timer circuit that made a toy organ. I studied the circuit and couldn't believe I had never seen or thought of such an ingenious circuit before! It consisted of a 555 timer and various selectable values of C1 that were wired in parallel.

Toy Piano as viewed from the top.

Toy Piano as viewed from the base.

Schematic

Looking at the design I thought surely instead of selecting a different capacitance you could select a different resistance by changing say R2? Resistors are available in a much wider selection of values and they are cheaper… it’s a win win situation! I initially thought of just chaining lots of 1K resistors together and using a stylus to select which one I wanted, the further along in the chain, the higher the resistance and hence the lower the frequency. Then it occurred to me… surely I could re-produce the different frequencies of actual notes? I found a table on the internet with the different frequencies of notes on a piano, having extracted the values I wanted (Middle C (C4) to (C6)), I set about calculating appropriate resistor values. Using Excel I was able to calculate the different values that were needed and making use of the “goal seek” feature I could home in on an exact frequency by changing a resistor value. Once I had all of the resistor values I needed I decided a pre-set resistor could be used for the first note and then E12 values could be used for the other notes. I worked out which values I needed and then worked out the actual output frequency assuming 0% tolerance on the resistors. This allowed me to calculate the difference between the real frequency and the actual frequency. I was surprised to find out that the maximum deviation was only 0.915%

Armed with a circuit that I had drawn up using Circuit Wizard I breadboard the circuit to test it. Sure enough when a different resistor was selected on the breadboard using the piece of wire to simulate a stylus I got a different note! Despite some of the notes being off frequency a little I was pleasantly surprised at the quality of the notes produced. I did consider adding a variable resistor for each note to allow tuning of every note, but I decided this really wasn't necessary and I wanted to keep it nice and simple for the children I would be teaching it to. Any component that wasn't necessary was removed!

It was time to design the PCB. Taking inspiration from the Stylophone I came up with a PCB pattern using Circuit Wizard and set about manufacturing the PCB. I was using the toner transfer method for the very first time (having been used to the photo-resist method previously), so this was all very new to me. I printed the artwork onto a piece of acetate and placing a piece of baking paper on top of the acetate I started to iron it to the copper side of the PCB. I hadn't seen this method of using acetate directly onto a PCB used before so I was keen to try it. Once cool the artwork was peeled off leaving the toner transfer on the board. It was a little patchy in places so I grabbed an indelible pen and filled in some of the areas that needed it. The board now fully prepared was ready for etching. Placing the board into warm ferric chloride solution and rocking the processing tray back and forth my very first toner transfer PCB was etching before my eyes. Once etched I removed the toner using nail polish remover and once clean gave the board a good soaking in some tin plating solution to give the keys a nice durable finish. I drilled the board using a miniature hobby drill and stand and the board was complete.

This was the first time that I had used tin plating and I couldn't believe how easily the components soldered in place! I gave the board a quick functional test and was delighted to see that it worked first time.

I decided to showcase the circuit in all its glory by designing a really simple two piece clear Perspex case, which was cut using a laser cutter. The board was held in-between the two pieces using brass hexagonal supports and screws and the toy piano was complete… well nearly. I still needed a stylus! Scratching my head trying to think of something to make a stylus with, it suddenly dawned on me. I took an old pen and removed the ink, feeding a piece of cable screening down the tube I was able to splay it out on the end and heat shrink it in place. I soldered a little piece of wire to the end and viola, one simple stylus!

I then set about making a handbook for my new toy, explaining the design phases and how the children could build one too. I will be using this whilst teaching them how to build it in the summer. I have attached a copy if you are interested? Also included is also a page which details all of the parts which can be sourced from Rapid. Rapid Electronics deliver worldwide and they offer very competitive prices. I have included the parts list on the next post because it wouldn't fit in this one.

I have also attached copies of the schematic, a ZIP of the DXF files for the Perspex and the artwork and normal layout view in ZIP of the PCB. Please note, if printing the artwork for the PCB, ensure you select "No Scaling" on the print options. I advise printing out on paper first and testing by pushing the components through the paper. Things like DIL IC holders etc. will show you if the output is scaled or not.

Please do feel free to comment and make suggestions. I will of course keep you updated and let you know how the summer camp goes. Really excited and can't wait to go! I love teaching children and I love electronics, so I couldn't ask for a better summer!

File size:
73.1 KB
Views:
180
File size:
2.3 KB
Views:
60
File size:
91.4 KB
Views:
78
File size:
45.4 KB
Views:
753
File size:
44.5 KB
Views:
798
File size:
848.4 KB
Views:
139
2. ### edwardholmes91 Thread Starter Active Member

Feb 25, 2013
201
20
Toy Piano Price List

Circuit

 Item Description​ Rapid Order #​ Quantity​ Unit Price​ Line Total​ Line Total (Inc VAT)​ NE555 Bipolar Single Timer 82-0336​ 1​ 0.17800​ £0.18​ £0.22​ 8 Pin DIL Turned Pin Socket 22-1757​ 1​ 0.08950​ £0.09​ £0.11​ Carbon Film 0.25W 470R Resistor 62-0362​ 4​ 0.00526​ £0.02​ £0.03​ Carbon Film 0.25W 560R Resistor 62-0364​ 4​ 0.00526​ £0.02​ £0.03​ Carbon Film 0.25W 680R Resistor 62-0366​ 3​ 0.00526​ £0.02​ £0.02​ Carbon Film 0.25W 820R Resistor 62-0368​ 3​ 0.00526​ £0.02​ £0.02​ Carbon Film 0.25W 1K Resistor 62-0370​ 4​ 0.00526​ £0.02​ £0.03​ Carbon Film 0.25W 1K2 Resistor 62-0372​ 4​ 0.00526​ £0.02​ £0.03​ Carbon Film 0.25W 1K5 Resistor 62-0374​ 3​ 0.00526​ £0.02​ £0.02​ Carbon Film 0.25W 12K Resistor 62-0396​ 1​ 0.00526​ £0.01​ £0.01​ Carbon Preset 0.1W 2K Resistor 67-0408​ 1​ 0.11100​ £0.11​ £0.14​ Ceramic Capacitor 2.5mm 100nF 50V 08-1015​ 1​ 0.15800​ £0.16​ £0.20​ Electrolytic Capacitor 10uF 25V 11-0220​ 1​ 0.04100​ £0.04​ £0.05​ Kingbright Super Red 3mm Low Current LED 56-0415​ 1​ 0.14800​ £0.15​ £0.19​ 2 Way 16A Interlocking Terminal Block 5mm 21-1810​ 2​ 0.08400​ £0.17​ £0.21​ 50mm Ultraslim Loudspeaker 8R 35-0128​ 1​ 0.68300​ £0.68​ £0.85​ Ultraminiature Right Angled Slide Switch 78-0691​ 1​ 0.25700​ £0.26​ £0.32​ Procell AA Batteries 2700mAH 18-3350​ 3​ 0.26100​ £0.78​ £0.98​ 3x AA Battery Holder 18-0126​ 1​ 0.48900​ £0.50​ £0.62​ Heavy Duty PP3 Battery Clip 18-0092​ 1​ 0.17600​ £0.18​ £0.22​ Single Sided FR4 Copper Clad PCB (cm^2) 34-0365​ 260​ 0.00532​ £1.38​ £1.73​ Totals:​ £4.83​ £6.03​

Casing

 Item Description​ Rapid Order #​ Quantity​ Unit Price​ Line Total​ Line Total (Inc VAT)​ 3mm Clear Acrylic Sheet (cm^2) 06-0600​ 420​ 0.00262​ £1.10​ £1.38​ Pozi Pan Head M3 6mm 33-2300​ 6​ 0.00830​ £0.05​ £0.06​ Pozi Countersunk Head M3 10mm 33-2952​ 6​ 0.01940​ £0.12​ £0.15​ Hexagonal Male - Female Brass Spacer M3 5mm 33-3590​ 4​ 0.11640​ £0.47​ £0.58​ Hexagonal Threaded Brass Spacer M3 20mm 33-3555​ 6​ 0.16160​ £0.97​ £1.21​ Clear Feet 6mm Dia X 1.9mm 31-0610​ 4​ 0.01964​ £0.08​ £0.10​ Totals:​ £2.79​ £3.48​

The prices are in GBP (Great British Pounds). The line total is the cost of the items less tax and the column to the very right includes tax. This may be different in your country. At the current exchange rate this is about \$15USD for both the case and the PCB.

A slightly cheaper solution could be to just use four PCB pillars to support the board and not bother with the Perspex case.

It is worth noting, that these prices are calculated per item and not all items may be bought individually. For example the resistors are sold in packs of 100. The cost of the sheet material is worked out per cm^2 however they are not sold in exact sizes.

PLEASE NOTE WELL: These prices were correct at time of publishing this post. Prices may have changed or products may become discontinued, however these are fairly standard parts and suitable alternatives should be available from all good suppliers. Rapid Electronics provide very reasonable prices, fast delivery speeds and they DO ship outside the UK. Component ratings/values are provided in the description and should be available from other suppliers.

Last edited: May 1, 2013
3. ### tshuck Well-Known Member

Oct 18, 2012
3,527
679
Wow, great project!
1.) Since you are making this for children/young persons, it might be beneficial to have a minimum components section, listing the bare minimum of components, as opposed to an all-inclusive table. Perhaps having 3 takes, one for components, one for case, and another uniting the two for an overall cost.

I think this would also benefit those unfortunate souls without a laser cutter...the kids could go home and build this after the camp is over.

2.) If you are going to make the project buildable at home, you may want to supply pricing for Radioshack. Radioshack is similar to the UK's Maplin, I hear, where people can pick up some pretty generic parts like the 555, resistors, capacitors, basically everything necessary to get the project made, and they're everywhere(in the US). It helps make the project more accessible to everyone.

Overall, a great project and writeup, though I'm not sure the kids will care about the percent deviation of the notes.

4. ### Markd77 Senior Member

Sep 7, 2009
2,803
596
It might be worth drawing out the layout for stripboard as well, then they could make a mini version without any etching skills. Also the value of the variable resistor isn't on the schematic, I see it later on in the parts list.

5. ### edwardholmes91 Thread Starter Active Member

Feb 25, 2013
201
20
Thanks for your kind comments, I have split up the parts lists into two, one for the circuit and one for the casing and also suggested a solution which doesn't require a case. The case could of been made using the same material though and hand cutting it though... in fact this is the way I would have done it, although when I have access to a laser cutter it would be rude to not use it!

The pricing was supplied more for completeness than anything and also to give an idea of the rough price to build one. Rapid do ship outside the UK too and I have provided detailed descriptions of parts to allow people to source them from elsewhere if required. The deviation was more part of the design of the project to see if the values were suitable. When I teach this project all the children will receive a handout and depending on ability/age I will highlight the important bits. I figure they can skim over the bits that they aren't interested in but they are there if they are. I didn't want to leave it out, only to have someone ask and me not being able to remember how I had done something!

The intention is that it is built at the camp where they have facilities to make PCBs. I have never been very good at laying things out on vero-board and hence steer clear of it whenever possible. The value of the variable resistor unfortunately doesn't appear on the schematic because if they way the program displays it... but as you point out the price list shows it and also there is mention of it in the documentation.

On the topic of schematics, does anyone know how I can get better drawings in there? I have tried using auto-shapes and the grid on Word and also tried using Visio and not been very happy with the results. Which is why I resorted to the nasty print screens

6. ### Wendy Moderator

Mar 24, 2008
21,365
2,921
I'm adding your schematic to the first post, hope you don't mind.

I thought seriously about doing something like this, using tactile switches. From there I suspect it would not be hard to make a keyboard (clothes pins maybe?).

I have a decent drawing utility in my blog, I call it PaintCAD. Basically it is a set of templates for M/S Paint.

• ###### temp1.png
File size:
35 KB
Views:
686
Last edited: May 1, 2013
7. ### edwardholmes91 Thread Starter Active Member

Feb 25, 2013
201
20
Certainly, not a problem I did consider this, but looking at the price of tactile switches I decied not to bother because I wanted to keep it nice and cheap. Although I have to admit I have found a very good supplier called D&M Components that sell that very cheaply in a range of sizes. I got 100 of both the 6mm and 12mm ones for stock.

8. ### Wendy Moderator

Mar 24, 2008
21,365
2,921
Locally they are 12¢ or 100 for \$9. Not too bad I think. Your way you can only hit one key at a time, an advantage for the design.

9. ### edwardholmes91 Thread Starter Active Member

Feb 25, 2013
201
20
That's a very good price. I paid 5p each for the 6mm and 9p each for the 12mm. I didn't get any bulk buy discount unfortunately, so it was about £16 for 100 of each. that's about \$25.

Correct, the way the circuit was designed only allows for monophonic and so using a stylus means you can only touch one at once. With keys you could indeed press more than one at once. The effect I believe would be nothing if pressing a higher note or the lower note would play if pressing a lower note.

I have to admit it is a very simple design. I am not sure how you could get polyphonic... because if the resistors were wired in parallel then you would get a higher note playing every time you pressed more than one key. Any combination of resistors in parallel gives a lower resistance, therefore a higher note I suppose.

10. ### Wendy Moderator

Mar 24, 2008
21,365
2,921
I like it. Simple is good.

11. ### edwardholmes91 Thread Starter Active Member

Feb 25, 2013
201
20
Thanks I know you have written quite a lot about the 555 so I'm really pleased you like it

It would be wonderful to see other peoples versions if anyone attempts to make one themselves. A quick search on YouTube brings back lots of videos of ones that people have made.

12. ### tshuck Well-Known Member

Oct 18, 2012
3,527
679
To be honest, while your thread discussing possible projects, including this one, was going, I made a very crude version of this to see how fast I could source and assemble the parts. It took about an hour, I had to hunt down a suitable speaker after I accidentally killed the one I had in mind for the build. I made it on a protoboard with the goal that the whole thing had to be on the board, speaker and all. I ended up not strapping the battery to the board because I got distracted playing with the 5 keys/buttons.

edwardholmes91 likes this.
13. ### edwardholmes91 Thread Starter Active Member

Feb 25, 2013
201
20
Haha awesome Feel free to post a picture up I spread mine across 3 boards just to keep things in sections. I had the 555 on one of them, one octave on one and another octave on the other! Bit over the top but kept things nice and linear I didn't get any pictures of the breadboard one I'm afraid and because I'm tight I used the components from the breadboard to make the PCB instead of getting more out of my stock!

14. ### edwardholmes91 Thread Starter Active Member

Feb 25, 2013
201
20
Good news everyone, I got an article published on Rapid Electronics website! Follow the link if you would like to read the article

15. ### edwardholmes91 Thread Starter Active Member

Feb 25, 2013
201
20
I have updated the handbook very slightly. I noticed that some of the calculations I made were slightly incorrect. This has meant a change to a couple of the resistor values in the chain of resistors if anyone is interested.

Griz, Georacer and tshuck like this.