Introduction: Control a Furby With Arduino (or Other Microcontroller)

About: Indie Film! Art science! Reuse and sustainability!

The Million Dollar Furby: We can rebuild him. We have the technology.

Continued from the previous Instructable where we excised Furby's primitive brain , it's now time to replace it with something greater.

This Instructable will detail how to install a new microcontroller in place of Furby's old brain, making him into a fully controllable robot puppet. We might not have a million dollars to rebuild him, but we won't need it: I'll be using the Arduino, a microprocessor and board which can cost under $20.

Note 1: These steps are about the old Furby with the moving plastic eyes (Tiger Electronics, 1998-2001). The new one is different in many ways!

Note 2: WARNING: This is not really a beginner's project. I really tried to make it "basic," but it didn't work out. I'd say it's somewhere between "Advanced" and "Jedi." Sorry about that. Therefore, I've had to assume you can solder, code, and even build simple robots yourself.

I'll get you started to the point where we write some code, but after that you are on your own! The reason for this is, the state of microcontroller boards changes so fast, any code I put in here will be obsolete in weeks to months, and the hardware obsolete within a few short year. Instead, I'll provide the pinouts so you can use whatever board you want, and loose outlines for how control software could work.

Good luck!

Step 1: What You'll Need

Here's what you'll need for this project:

  • a Furby, preferably already disassembled (from the previous instructions)
  • a microcontroller and board
    • I'm using an Arduino Mega 2560, but it could just as easily be one of the lighter Arduinos
      • a computer to develop and upload the code
    • some wires (I'm using a ribbon cable)
      • a way to connect the wires to the microcontroller board - I'm using pins to make everything tidy
    • soldering equipment:
      • soldering iron
      • solder
      • needle-nose pliers
      • wire cutters
      • wire stripper
    • a few buttons


    Optional but very helpful:

    • some way to hold wire and parts while you solder them
    • a power supply (to run Furby's motor)
    • more wire pins to run:
      • from Furby's PCB to his base
      • from Furby's PCB to his body
    • a protoboard


    Whew!

    Step 2: Furby Board Pinouts

    Consult my previous tutorial to dissect Furby and get to his board.

    Remove the daughter boards that hold furby's processor and speech synthesizer. I have a separate project to (someday) use the speech synthesizer board... someday!

    Here's a pinout for the board. We won't be using all of them, but here they are for future reference. Numbered counter clockwise from the bottom right:

    MAIN BOARD

    • 02 - /FEED - sensor, negative logic - Furby's tongue
    • 03 - MOTOR REVERSE - one of the two inputs to Furby's H-bridge and motor which controls his eyes, ears, mouth, and body tilt
    • 04 - MOTOR FORWARD - the other H-bridge input
    • 05 - GEAR LED - a LED which lights up the slots in the gear to detect motor movement - must be on for Motor control!
    • 06 - /POWER DOWN - must be raised HIGH for Furby's hardware to work
    • 07 - SOUND IN - wired to Furby's primitive microphone
    • 08 - LIGHT IN - wired to Furby's primitive light sensor in his forehead
    • 09 - UPSIDE DOWN? - raised HIGH if Furby's tilt sensor is all the way upside down
    • 10 - TILT? - raised HIGH if Furby's tilt sensor is tilted. Note that there is actually an unused third terminal on the tilt sensor which is on if Furby is "level"
    • 11 - SELECT EEPROM - one of a few data-driven pins. This one selects Furby's memory, which I won't be addressing here.
    • 12 - ? (data line to 2nd board)
    • 13 - IR IN - infrared communication Furby uses to talk to other Furbys
    • 14 - SERIAL IN - used to control the speech synth and memory
    • 15 - ? (data line to 2nd board)
    • 16 - ? (data line to 2nd board)
    • 17 - SERIAL OUT - used to control the speech synth and memory
    • 18 - SERIAL CLK - used to control the speech synth and memory
    • 19 - /RESET - negative logic "reset" switch under Furby's tail
    • 20 - TUMMY - the button on Furby's stomach
    • 21 - /BACK - the negative logic button on Furby's back
    • 22 - GEAR ROTATION - HIGH when sensor sees light through the slots in the gear to detect motor movement - an essential part of Furby's Motor control
    • 23 - /CAM HOME - negative logic sensor which goes on once a revolution of Furby's gear
    • 24 - GND for the board
    • 25 - +5.31 V power for the board


    SPEECH SYNTH BOARD

    • 01 - 06 - data lines, SERIAL IN/OUT/CLK
    • 07 - GND
    • 08 - +6V
    • 09 - SPEAKER+ - one of two contacts for the belly speaker
    • 10 - SPEAKER- - one of two contacts for the belly speaker
    • 11 - IR OUT - infrared communication Furby uses to talk to other Furbys
    • 12 - data line

    Step 3: Connecting Wire Ribbon

    Next we connect wires to these contacts.

    I'm using wire ribbon to make things cleaner. This is 25 wires all attached together.

    The main daughterboard has 25 contacts by itself - however some need not be connected to the ribbon

    • I'm using an Arduino board, so we don't need power or ground in the ribbon
    • the speech synthesizer has been removed as well, so we don't really need any of the SERIAL data lines


    However, we DO need the remaining sensor/actuator contacts from the second daughterboard - mainly the speaker outputs

    Optionally we could:

    • wire the IR output from the second daughterboard... just in case we want to use IR communications later
    • wire the SERIAL data lines anyway - why? so we could access the Furby "memory" and retrieve his name


    However, I don't have enough wires in my ribbon, so I'll just connect the speakers and IR without any data lines.

    So:

    1. First map out which wires go to which contacts
    2. Make sure each wire is long enough to get to its contact!
    3. strip the wire ends
    4. solder

    Step 4: Connect Microcontroller Pins

    On the other end of the ribbon is our microcontroller.

    We need to make sure the ribbon contacts are compatible with the microcontroller.

    Since I'm using an Arduino, and it already has header pins on its board, I need to attach female pins to the ribbon.

    Now we've plugged in all the sensor outputs and motor inputs.

    Step 5: Define the Pins on the Board and Connect

    This part is a matter of preference, but when I write code, I prefer not to memorize which pins are plugged into which functions.

    Thus I've defined at the top of the code which functions are which pins.

    But, because sometimes I unplug the ribbon and forget which went where, I also defined the ribbon pins.
    Therefore, I have three sets of #defines .

    A sample - here's the code that defines the motor functions:

    First I define the functions. These are the names I use in the code.
    They are defined in terms of the pins on the board.

    #define MOTOR_FORWARD U1_FORWARDMOTOR
    #define MOTOR_REVERSE U1_REVERSEMOTOR


    Next I define which pins on the board go to which ribbon wires:

    #define U1_REVERSEMOTOR RIBBON_A_8
    #define U1_FORWARDMOTOR RIBBON_A_7


    Finally the ribbon maps to the pins on the arduino board. These may get redefined if I plug the ribbon into other parts of the board:

    #define RIBBON_A_7 36
    #define RIBBON_A_8 38


    NOTE: What's with all the RIBBON_A business you ask?
    I broke the ribbon up into parts, and named them to keep track of them:

    • RIBBON_A = large ribbon - 10 pins
    • RIBBON_B = small ribbon - 2 pins
    • RIBBON_C = medium ribbon - 7 pins
    • RIBBON_D = small ribbon - 3 pins

    For my setup, I've arranged them in a 11x2 grid on the arduino Mega so they are compact.

    • RIBBON_A + RIBBON_B_0
    • RIBBON_C + RIBBON_D + RIBBON_B_1


    Lastly, I define where my buttons go. Because they are "negative logic" buttons, that is LOW when pressed, their names start with "X" :

    #define XBUTTON_FWD 52
    #define XBUTTON_REV 53

    Step 6: PROJECT 1: Basic Motor Control

    Most of the hard part is getting a simple example working, so the programmatic goals for this step are basic:

    PHASE 1: Motor test - interactive

    • press one button and it goes forward (without stopping)
    • press the other and it goes in reverse (without stopping)

    You'll need two buttons, connected to pins on arduino and GND.

    Arduino needs two functions, "setup" and "loop".

    setup() runs only once. It's where you define your pins.

    void setup() {
    // put your setup code here, to run once:

    pinMode( XCAM_HOME, INPUT );
    digitalWrite( XCAM_HOME, HIGH ); //pullup

    pinMode( MOTOR_FORWARD, OUTPUT );
    pinMode( MOTOR_REVERSE, OUTPUT );

    // BUTTONs are negative logic
    pinMode( XBUTTON_FWD, INPUT );
    digitalWrite( XBUTTON_FWD, HIGH ); //pullup
    pinMode( XBUTTON_REV, INPUT );
    digitalWrite( XBUTTON_REV, HIGH ); //pullup

    } // setup


    Next, loop() - this runs very often, so you want to make any code run here as short as possible:

    unsigned motorForwardP = 1;
    // put your main code here, to run repeatedly:
    void loop() {
    updateMotorFromButton();
    } // loop

    Finally, the code that does all the work: it reads from the buttons and sets the motor pins appropriately. We set a global flag to mark which direction we're going.

    /* read button and set variables accordingly */
    void updateMotorFromButton()
    {
    char forwardButton = (digitalRead(XBUTTON_FWD) == LOW);
    char reverseButton = (digitalRead(XBUTTON_REV) == LOW);

    // don't do anything if both are pressed
    if (forwardButton && reverseButton) return;

    if (forwardButton) {
    motorForwardP = 1;
    moveForward();
    }

    if (reverseButton) {
    motorForwardP = 0;
    moveReverse();
    }

    } // updateMotorFromButton

    Here's the utility methods which turn the motor on or off forwards or reverse. Notice we set both LOW initially to prevent any burnouts!

    // set motor pins to move forward
    void moveForward()
    {
    digitalWrite(MOTOR_REVERSE, LOW);
    digitalWrite(MOTOR_FORWARD, HIGH);
    } // moveForward

    // set motor pins to move reverse
    void moveReverse()
    {
    digitalWrite(MOTOR_FORWARD, LOW);
    digitalWrite(MOTOR_REVERSE, HIGH);
    } // moveReverse



    Now, test it!





    Step 7: A Note on Furby's Expressions

    Interestingly, Furby has only one motor to control all his parts:

    • eyes
    • mouth
    • ears
    • body tilt

    These positions are all encoded on a single giant cam.

    But which positions are where?

    We'll need an easy way to read the cam, or we'll need a way to control Furby one cam-tick at a time!

    Step 8: PROJECT 2: Precise Motor Control

    Now we want the buttons to move Furby's cam only a single cam step forward or backwards.

    Afterwards, we'll also want an indicator when the cam goes to its "home" position.


    To do this we'll need the LED encoder. If you harken back to the PCB pinout, you'll remember

    • GEAR ROTATION which detects the perforations in Furby's cam as it moves
    • GEAR LED which lights the LED shining through the cam
    • CAM HOME which activates when the cam is in the "home" position

    What we'll be doing is lighting the LED, and watching the ROTATION sensor.

    In outline:

    • First we define these new pins and establish them in startup()
    • We tell startup() to watch:
      • the button(s) pins (GO FORWARD and GO REVERSE)
      • and sensor pin (GEAR ROTATION)
      • ...and run "encoder" when any changes
    • Next we need to write encoder() which calls read_button and read_sensor
    • read_button - the interrupt was from one of the buttons
      • set MOTOR FORWARD or MOTOR REVERSE
      • exit encoder()
    • read_cam_sensor - the interrupt was from the cam moving
      • reads CAM HOME - are "home"? If we are, reset our known position. If not, continue counting from the last known position.
      • if so, which direction were we going? (MOTOR FORWARD or MOTOR REVERSE)
      • from this calculate the new position
      • stop the motor! Set both MOTOR FORWARD and MOTOR REVERSE to off.



    Step 9: Appendix: Circuit Bending

    The dark art of Furby engineering!

    Most circuit-bending is done without any knowledge of where the effect is coming from. Experimenters are literally connecting random points together. That means quite frequently they are moving electrical current to delicate transistors inside integrated circuits in directions and quantities that were not anticipated by the designers.

    What does this mean? Eventually these connections will fry the insides of Furby. In most cases, this is considered acceptable - the Furby (or other toy) is basically junk, and experimenters are giving the toy a new life.

    However, with enough analysis, it should be possible to reverse engineer a Furby (or any other toy) get these weird effects and not break the device. I'm just sayin'. Of course, at that point, it might be easier to design a new device from scratch, but come on! Have some pride in workmanship here, people!

    With that ranty caveat in mind, there are many more resources available online.

    For example, check out http://circuit-bent.net/furby-bending-tutorial.ht...

    Here's some popular points, as summarized by Kevin Rees and Patch wrangler .

    From Patch Wrangler, who was hooking up these points to a computer mouse:

    • The common point on the furby (+V) connects to the common on the mouse board via white wire.
    • Glitch point to left mouse button via brown wire.
    • Loop 1 point to centre mouse button via green wire (lead one). This is the better loop point, next time move it to the right button
    • Loop 2 point to right mouse button via yellow wire (lead one).
    • Reset switch to one side of scroll switcher via green wire (lead two).
    • Reset switch to other side of scroll switcher via yellow wire (lead two).