This year the boys wanted to be Mario and Luigi. Kind of boring right? Well my wife didn't think they were ready for throwing real fireballs so we did sound effects instead. I wanted them to make the Mario jump sound when they jumped and be able to make the fireball sound too and maybe a few others. So I too a Wii Nunchuck, an arduino, a set of portable speakers and a birthday card to make this.
The Wii Nunchuck has an accelerometer in it so I used that to tell when they jump and for them to control the rest of the sounds. The Nunchuck is connected to the arduino using an adapter that you can make or buy so you don't have to cut the cable.
For the sound recording and playback I found a birthday card that you can record 4 sounds on and playback the sounds by pressing each button. After tearing the card apart I found that it ran on a 3V battery so I used an arduino pro mini 3.3V for one and an arduino FIO which is also 3.3V for the other. This way the arduino could directly control the sound board and power it too.
Step 1: Materials and Tools
Programmable birthday card (I got it from Walgreens)
3.3V arduino (like the arduino pro mini or arduino FIO from Sparkfun)
Battery for FIO
Wii Nunchuck arduino adapter (or make your own like I did)
3.5mm female jack
I used an arduino FIO for one and an arduino pro mini 3.3V for the other because that was what I had on hand. This instructable shows the FIO because it was a bit easier than using the pro mini.
Step 2: The Birthday Card
First find the sounds you want to use. I just did a few google searches and came up with plenty. Follow the instructions on the card to program each sound effect into the card. After your sounds are programmed carefully pull the card open to find the sound board. It is glued on pretty good so be careful removing it from the card.
Step 3: Sound Board
Once you have the sound board off the card you can trim off the wires we don't need. On this board it should look like this first picture. Keep the left wire for each pair of button wires. Remove the record button wires. Remove the battery holder since we will get power from the arduino.
How this board works is the left button wire of each button is the input wire and the right is 3V. When the button is pressed it completes the circuit and brings the input wire up to 3V and triggers the sound. Since the arduino I am using is 3.3V when you set an output to high that does the same thing and triggers the sound. So all we have to do is wire each of these to a pin on the arduino.
Step 4: Connect Sound Board to Arduino
To connect the sound board to the arduino solder the button wires to D6, D7, D8 and D9. Order is not important, you can change which sound is which in the code. Then solder the white ground wire to GND on the arduino and the yellow power wire to 3V3 on the arduino.
Step 5: 3.5mm Jack
Take the 3.5mm jack and solder the 2 speaker wires to the 2 wires on the jack. If the jack is stereo it will probably have 2 wires and bare wire around them. Solder one of the wires from the sound board to the bare wire and the other wire from the sound board to both of the other wires from the jack to make it mono.
You can buy a WiiChuck adapter or make your own. I made one since I had some copper clad board on hand. If you want to make one just cut a piece of board so it will fit inside the the Nunchuck connector. I used an exacto knife to cut and scrape off the copper like in the picture below. Do this on both sides.
Solder wires to the adapter like in the second picture below. It should go green then red on the top and black below green and yellow below red.
I messed up on the first one I made and put the power on A0 and A1 pins so I changed it in my nunchuck_funcs library. The default should be to use A2 and A3.
Check out the WiiChuck homepage for more info and the library for the arduino.
Step 7: Program the Arduino
Attached is the arduino sketch that I made for this. There are plenty of tutorials about using an arduino so I won't repeat that. You just need the attached file and the nunchuck_funcs library.
Go to the WiiChuck homepage for more info and the nunchuck_funcs library for the arduino.
In the code is a section like this:
int FirePin = 7;
int SuperPin = 8;
int CoinPin = 9;
int JumpPin = 6;
This is where you set which sound is on which pin of the arduino. Change the pin numbers to suit where you put the sounds. The JumpPin is on the C button and plays when the nunchuck goes up and down quickly. The FirePin is on the Z button and the other 2 sounds play when the joystick is moved up or to the right.
Step 8: Wrap It Up
Plug the Nunchuck in and then wrap it in black tape to hold it in place. Then wrap everything up in black tape and make sure to leave access to the power switch and the battery charging port.
When you turn on the arduino the sound board goes through the whole greeting but once it is done it won't play again. I just leave the portable speakers turned off until it is done playing.
I put the speaker in one front pocket of the overalls and the arduino in the other. Then I cut a small hole in the back of the bib pocket to run the wire to the portable speakers battery pack so it was easy to turn the sounds off when needed. The Nunchuck runs inside the shirt and through the sleeve.