Introduction: Plush Toy, Singing With Mommy's Voice

This Instructables is about upgrading a plush toy to give it the ability to sing when baby presses its belly.

Most importantly : it will not play a stupid pre-recorded music, but actually sing mommy's songs, with mommy's voice !

This project started with two goals in mind: customizing a nice gift for my baby, and raising support from my wife in my electronics hobby :-)

Material needed

Toy
- plush toy (one that you can tear apart without regret)
- Velcro strips

Electronics
- Arduino Uno
- MP3 shield (I recommend Sparkfun's https://www.sparkfun.com/products/10628 - the code I will provide is based on this model)
- 0.5W speaker
- 9V battery with its connector and a 2.1mm Jack to plug in the Arduino
- pushbutton
- on-off switch (optional)
- crimp connectors (optional)

Other components
- used credit or fidelity card
- empty business card box.

Level : I assume the reader is comfortable with both Arduino (and shields) and general electronics, including soldering. I will skip many details but do not hesitate to ask in comments, I will reply.

Acknowledgment : Bill Porter has written a MP3 librairy for the Sparkfun shield that greatly facilitated my work (as well as further support in his forum). His website is
http://www.billporter.info/2012/01/28/sparkfun-mp3-shield-arduino-library/

Step 1: Ripping Apart Teddy Bear and Stitching It Back

As the title suggest, this step involves sharp blades and open-heart surgery.

Jokes aside - It is important to open the plush toy in the cleanest fashion possible, in order to be able to put in back together at the end.

Look for a long sewing line, for example in the back, and cut the sewing threads with a cutter blade.

Then remove all filler from the belly, and keep it in a plastic bag.

Last step for the preparation of the plush toy : sew two bands of Velcro on each side of the cut.

Step 2: Assembling the Electronics - the Pushbutton

The first picture show the assembly diagram.
(Note: read this Instructable until the end before. Some of these wires need to go through a hole of the box, before soldering)

First, solder the connectors to the MP3 shield and plug it into the Arduino. Then, let us deal with the pushbutton.

1) The pushbutton connects the +5V to the pin 5 of the shield, one of the few pins left available on the Sparkfun MP3 shield. a 10kOhm pull-down connects the pin 5 to the ground.

2) There will probably be no room for breadboard in the toy, so you will have to solder the wires and the resistor on a small piece of proto board, as shown on the 2nd picture. Then, insert a small piece of insulator (extruded polystyrene, cardboard, ...) between the MP3 shield and the proto board, to avoid any short circuits.

3) Notice that the pushbutton connection to the proto board is through a crimp connector. This is optional, but is very convenient later when arranging the electronic enclosure. The final overview of the pushbutton can be seen on the last picture

Step 3: Assembling the Electronics - Speaker and Battery

Now let us connect the speaker and the battery.

1) Because the space in the business card box was so tight, I had to remove the plastic protection of the jack, to solder directly the wires to the connectors, then bend them away to make room for the battery. You may not need to do this if your box is slightly bigger, on your battery slightly smaller. If you use the same trick then don't forget : the positive pin is inside, the ground is outside.

2) Directly solder the ground from the battery to the Arduino jack.

3) Connect the positive side through a on-off switch. This is optional, but very convenient. Otherwise, in order to save battery life when your baby is done playing with the toy, you'd have to remove the battery. (Note: read this Instructable until the end before. this wire need to go through a hole of the box, before soldering)

4) Solder the speaker connection to the L and R connections of the MP3 shield. Note that we don't use the audio ground connector
named "-", because the shield library comes with a "Differential Output" mode that allows for more volume this way. Once again, for convenience, I recommend to use Molex connectors but this is optional.

Step 4: Recording the Songs

Here is the funny part of the Instructables. Use a recording device of your choice to capture the nursery rhymes your baby likes. You can, of course, use commercial MP3 files, but it is so much more fun and sweet if you and/or your spouse sings the songs !

If the recorded files are not MP3 - convert them. Many tools are available, I used Format Factory. When you convert audio files to MP3, make sure you choose "192 kbits/s", because this is what the Sparkfun MP3 shield uses.

Name the file track001.mp3, track002.mp3, etc...

Then, transfer them on a micro-SD card that fits into the shield slot.

Step 5: The Arduino Code

The sketch below plays a song when the button is pressed. Another pression on the button interrupts the song. A counter is incremented each time to go through all the tracks.

Note 1: the variable nbTracks has to be initialized with the number of files on your SD card.

Note 2: a few librairies need to be installed for the code to work. Luckily for us, Bill Porter has GREATLY simplified them, so that the code is real simple. go to http://www.billporter.info/2012/01/28/sparkfun-mp3-shield-arduino-library/ for description, and to https://github.com/madsci1016/Sparkfun-MP3-Player-Shield-Arduino-Library for files.

----------------------------------------------------------------------------------------------------

//This code plays an MP3 song when a button is pressed
//When the button is pressed, the MP3 shield plays the track00x song (a counter x is incremented)
//When pressed again, the track is stopped (if it was playing)
//The musics tracks are stored on the SD card as track00x.mp3 format

//libraries come from http://www.billporter.info/2012/01/28/sparkfun-mp3-shield-arduino-library/
//github source : https://github.com/madsci1016/Sparkfun-MP3-Player-Shield-Arduino-Library
#include <SPI.h> //bus SPI
#include <SdFat.h> //SD card
#include <SdFatUtil.h> //SD card tools
#include <SFEMP3Shield.h> //shield library

SFEMP3Shield MP3player; //player
SdFat sd; //card
const int pinButton = 5;
const int nbTracks = 5; //CHANGE THIS VALUE TO THE NUMBER OF SONGS ON YOUR SD CARD
const int volume = 6;//-3dB. The higher number, the lower volume
int counter = 1;

void setup() {
  //Serial.begin(9600);
  sd.begin(SD_SEL, SPI_HALF_SPEED); //start card 
  pinMode(pinButton, INPUT);

  //setup of player
  MP3player.begin(); //start player
  MP3player.setDiffertialOutput(1); //higher output power
  MP3player.setVolume(volume, volume);
}

void loop(){
  if (MP3player.isPlaying() && digitalRead(pinButton)){
    //if playing, then a press of the button stops the music
    MP3player.stopTrack();
    //Serial.println("music stopped");
    delay(500); //to release button         
  }

  else if(!MP3player.isPlaying() && digitalRead(pinButton)){  
    //if not playing, then a press of the button starts the music

    //first, increment counter
    counter += 1;
    if (counter > nbTracks)
    counter = 1;

    int errorCode; //used to debug
    errorCode = MP3player.playTrack(counter); //play
      /*
      Serial.print("playing track ");     
      Serial.print(counter);
      Serial.print(" at ");    
      Serial.print(-volume/2);
      Serial.println("dB");     
      Serial.print("error code (0 is OK): ");
      Serial.println(errorCode);
      */     


     delay(500); //to release button 
  }     
}

Step 6: Preparing the Enclosure Box - Bottom

A business card box is used to store the Arduino and the MP3 shield. The size fits just right - only the space for the battery is a bit cramped - and I was able to procure a few of these boxes for free. Obviously, if you have access to another small plastic box, it would work the same.

The task of this step is to drill holes in order to screw the boards in place.

1) Position the board against one end of the box and, looking from below, mark the position of the mounting holes (second picture)

2) Use a 3mm or 4mm drill. Wood drill bit ("Lip and Spur" drill bit, the experts call them) is ideal. Go very slowly, the plastic is easy to drill but may melt or break if you go too fast.

3) Not shown on this picture: drill an additional hole above the jack alimentation of the Arduino board. The wires coming from the on-off switch go through this hole.

4) Screw the boards in place

Step 7: Preparing the Enclosure Box - Top

Similarly, mark and drill holes in the top of the box, and insert the pushbutton and speaker wires through them. Solder the wires to the button connectors and to the speaker as well.

Then, solder the Molex male connectors to these wires. The components will then be attached to the top of the box, you will have to un-solder them to take them out. You may drill larger holes, if you want to make a temporary assembly only.

Step 8: Closing the Box

First, connect all Molex connectors as well as the battery. Close the box carefully, making sure all wires fold wherever there is room for them.

Wrap an elastic band around the box to hold it in place. Then, slide a plastic card (an unused fidelity card, or an unactivated credit card, for example) between the button and the elastic band. It will provide a larger area to press the button.

The button should not be pressed all the time, obviously. Adjust the rubber band if it is the case, or add some stuffing from the toy between the credit card and the box, to remove some of the pressure.

Step 9: Final Assembly

Finally, insert the box into the Teddy Bear body. You may be able to push the speaker into the head. Add some stuffing in front of, on the sides of, and behind the box. Make sure the card has not slid.

Then, switch ON the whole device, close the velcro straps, and give it to your baby.

Enjoy the fun !

Valentine's Day Contest

Participated in the
Valentine's Day Contest