Author Options:

Building a Small Giant Piano? Can i just wire switches to the key contacts on a electronic keyboard? Answered

Im thinking a wooden frame with Lexan keys ...When stepped on Lexan flexs and depresses a switch underneath. Ive researched RasberryPI and other things of this nature ...but couldnt I just wire the switches into a keyboard... replacing what happens when you press a key? Its for an exhibit for kids.....this thing is going to get serious punishment! I need simple and reliable.


You've got loads of possibilities, I highly recommend making a midi keyboard with some microcontroller. If you wan't an easy keyboard you could make one with Arduino from here:
This is a one octave synth, with one sound. If you make a midi version (which you could do with piezos) you could vary the sounds and the software on your computer. It's fairly easy but you need some time.


5 years ago

That is like 33,000,000 micro joules.

You want easy for kids !

Let each switch operate a 555 or two 556 oscillators, no need for a micro-p.

Try using a snap switch or a micro switch for the keys.



Small Giant Piano? Gonna need more details because that doesn't make any sense.

You can program an Arduino, and the Pi as well I'm sure, to play a sound when a button is pushed. There are libraries and tone files for the notes with Arduino.


There is an interface designed for just this type of input > computer > sound output.
Enter MIDI. Most microcontrollers can take inputs from switches or contacts and convert them to the data required by midi equipment to make sound. It's an asynchronous data protocol that allows digital instruments to send instructions about what note is being played, when, and how loud - as well as controlling other features of the instruments.

There are several types of devices. A keyboard (piano) you are used to listens to key presses, and converts them into the digital instructions. Some keyboards don't even have the ability to make sound on board; they JUST output data.
Then you need a synthesizer - it takes those midi instructions, and outputs sound, 'synthesizing' the audio from whatever input it got.

Now for your project: If you get a keyboard that HAS a synthesizer on board, you can skip the midi step and wire common micro-switches into the contacts under the keys, and it will work. You'll lose 'velocity' control which many keyboards have these days, which infers how hard you hit the key based on the key's velocity. Often you'll see the switch contacts having 3 or 4 pads that hit at different time intervals to achieve this velocity calculation - ymmv.

If you have access to a midi synth, you could use something like an arduino looping, listening to the switches attached to your keys, and outputting real midi serial data to an off-the-shelf midi synthesizer, which then outputs audio to an amplifier for the speakers.

Lastly, you could use something that converts the midi data into something more portable like USB - and use a midi-synth software program (I think cubase does this, among hundreds of others). A microcontroller I would recommend for this task would be the Teensy 3.0. It has plenty of inputs, is 20 dollars, and can be programmed to show up to the computer as a midi input device. A very simple code sketch would convert inputs from switches into midi output via usb, and the computer would make the audio. It's a bit more of a chore because the computer would have to boot into an operating system and run the program, then connect to the midi device before it started doing its job, not a problem if it's always on; more annoying if you need to turn this exhibit on and off; hence the suggestion of using a midi synth because they are embedded, turn on, and just work.

As for making robust keys out of lexan; it's a matter of having the mechanics do all the heavy abuse (closed cell foam draft seal works great as a spring) - then have the travel of the key actuate microswitches to get reliable switch operation without damaging the switch.
See also: Rigid dance dance revolution pads. There are a LOT of projects online for people to make their own pads that are DESIGNED to be stomped on, some more reliable than others. I know I made quite a few. Keep in mind you may need more than one switch per key to get reliable hits no matter where the key is hit. Connect them all in parallel so that any individual switch will still close the circuit.

Good luck, any questions feel free to ask!