build an arduino powered talking robot head

Upload: lorddarthvader

Post on 09-Oct-2015

51 views

Category:

Documents


0 download

DESCRIPTION

Build an Arduino Powered Talking Robot Head

TRANSCRIPT

  • http://www.instructables.com/id/Build-an-Arduino-powered-talking-robot-head/

    Home Sign Up! Browse Community Submit All Art Craft Food Games Green Home Kids Life Music Offbeat Outdoors Pets Photo Ride Science Tech

    Build an Arduino-powered talking robot head!by xtremd on October 2, 2009

    Table of Contents

    Build an Arduino-powered talking robot head! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

    Intro: Build an Arduino-powered talking robot head! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

    Step 1: Compile all materials/parts/electronics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

    Step 2: Assemble and solder all circuitboards and shields. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

    Step 3: Design the robot head. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

    Step 4: Design your Robot head: Cutting the eyes out. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

    Step 5: Design your robot head: Making a LED matrix for the mouth. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

    Step 6: Making the mouth LED matrix: Soldering in the LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

    Step 7: Making the mouth LED matrix: Soldering control wires onto the LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

    Step 8: Install the eyebrow-moving servos inside of the robot head. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

    Step 9: Install the grid inside of the robot head. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

    Step 10: Solder the RGB LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

    Step 11: Install the RGB LEDs inside of the robot head. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

    Step 12: Finish making the eyes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    Step 13: Wire up the TLC5940NT chips. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    Step 14: Wire up the LEDs to the TLCs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

    Step 15: Wire up the servos to the TLCs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

    Step 16: You are now entering the land of software and code! (mostly) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14Step 17: Download the TLC library. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

    Step 18: Test the TLCs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

    File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

    Step 19: Download the improved, high-capacity supporting (Somewhat), Waveshield library. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14Step 20: Format and load your SD cards. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

    Step 21: Test your Waveshield. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

    File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

    Step 22: Wire up the I2C interface between both Freeduinos. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

    Step 23: Enable I2C on the TLC controlling Freeduino. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

    File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

    Step 24: Test the I2C interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

    File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

    Step 25: Your almost done! Just some code to load... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

    File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

    Step 26: Mount everything on the robot head box and you're done! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

    Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

  • http://www.instructables.com/id/Build-an-Arduino-powered-talking-robot-head/

    Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

  • http://www.instructables.com/id/Build-an-Arduino-powered-talking-robot-head/

    Intro: Build an Arduino-powered talking robot head!This robot head was originally built as a end of the year project for my physical computing class, but over the summer it has "learned" how to talk.The head is powered by two Freeduinos, 3 TLC5940NT chips and an Adafruit Industries Wave Shield found here: www.ladyada.net/make/waveshield/ . The head iscurrently connected to a computer by two USB cables, one for power, one for sending it serial commands on what to say/emote. Once the head receives the typedcommands on what to say/emote it plays back the individual word files in order creating a sentence or multiple sentences. It also changes its emotions according to theemotional commands sent from the computer.

    This robot head is a foundation for many possible applications since it can say anything that it has the vocabulary for. Right now I am currently working on connecting it tothe internet and making it check and read my email via PHP script. I will update this Instructable as I progress along with that.

    Here's a video of it in action:

    The head is still an on-going project so any comments on anything here are more than welcome!Special thanks to Liz Arum for helping me with everything!

    Update: Due to popular request I now have now added a video of the robot talking and expressing itself! Enjoy at your leisure!

    Image Notes1. Linux penguin!

    Step 1: Compile all materials/parts/electronics.This robot head uses:

    1 Breadboard (It has to be more than 48 rows long with a gap running down the center of the board to connect IC chips. A power and ground bus running along the sideof the breadboard is also a necessity.)2 RGB Leds (For the multicolored eyes) Common Anode. $1.50 - 1.95 each. 2 X $1.75 = $3.5036 Red Leds (For the mouth) somewhere around the 40-50 cent price range for each. 36 X $.45 = $16.202 HXT900 Micro Servos (For moving the eyebrows) Can be found at: http://www.hobbycity.com/hobbycity/store/uh_viewItem.asp?idProduct=662 2 X $3.65 = $7.303 TLC5940NT's (To drive/light up all the Leds and control the servos) can be found at Digi-key http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=296-17732-5-ND where they are priced at $4.28. 3 X $4.28 = $12.84or Mouser http://www.mouser.com/ProductDetail/Texas-Instruments/TLC5940NT/?qs=sGAEpiMZZMu8%252bGBKj8XSFEjwsgnt5grMZ49G/W4nR14%3d3 Capacitors (~1000uf) (for ironing out line noise from the Leds and servos) Salvaged from an old computer power supply. Free2 Original Freeduinos or Arduinos. The Freeduinos can be bought at http://www.freeduino.org/buy.html They are priced at 23.99 each. 2 X $23.99 = $47.98

  • http://www.instructables.com/id/Build-an-Arduino-powered-talking-robot-head/

    Or www.sparkfun.com/commerce/product_info.php for Arduinos. Priced at $29.95 each. 2 X $29.95 = $59.90.Warning: The Freeduinos require some soldering knowledge, if you would like not to solder your boards then buy an Arduino.

    Warning: This Instructable requires some soldering knowledge anyway, so why not start now? :)1 Waveshield from Adafruit Industries (To allow the robot to talk) Can be bought at: http://www.ladyada.net/make/waveshield/ Priced at $22 each.Estimated total cost of all high tech parts (not including shipping) if you bought Freeduinos instead of Arduinos is.... $109.82! The total cost of all high tech parts if you bought Arduinos instead of Freeduinos is.... $121.74!And as for the low-tech materials you will need:

    A cardboard box the same size that you want your head to be.

    A small piece of cardboard

    Tape

    Glue

    Breadboard compatible wire (22 gauge, solid)Wire for fastening stuff to other stuff

    A small block of wood

    Power drill.

    Heat Shrink tubing for isolating the exposed wire leads and something that blows hot air to shrink it with (Hot air gun )Box cutter.

    Step 2: Assemble and solder all circuitboards and shields.Solder the Freeduinos (like I did), Or disregard this line if you bought a Arduino. Here is the link to their assembly instructions for all of the people who bought Freeduinos:mcukits.com/2009/03/12/assembling-the-freeduino-board-kit/

    Solder the Waveshields. Lady Ada has a very good guide on how to do this on her website at http://www.ladyada.net/make/waveshield/solder.html

    Note:In addition to soldering together the Waveshield as outlined. Add a long wire soldered onto the resistor R7 on the side closest to the amplifier chip. This will be connectedto the Analog Input 1 on the Freeduino that is controlling the LEDs of the robot head. (Don't worry about where to plug the other end of the wire for now, that will beexplained in detail later.) See the picture for clarification on where to solder the wire.

    Image Notes1. This is the Amplifying chip.2. Solder the wire onto this side of this resistor (R7)

  • http://www.instructables.com/id/Build-an-Arduino-powered-talking-robot-head/

    Step 3: Design the robot head.Take the cardboard box that you chose to be your head and mark out the places that you would like to cut out for the eyes and mouth by cutting pieces of paper andlaying them on top of your box. When you are happy with the arrangement you can move onto cutting stuff.

    Image Notes1. I didn't have a picture of the original designing process, but this is close enough to show what I mean (I hope).

    Step 4: Design your Robot head: Cutting the eyes out.Tape or mark the pieces to their final positions onto the box and cut them out. (Keep the piece of paper that you used to represent the mouth, you will need it later.)

    Image Notes1. Tape onto and cut out of the box.

    Step 5: Design your robot head: Making a LED matrix for the mouth.Each LED in the mouth will light up independently. To do that you need to make an LED matrix for the mouth. (For an idea on what is a LED matrix, see picture 1)Take the piece of paper that is supposed to be the mouth and, with a pencil and ruler, Divide up the piece of paper into 36 parts (9 X 4), One for each LED in the grid.After you have done that, tape the piece of paper to a piece of wood and being careful not to drill through the floor (This has happened to me so I recommend drilling ontop of a cardboard box.) Drill holes where the lines intersect with a 1/4 inch drill bit, so that your LEDs fit snuggly. The size of the drill bit is obviously dependent on thesize of your LEDs so use a smaller drill bit for smaller LEDs. (Start small and work your way up!) Look at pictures 2&3 for clarification on the drilling/marking.

  • http://www.instructables.com/id/Build-an-Arduino-powered-talking-robot-head/

    Image Notes1. This is the LED matrix. The LEDs can all light up independently to give theimpression of talking, not talking, etc. This is what you will be making now.2. All of the individual wires coming from the LEDs and plugged into a breadboardwhere they are controlled by 3 TLC5940NT LED drivers.3. These eyes have RGB LEDs behind them, they change colors depending onthe "mood" of the robot.

    Image Notes1. A piece of paper with 36 Intersections.

    Image Notes1. Don't forget the tape in the corners!2. Tape3. Tape4. Tape5. Opps! Oh well...

    Step 6: Making the mouth LED matrix: Soldering in the LEDs.Before doing anything else, check that all your LEDs are not burned out or dim. You can do this by finding a small 3V button battery and holding the legs of the LEDs tothe battery (Remember the long leg is positive, the short negative).Next insert the LEDs one row at a time into your drilled out grid jig. Fold the long legs so that they are parallel to one another and solder them in, row by row (See pictures2 & 3). Solder together the long legs since you will be using TLCs to control these LEDs, and the TLCs are power sinks. This means that they control the LEDs by alteringthe voltage differential between power and ground.

  • http://www.instructables.com/id/Build-an-Arduino-powered-talking-robot-head/

    Image Notes1. Test your LEDs before soldering them in! It looks really bad if you have oneLED that is dimmer than the rest.

    Image Notes1. It helps to solder the LEDs in neat rows like this. Just align the LEDs with theshort wire on one side, and the long on the other.2. Short wire (Cathode).3. Long wire (Anode).

    Image Notes1. A stripped wire to connect the world!

    Step 7: Making the mouth LED matrix: Soldering control wires onto the LEDs.Solder long wires that can fit into a breadboard (22 gauge) onto all the LED cathode leads. These wires will control the LEDs. Afterwards be sure to insulate all theindividual wires with electrical tape(not fun) or heat shrink tubing(recommended).In addition to soldering wires onto all of the LEDs Cathode leads, solder 2 or 3 wires onto the Anode part of the grid (The part that is all soldered together). These wireswill serve as power supples distributing power all throughout the grid. They will be connected to 5V.

  • http://www.instructables.com/id/Build-an-Arduino-powered-talking-robot-head/

    Image Notes1. Solder long wires onto ALL the LED leads. (This was just made for picturepurposes so i didn't)

    Image Notes1. Solder wires onto the leads that have been all soldered together (theAnodes). These 2 wires will serve as your universal power supples for all theLEDs in the grid.2. Solder wires onto the grid part of the grid (the Anodes). These wires willserve as universal power supples, they will supply power to all the LEDs.

    Image Notes1. This is aproximately what it should look like when you are done soldering thewires on. Notice that I insulated some wires with electrical tape(annoying), andsome with heat shrink tubing(recommended).

    Step 8: Install the eyebrow-moving servos inside of the robot head.Before installing your mini-servos inside of your robot head, hot glue a long strong (But still bendable) wire onto the servo arm. This wire will go up the inside of yourrobot, come out of the top and creep back down to move the eyebrows. (See the pictures for clarification.)Take your mini-servos (with the wires attached) and hot glue them to the inside of your robot head, right underneath the eyes, making sure that the wires can move fromside to side.

  • http://www.instructables.com/id/Build-an-Arduino-powered-talking-robot-head/

    Image Notes1. servo.2. servo.3. Servo control wire. (This will need an extension. Some ribbon cable should tothe trick. Just solder some male headers on each side of the ribbon cableextension.)4. Ditto, look at the comment on the left.5. Wire to move eyebrows.

    Image Notes1. Wikipedia!

    Image Notes1. Eyebrow (Piece of electrical tape folded in half) attached to the wire.2. Instructables.com!

  • http://www.instructables.com/id/Build-an-Arduino-powered-talking-robot-head/

    Step 9: Install the grid inside of the robot head. Hot glue the grid to a piece of cardboard that you have drilled holes in and hot glue that onto the inside of the robot head.

    Image Notes1. Hot glue the grid in!

    Image Notes1. Hot glue.2. Hot glue.3. Hot glue on inside of box.

    Step 10: Solder the RGB LEDs. Solder the Common Anode RGB LED lead to a long wire. Then solder a colored wire (red, green, blue) to the RGB LED lead that corresponds to it (The color of anindividual lead can be found out by using a 3V button battery to light each LED lead in turn). Don't forget to insulate the wires!

    Image Notes1. Soldered, insulated and ready to go!

    Step 11: Install the RGB LEDs inside of the robot head. Install the LEDs inside of the robot head by putting them where you want them and then folding and taping the wires to the inside of the box. Putting a drinking strawunder the LED also helps to keep it in place. (See pictures for clarification)

  • http://www.instructables.com/id/Build-an-Arduino-powered-talking-robot-head/

    Image Notes1. Servo.2. RGB LED laid untop of a straw hot glued to the inside of the box.

    Image Notes1. RGB LED.2. Straw.3. The LED's wires are taped onto the side of the box somewhere over here...

    Step 12: Finish making the eyes. Glue a square piece of paper that is slightly larger than the hole that you have cut out. Glue it over the hole to cover up the hole and the LED behind it. You might alsowant to tape some sheets of paper towel to the inside of the eye holes to diffuse the light coming from the LEDs.

    Image Notes1. A sheet of paper towel taped to the inside of the eyes to diffuse the light comingfrom the RGB LED.

    Image Notes1. Piece of paper glued to the eye hole.

    Step 13: Wire up the TLC5940NT chips. In this step you will have to daisy chain 3 TLC5940NTs together to drive a total of 42 LED outputs (36 for the mouth, 6 for the multicolored eyes).The people at the Arduino playground have a very well documented hookup guide on how to daisy chain 3 TLC5940NTs together. Here it is in compressed form:

    Arduino pin 13 -> SCLK (TLC pin 25)Arduino pin 11 -> SIN (TLC pin26)Arduino pin 10 -> Blank (TLC pin 23)Arduino pin 9 -> XLAT (TLC pin 24)Arduino pin 3 -> GSCLK (TLC pin 18)

    --------------U------------LED Out 1 | 1 28 | LED Out 0LED Out 2 | 2 27 | GNDLED Out 3 | 3 26 | SIN (Ard pin 11.)LED Out 4 | 4 25 | SCLK (Ard pin 13)... | 5 24 | XLAT (Ard pin 9)... | 6 23 | BLANK (Ard pin 10)... | 7 22 | GND... | 8 21 | VCC (5V)... | 9 20 | 2K Resistor to Ground

  • http://www.instructables.com/id/Build-an-Arduino-powered-talking-robot-head/

    ... | 10 19 | 5V

    ... | 11 18 | GSCLK (Ard pin 3)

    ... | 12 17 | SOUT (Connected to the SIN of the next TLC in the Daisychain)

    ... | 13 16 | XERR Out 14 | 14 15 | LED Out 15 -----------------------------

    Note: we are Daisychaining 3 TLCs so the SIN of the first TLC is connected to Arduino pin 11. The rest of the TLCs have their SIN connected to the SOUT of the TLCpreceding it.

    All the BLANKs are connected to each other (BLANK of TLC1 is connected to BLANK of TLC2 etc...)All the XLATs are connected.All the SCLKs are connected.All the GSCLKs are connected.All the XERRs are connected.

    Also plug in 2 or 3 Electrolytic capacitors to the breadboard's Ground and Power (Negative on the capacitor going to Ground, Positive to 5V). The amount of charge that itholds is not that important but it should be rated for 5V or above. These capacitors will act as a filter, filtering out all the imperfections(noise) in the voltage supply that theTLCs produce. This is important because the Waveshield that we will be using shares the same ground as the TLCs and REALLY doesn't like electrical noise (it makes aweird, clicking noise).

    Image Notes1. Plug the capacitors somewhere between the TLCs and the cables that go tothe Freeduino's power supply (like here).

    Image Notes1. TLC Pin 28 (LED Out 0) is connected to a line on the LED connection side ofthe breadboard to make it easier to connect LEDS to the TLCs in a straight line.2. LED leads are connected in a straight line.3. LED Out 15 is also connected to the LED connections side of the breadboardby a small wire.4. Pin 15. Pin 14.

    Image Notes1. There is a small notch on this side of the TLC, it tells you what side pin 1 ison. It is represented in the typed wiring schematic by a U on the top.

  • http://www.instructables.com/id/Build-an-Arduino-powered-talking-robot-head/

    Step 14: Wire up the LEDs to the TLCsConnect all of the LEDs to the TLCs, row by row, starting with the one in the upper left-hand corner and moving on to the LED directly on the right. Here is a grid of all theLED TLC pin outs included for your convenience.See pictures for clarification.

    Mouth:

    0 1 2 3 4 5 6 7 89 10 11 12 13 14 15 16 1718 19 20 21 22 23 24 25 2627 28 29 30 31 32 33 34 35

    Now is also a good time to plug in your RGB LED eyes to the TLCs so here is the pin outs...

    RGB LED eyes:Left: R G B Right: R G B 36 40 38 37 41 39

    Don't forget to plug in the universal power wires for The Grid and RGB LEDs into 5V!

    Image Notes1. Plug this LED into LED OUT 0 of the TLCs.2. Plug into LED OUT 1.3. LED OUT 24. LED OUT 35. LED OUT 46. LED OUT 57. LED OUT 68. LED OUT 79. LED OUT 810. LED OUT 911. LED OUT 1012. I think you get the idea.....13. LED OUT 35

    Image Notes1. Both RGB LED connections. (6 wires total) LED OUT Pins 36-41. Group theColors of the LEDs in pairs. ie. Left Red lead p.36, Right Red lead p. 37. L Blue38. R Blue 39. L Green 41. R Green 42.

    Step 15: Wire up the servos to the TLCs. Connect the Power and Ground of the servos to Power and Ground on your breadboard. Connect the control wire of the Left servo (Your left while facing the robot.) topin 43 (Remember start at zero.) and the Right servo to pin 44. You will need to connect a 3.3K ohm resistor from both of those pins to 5V because the TLCs are powersinks and require power to sink.

  • http://www.instructables.com/id/Build-an-Arduino-powered-talking-robot-head/

    Image Notes1. Pins 43 and 442. 3.3K resistors going to 5V3. Left and right servo control pins

    Step 16: You are now entering the land of software and code! (mostly) Please no trespassing...

    Step 17: Download the TLC library. The latest TLC library for the Arduino can be found at their Google code page at: code.google.com/p/tlc5940arduino/.

    Download the latest library and insert the unzipped folder "Tlc5940" into [latest Arduino version folder]/hardware/libraries/

    Step 18: Test the TLCs. Load my serial expression test sketch which you can download below. Load it into the Freeduino and type some commands into the serial monitor to test that the wholething works.

    Here is the list of commands:

    behappybesadbemadfullmouthlinemouthoffmouthoffeyesbluegreeneyesredeyesblueeyesopenmouthtalkmouth (It doesn't talk, but it makes mouth movements)File Downloads

    TLC_improved_17orlater.zip (95 KB)[NOTE: When saving, if you see .tmp as the file ext, rename it to 'TLC_improved_17orlater.zip']Step 19: Download the improved, high-capacity supporting (Somewhat), Waveshield library. Download the new improved Adafruit waveshield from Google code (Thank you Mr Fat16 for making this improved library): code.google.com/p/wavehc/ Again stick the unzipped folder in the hardware/libraries/ folder.

    Step 20: Format and load your SD cards. Insert your SD cards into your computer and format them using the FAT or FAT16 file type. NOT FAT32! Then load your SD cards with speech files from AT&T's greattext to speech site www.research.att.com/~ttsweb/tts/demo.php#top Rename the files the name of the word that it is speaking in the file and truncate that file name tosomething that contains 6 or less letters. (The waveshield can only handle files whose filenames are 6 characters or less.) Ex.If you download the file for "Instructables.com" -> name it instrc.wavIf hello -> hello.wav

  • http://www.instructables.com/id/Build-an-Arduino-powered-talking-robot-head/

    Step 21: Test your Waveshield.Download and run my serial Waveshield test sketch. You should be able to through the serial terminal, type a sentence and have the Waveshield play it (As long as it hasthe .wav files that it needs). It will take the first word, add the ".wav" and play it before moving on to the second one.Ex.you type: Hello my name is Bob It will play:hello.wavmy.wavname.wavis.wavbob.wav

    Note : Test the Waveshield on the other Freeduino (the one that is not connected to the TLCs) because both the Waveshield and the TLCs use pins13,12,11 and 10 (onthe Freeduino). This is because these pins have hardware support for a interface called the Serial Peripheral Interface (SPI) that both the TLCs and the Waveshieldrequire. These pins cannot be shared between them so we will have to link two Freeduinos together using the I2C interface so that they may pass information betweenthem. More on this in step 22.

    File Downloads

    Waveshield_talk_by_serial_multiple_words_at_a_time.zip (147 KB)[NOTE: When saving, if you see .tmp as the file ext, rename it to 'Waveshield_talk_by_serial_multiple_words_at_a_time.zip']Step 22: Wire up the I2C interface between both Freeduinos.Wait... Why do we need to wire up a I2C interface between two Freeduinos? Why can't we just plug the Waveshield and the TLCs into one Freeduino? Here's why:Both the Waveshield and the TLCs use pins 13,12,11 and 10 on the Freeduino. The reason for this is that these pins have hardware support for a interface called theSerial Peripheral Interface (SPI) that both the TLCs and the Waveshield require and cannot share. This means that we will have to link two Freeduinos together usingsome sort of data connection so that they both work together in tandem. Serial was not an option because my computer was already using it to communicate to theWaveshield Freeduino, so after some intense Googling I found a remarkably convenient and simple communication method. I2C! Here is how to wire up the interface:

    Connect Analog Input pin 4 on both Freeduinos (This is the SDA or Serial Data Line.)Connect Analog Input pin 5 on both Freeduinos (This is the SCL or Serial Clock Line.)Connect the Ground on both Freeduinos (Otherwise the I2C interface will not work.)Connect the wire that you soldered at the beginning of this Instructable from resistor R7 on the Waveshield to Analog Input pin 1 on the TLC controlling Freeduino(Thiswire is for checking the volume of the words spoken by the Waveshield and is not part of the I2C interface). (See picture for clarification)

    Image Notes1. Connect the GND on the Waveshield Freeduino to the GND on the TLC Freeduino.2. Connect the Analog pin 4 on the Waveshield Freeduino to the Analog pin 4 on the TLC Freeduino. (This will be the Serial Data Line.)3. Connect the Analog pin 5 of the Waveshield Freeduino to the Analog pin 5 of the TLC Freeduino. (This will be the Serial Clock Line)4. The wire that you soldered here in step two should be plugged into Analog Input pin 1 on the TLC controlling Freeduino. (If soldering this wire never happened ordoesn't ring a bell, read step two over again.)5. This wire should be connected to Analog Input pin 1 on the TLC controlling Freeduino.

  • http://www.instructables.com/id/Build-an-Arduino-powered-talking-robot-head/

    Step 23: Enable I2C on the TLC controlling Freeduino. Enable I2C on the Freeduino that you used to control the TLCs by downloading this sketch. It will receive information on expressions from the Waveshield and will alsocheck the volume of the speech output on the Waveshield Freeduino and will move the mouth to simulate talking depending on the volume of the word being spoken.

    I2C definition: I2C is also known as TWI (Two Wire Interface) it is a simple way of connecting multiple devices together (up to 128!) with two data wires and a commonground.

    Update: I have added a blink feature to the Arduino Sketch. The robot will now blink at 2-11 second intervals, just like a human.

    File Downloads

    TLC_IC2_Slave_with_mouth_on_wave_with_added_features.zip (128 KB)[NOTE: When saving, if you see .tmp as the file ext, rename it to 'TLC_IC2_Slave_with_mouth_on_wave_with_added_features.zip']Step 24: Test the I2C interface. Download this sketch and load it onto the Waveshield Freeduino, it sends the words"behappy;" and then "besad;" over the I2C interface to the TLC controlling Freeduinoat two second intervals, hopefully making the robot go from happy to sad at two second intervals.

    File Downloads

    IC2_master_happy_sad_test.zip (87 KB)[NOTE: When saving, if you see .tmp as the file ext, rename it to 'IC2_master_happy_sad_test.zip']Step 25: Your almost done! Just some code to load... Load the final version of the Waveshield Freeduino code. It should take any words that you type into the serial monitor and speak them (as long as it has the .wav files todo it) and should pass expression commands like "behappy;" and "besad;" onto the Freeduino controlling the TLCs through the I2C interface.Note: The command list is the same for the earlier TLC test code (See step 17) except that you must add a semi-colon to every expression command. EX.If you want the robot to be sad and say "I feel sad" then type:besad; I feel sad.

    Update: The Waveshield Sketch now uses punctuation properly (i.e. periods and commas but not exclamation points ).File Downloads

    Waveshield_talk_by_serial_multiple_words_at_a_time_I2C_Improved.zip (170 KB)[NOTE: When saving, if you see .tmp as the file ext, rename it to 'Waveshield_talk_by_serial_multiple_words_at_a_time_I2C_Improved.zip']Step 26: Mount everything on the robot head box and you're done! Mount all of the Freeduinos onto the back of the box with wires. Close the top flap of the box with wires and you're done! Now if only it could check my email.Hmmmm.......

    Thank you for reading this Instructable! Comments are always welcome on anything!

    Image Notes1. Wire poked through the hole in the Freeduino and poked through the cardboard.2. Wire.3. Wire4. Wire5. Wire6. Wire7. Back of the robot head.

    Image Notes1. Linux penguin!

  • http://www.instructables.com/id/Build-an-Arduino-powered-talking-robot-head/

    Related Instructables

    The Dawm byZrvZ

    Skyline RGBLED Lamp(video) byearthshine

    How to makefist pumpingwith LEDanimation byMichelleMin

    Cheap, EasyRobotics for theNon-Programmer bydoctek

    Quick,Temporary, andCheap LEDDiffuser byCoffeebot

    Belvedere - AButler Robot bywolffan

    Comments23 comments Add Comment

    gudenaurock says: Jul 7, 2010. 11:54 AM REPLYThe penguin is Tux.

    1740 says: May 16, 2010. 5:56 PM REPLYWOW

    chosenone3 says: Nov 25, 2009. 2:06 PM REPLYI just watched the video and i can say that this is one of the coolest arduino projects I've seen so far :]And I was wondering how did you get it to speak so clear ,I mean it sounds like a real human voice.Would it be possible to get same results with pc (Besides MS sam voice which realy sucks)?

    xtremd says: Nov 27, 2009. 8:27 PM REPLYWell, I didn't use the Microsoft voices built-in with Windows because I found that they didn't sound very realistic, instead I used a AT&T text to speechservice found on their website that sounded much more realistic(You can find the website here: www2.research.att.com/~ttsweb/tts/demo.php#top ). Itwould sound even more realistic if AT&T's program didn't add a random pause between every word creating a sentence that sounded irregularand stuttery. This could be fixed by going through all of the audio files and editing them individually to create uniform sounding sentence but wouldrequire an enormous amount of time and work and is totally impractical.

    So, yes. You could use the Microsoft voices built in with Windows to create the audio files necessary, but I would recommend using the AT&T text tospeech website instead because the voices sound more realistic and less robotic. Davewking has a awesome Instructable on how to make somethingsimilar to my robot using Microsoft's voices(It checks his email!). He even created a convenient .exe file to assist in creating the .wav files! Here's a linkto his Instructable: www.instructables.com/id/Read-Email-with-Arduino-and-Wave-Shield/ which is a detailed subsection of his original Instructable: www.instructables.com/id/Sound-Switcher/#

    Hope this helps!

    Enki-][ says: Mar 28, 2010. 8:22 AM REPLYIt's probably useful to use festival (that's what I'd use, anyway). The default voices in festival aren't terribly realistic, but you don't get the pauses (andthe licensing problems -- the at&t thing has a big long license if you read it, and this project probably violates a bunch of the terms), and it doesn'tlimit the user base to windows users like using the microsoft voices does.

    willrandship says: Jan 15, 2010. 4:45 PM REPLYThat means three things to me.1. You could record your own voice for it (even make it sing!)2. Automatic talking text, similar to microsoft sam, through the head.3. You could hook this up as a speaker and it would sing whatever sound goes through it. Might take some hardware modification though.

    dpdesigns says: Jan 27, 2010. 6:48 PM REPLYvery cool robot head. I've been looking for something to do with my arduino and this gives me some inspiration.

    xtremd says: Jan 27, 2010. 6:56 PM REPLY I'm very glad that you like it! If you need some help with something related to this, please don't hesitate to ask.

    natfish says: Dec 2, 2009. 4:01 AM REPLY congrats! I'm glad you finished your robot. Whatever happened to your walking/dancing soda can?

  • http://www.instructables.com/id/Build-an-Arduino-powered-talking-robot-head/

    davewking says: Nov 17, 2009. 11:13 PM REPLYDude, let's get your robot reading emails. I just posted an instructable that could help out http://www.instructables.com/id/Read-Email-with-Arduino-and-Wave-Shield/ . Feel free to send me emails with questions.

    xtremd says: Nov 20, 2009. 6:52 PM REPLY Your Instructable gave me some very good ideas that should solve some of the problems that have plagued my robot head. Thanks for your help!

    mfleisig says: Nov 20, 2009. 7:12 AM REPLYNice work! I love the eyebrows.

    jefskil says: Nov 14, 2009. 1:04 AM REPLYi can't wait for that video either!

    how much did all this cost you?

    xtremd says: Nov 16, 2009. 3:13 PM REPLY Well I'm not sure of my exact costs because this began as a physical computing end of the year project. This meant that I don't know the actual costs ofsome things (like the LEDs) but I can tell you approximately how much this would cost you if you bought this stuff from the Internet and salvaged the restfrom various sources. Here goes...

    Red LEDs: After searching around the Internet, I have seen most Red LEDs priced around the 40-50 cent price range so lets assume you get them for45 cents each. 36 X $.45 = $16.20Common Anode RGB LEDs: Again after searching online I have found that they are mostly around $1.50 each to $1.95. Lets say $1.75 each. 2 X $1.75= $3.50Freeduinos: Bought from http://www.nkcelectronics.com/freeduino-arduino-diecimila-compatible-board-complete-kit.html $23.99 each. 2 X $23.99 =$47.98Mini-Servos: Again after looking around the 'nets I found a website selling the exact model servos I used in this Instructable. Here's the link:http://www.hobbycity.com/hobbycity/store/uh_viewItem.asp?idProduct=662 They're selling them for $3.65 each. 2 X $3.65 = $7.30Waveshield: From LadyAda's Waveshield page http://www.ladyada.net/make/waveshield/ she's selling them for $22 each.TLC5940NTs: From Digi-key http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=296-17732-5-ND they can be bought for $4.28 each. 3X $4.28 = $12.84And it adds up to a total cost of... $109.82!*The rest of the materials you should be able to salvage from other computer parts, or you might just find them lying around.Hope this helps!

    Kiteman says: Nov 11, 2009. 1:29 PM REPLYIt talks?

    The mouth "moves"?

    We need to see video!

    xtremd says: Nov 11, 2009. 2:48 PM REPLYThanks for reminding me,(I forgot to make a video of the robot when making the instructable) I will try to see if I can post a video of it working beforeSunday.

    cowscankill says: Nov 11, 2009. 6:13 PM REPLYYay!

    xtremd says: Nov 14, 2009. 3:22 PM REPLY The aforementioned video is now embedded into the intro step. I hope that you guys find it informative!

    ElectronicsNub says: Nov 11, 2009. 2:13 PM REPLYwhat exactly does it do?? i've never heard of this arduino stuff before so i'm wondering what these do.

  • http://www.instructables.com/id/Build-an-Arduino-powered-talking-robot-head/

    xtremd says: Nov 11, 2009. 3:00 PM REPLY Are you talking about Arduino, or my robot head?

    Arduino is a micro controller chip that can control servos, lights, relays and can be hooked up to lots of sensors to do amazing things. Here's more infoon Arduino www.arduino.cc/en/Guide/Introduction

    My robot head can speak words fed to it through a serial connection from a computer (You type what you want it to say on the computer, and thecomputer tells the robot head what to say.) It can also change its expression by moving its eyebrows and changing the color of it's eyes(Again throughserial).

    ElectronicsNub says: Nov 13, 2009. 3:50 PM REPLYIn fact, i was wondering both but you cleared it up for me. Thanks!

    beardy says: Nov 12, 2009. 7:15 AM REPLYLots of fun stuff going on there. Well done!

    Do post a video if you can. I think we'd all like to see and hear it in action.

    [m]

    tigoe says: Nov 12, 2009. 6:46 AM REPLYVery nice robot head, good work! You may want to include a first step listing the parts, with links explaining them and where you got them, so that peoplewho don't know them can find out more.