I created this sound generating toy for a final in a beginner's Digital Electronics toy. It also changes light colors depending on how you tilt it and vibrates whenever you play a note. I used cardboard, hot glue, paper, and copper tape for the casing. There's an Arduino mega, speaker, accelerometer, RGB leds, vibration motor, and pressure sensor inside (along with the battery pack).
Step 1: Lots of Buttons
Okay! So my toy has 10 buttons that each generate a different tone. (I use the tone library in Arduino.) I used momentary switch buttons to test out the program, although I ended up using 2 bits of copper tape as buttons in the final rendition.
Here I have each button generating a note through the Arduino and out of the speaker. The pressure sensor changes the octave of each note so users can play higher notes as well.
I also have a few RGB leds paired with an accelerometer. I have the Blue value constantly changing, but the Red and Green values correlated to the x and y axis of the accelerometer.
Step 2: Building a Shell
I built a shell out of cardboard by cutting 12 pentagons with an Xacto knife. I cut out an extra pentagon with a hole for the pressure sensor. On 10 of the pentagons I put copper "buttons" - and modified 4 of the button sides to be windows for the lights. I taped everything together to hold it together, then hot glued the shell together with all the electronics inside.
Here's the code for the toy (it's the .zip file). Since I used contact points for my "buttons" instead of momentary switch buttons, each "button" is actually connected to an analog pin and has a set threshold.
Step 3: All Done
That's how I made my toy. I plan to pull apart the cardboard body and fitz with it a bit more. I'd also like to build it a more stable, long-term body. I'll put an update if and when that happens.