Knowledge for the World

I turned a Furby into an Amazon Echo. Introducing: Furlexa

I'm sorry.
  • by Zach (125)
  • 3 hours

I thought I'd make Furby a little less annoying and give him an upgrade with a real brain. Step aside, Tin Man.

By combining a Raspberry Pi Zero W (a tiny computer), Amazon's (mostly) open-source Alexa Voice Service software, and a few other electrical components, I converted my normal Furby into an Amazon Echo.

I give you: Furlexa.

It is my hope that you can either use this guide as a fun read or to build your own Furby Echo -- I tried to write it in a style that any crowd would enjoy and I hope that I accomplished that goal.

howchooer Jeremy wrote a separate guide for building your own Raspberry Pi Amazon Echo (without the Furby) if you'd like to explore doing so without involving Furby.

Watch the video, then read on!

I created a video that demonstrates Furlexa and briefly explains what I did -- the rest of the guide (below) contains more details on my build, so be sure to check out both. :)

1

First, the finished product

As the prophecy prophesizes, first a completed photo! Here's Furby with his fur and carapace (bug-like exoskeleton) removed.

2

And fully reassembled

Here's Furby fully re-furred. Refurby.

3

Furby is a pretty amazing piece of technology, especially considering it's nearly 20 years old -- and when I was a kid, it was a magical, mysterious thing. Furby was released by Tiger Electronics in 1998 and quickly became the toy of the holiday season, demanding insane prices on eBay and even being banned from NSA property over concerns that it could be used to spy on the United States.

".. less than a foot high, covered with red and orange fur, with watchful eyes and big ears." - NSA

In the NSA's words, the spy was described as being "less than a foot high, covered with red and orange fur, with watchful eyes and big ears". Of course, these concerns were unfounded since Furby has no ability to record anything, and its microphone is a piece of crap.

Anyways, in case you missed out on it due to age or interplanetary habitation, Furby could "learn" to speak English by being exposed to other Furbies as well as other noises (read: humans). It basically sits around and becomes extremely annoying, chiming in to distract you at every opportunity. It could "communicate" with other Furbies via an infrared sensor, which was pretty revolutionary at the time, and would "sleep" when its light sensor told it that it was dark. It also sang... So, yeah.

4

How [the unmodified] Furby works and why it's so hackable

Furby is comprised of a few primary components -- a microprocessor covered in black resin (to protect Tiger Electronics' intellectual property), infrared and light sensors, microphone, speaker, and -- most impressively -- a single motor that uses an elaborate system of gears and cams to drive Furby's ears, eyes, mouth and rocker. A cam position sensor (switch) tells the microprocessor what position the cam system is in. By driving the motor at varying speeds and directions and by tracking the cam position, the microprocessor can tell Furby to dance, sing, sleep, or whatever. Pretty cool.

This is what piqued my interest -- though the microprocessor isn't worth messing around with (especially when covered with the obfuscated blob of resin), it would be easy to install a small Raspberry Pi computer inside of Furby, use it to run Alexa, and then track Alexa's output to make Furby move.

The infrared and light sensors are an interesting development as well; I decided not to do anything with them for this project, but they're still there for enhancing Furlexa in the future. ;) For example, I could tell Alexa to turn my TV on, and use Furby's infrared emitter to send out the appropriate controller IR code. Anyways, I'm going to keep it simple for now.

Long story short, Furby is super hackable.

5

Furlexa in a nutshell

For my Furby hacking project, I replaced the original CPU and related circuitry with a Raspberry Pi Zero W.

Speaker and microphone

I upgraded Furby's sound input and output (I/O) with a USB microphone and a small amplifier and speaker. To save space, I soldered the amplifier board directly to the Pi's GPIO (general-purpose input/output) pins. The new speaker lives where the original one did. The original speaker sucks.

Running Alexa

The Pi is running Alexa Voice Service (AVS) to provide full Amazon Echo functionality.

Animating Furby

A small motor control driver/board is connected to the Pi's GPIO pins and is used to control Furby's original DC motor and gearbox. When Alexa speaks, so does Furby! Since the Pi doesn't supply enough voltage or current to power the motor, the motor itself is powered by Furby's original battery pack.

Cost & complexity

I spent about $50 on the materials for this project, including Furby himself (about $15 on eBay). This guide is not overly complex -- all you need is some light soldering and the ability to Google things (like how to solder).

6

The struggle was real

This was probably my longest-running project -- I worked on it on and off for a year, struggling through many setbacks (and Furbies). Furby's small size was the biggest limitation. I always knew I'd use a Raspberry Pi Zero but the Raspberry Pi Zero W (wireless) version didn't exist when I started -- and WiFi is needed for this project. Luckily, it was released midway, so this solved many, but not all, of the issues.

If I were to build Furlexa now, however, it would only take a few hours. :)

7

Challenge: Furby's original processor

For obvious reasons, Furby's OEM processor isn't capable of running any version of Linux that I could use to integrate the Amazon Alexa Voice Service. Also, it's covered in a blob of black resin to make it harder to even identify.

Solution: Use a Raspberry Pi instead.

8

Challenge: Furby is a small fellow and his speaker sucks

There's not a lot of space in there. My original circuitry (pictured) took up a lot of space and I wanted Furby to look completely normal from the outside. This was what I originally needed to fit:

  1. A Raspberry Pi Zero
  2. A wifi dongle/USB hub (I found an all-in-one wifi dongle + USB hub)
  3. A small audio circuit (amplifier + USB hub)
  4. A DC motor driver to allow the Pi to power the motor
  5. A USB audio adapter since the Pi Zero has no audio jack
  6. A small microphone

Solution: Thankfully, midway through my project the wireless version of the Pi was released. Also, Pimoroni released the Speaker pHAT, a slim mono amplifier/speaker combo. This eliminated most of my original circuit.

9

Challenge: Furby's gearbox is loud

As you may have seen in my video, Furby's gearbox is pretty loud -- and it's hard to fit a tiny but super loud speaker in there. A single motor drives a series of gears and cams to operate every part of his body. That's a lot of plastic mashing around in there.

Solution: Lubricate his gearbox using nonconductive lubricant. Also, accepting the limitations of what I'm trying to do here. :)

10

Challenge: The Alexa Voice Service doesn't support the Pimoroni Speaker pHat

Amazon AVS only officially supports sound output through the Raspberry Pi 3's 3.5mm audio jack or HDMI. I'm using an amplifier attached to the Pi's header instead. In fact, AVS doesn't officially support the tiny Raspberry Pi Zero at all.

Solution: Lots and lots of hacking. Also learning tons about Advanced Linux Sound Architecture (ALSA), which I would not recommend exploring recreationally. This led me to the following to get AVS working with the Speaker pHAT:

Run the Speaker pHAT installer

curl -sS https://get.pimoroni.com/speakerphat | bash

Disable asound.conf

Disable your asound.conf file, if it exists, by renaming it:

sudo mv /etc/asound.conf /etc/asound.conf.backup

Use .asoundrc instead

Edit your .asoundrc file:

sudo nano ~/.asoundrc

Make sure the contents of that file are as follows:

pcm.!default {
    type asym
    playback.pcm {
        type plug
        slave.pcm "plughw:0,0"
        format S16_LE
    }
    capture.pcm {
        type plug
        slave.pcm "plughw:1,0"
    }
}

Increase Speaker pHAT output volume

Finally, adjust output volume by running the alsamixer command.

11

Challenge: I broke Furby

I got a little overzealous trimming things and accidentally clipped off a tiny lever that keeps the gearbox from committing suicide. I tried to fix it, but Furby's gearbox is comprised of a series of gears, cams, and levers. It was like trying to reassemble a clock.

Solution: Order a new Furby. Also, not do that thing I said.

12

Challenge: And then I screwed up

Furlexa was complete. I ran my final test and the speaker started getting super hot. The amplifier board was shorting against the Pi somewhere. I tried desoldering the board but learned that desoldering 80 pins (40-pin header, both sides) is basically impossible. So I had to start over.

Solution: Order a replacement Pi and amplifier and use Kapton tape to insulate the amplifier and prevent shorts.

13

Skinning Furby alive

"Sometimes science is more art than science." - Rick, to Morty

Before I can build my Furby/Alexa cyborg and unleash this beast upon humanity, I'll need to perform some surgery. Since this isn't very exciting, I wrote a separate guide outlining the steps required to disassemble Furby, should you decide to build your own Furlexa.

Basically, Furby's skin is held on by a zip tie at its base; beneath the fur is a carapace, or exoskeleton, much like a large insect. Once you remove both of these things, Furby becomes alarmingly scary.

14

Making some room

Space is at a premium here so we're going to remove some of the stuff we won't need. We need to make room for quite a few things:

I started by removing all of the connectors from the board. Then, I clipped off pretty much every other component that wasn't structural or related to the cam/sensor system. In the end, I ditched the original circuitboard entirely to save some vertical space.

15

Driving Furby's motor

This was the most challenging part of the project, other than fitting everything into Furby's carapace without shorting things together. I wrote a separate guide on driving DC motors using your Raspberry Pi that dives into this in greater detail. Basically, your Pi's GPIO pins send signals to a small DC motor driver board. This board receives power from a larger power supply (Furby's original AA battery pack) to power the motor. The board also receives power from the Pi's GPIO pins to power its own logic circuits.

A bit of software running on the Pi will tell the motor when and how to run (more on this later) by monitoring when audio is being output through the sound card. This is better than simply listening for microphone input as you don't want Furlexa animating when it hears a noise (though this might be interesting).

I created a Fritzing diagram outlining the schematic if you're into that sort of thing. :)

16

The software

There are three key pieces of software that make Furlexa possible:

  1. Amazon Alexa on the Raspberry Pi (more on that below)
  2. A script to control Furby's motor
  3. A script that detects when Alexa is speaking and calls the motor program

Amazon Alexa on the Raspberry Pi

Amazon open-sourced Alexa for the Raspberry Pi nearly a year ago. It wasn't until later when they added wake word support that people were truly able to build their own Echo devices. A wake word is essentially a word that the system is continuously listening for, hence these devices "always listening" to everything you say. Once the wake word engine detects the wake word -- "Alexa", "Echo", or "Amazon" -- depending on your settings, Alexa is activated and processes your request just like any Amazon Echo device would.

Getting it running is super simple -- just follow the instructions on their Github page.

Control Furby's motor

howchooer Tyler wrote the following Python script to drive Furby's motor (thanks Tyler!). Again, you can reference my Raspberry Pi DC motor control guide for more details and examples.

To install this script into your own Furlexa, log into your Pi and create the file, furby.py:

sudo nano ~/furby/furby.py

Paste the following into that file and change soundcard_status_file to point to the status file for your particular sound card. For help determining which status file is in use, see here.

Finally, save and exit.

#!/usr/bin/env python

# Import required modules
import time
import RPi.GPIO as GPIO

# Declare the GPIO settings
GPIO.setmode(GPIO.BOARD)

# Set the filename and path for the sound card in use (See: https://howchoo.com/g/mmnhmti2zjz/how-to-detect-that-audio-is-currently-being-output-in-linux-and-use-it-to-call-a-program#create-an-audio-output-monitor-script)
soundcard_status_file = '/your/sound/card/path/and/filename' # e.g. '/proc/asound/card0/pcm0p/sub0/status'

# Turn off GPIO warnings caused by us declaring our pins outside of the start_furby and stop_furby functions
GPIO.setwarnings(False)

def start_furby():
    # Drive the motor clockwise
    GPIO.output(16, GPIO.HIGH) # Set AIN1
    GPIO.output(11, GPIO.LOW) # Set AIN2

    # Set the motor speed
    GPIO.output(7, GPIO.HIGH) # Set PWMA

    # Disable STBY (standby)
    GPIO.output(13, GPIO.HIGH)

def stop_furby():
    # Reset all the GPIO pins by setting them to LOW
    GPIO.output(16, GPIO.LOW) # Set AIN1
    GPIO.output(11, GPIO.LOW) # Set AIN2
    GPIO.output(7, GPIO.LOW) # Set PWMA
    GPIO.output(13, GPIO.LOW) # Set STBY

def main():
    # Set up GPIO pins
    GPIO.setup(7, GPIO.OUT) # Connected to PWMA
    GPIO.setup(11, GPIO.OUT) # Connected to AIN2
    GPIO.setup(16, GPIO.OUT) # Connected to AIN1
    GPIO.setup(13, GPIO.OUT) # Connected to STBY

    # Open file and check contents
    with open(soundcard_status_file, 'r') as fh:
        value = fh.read()
        if value == 'RUNNING':
            start_furby()
        else:
            stop_furby()

if __name__ == '__main__':
    main()

Detect when Alexa is speaking

There's a Linux file whose contents change when audio is being output; this is how we're going to detect when Alexa is speaking -- by monitoring the contents of this file. I wrote a separate guide for driving a DC motor based on Linux sound output since there are several steps here, and not many exciting ones. :)

17

Stuffing Furby like a Thanksgiving turkey

After assembling the Pi, amplifier, speaker, and DC motor driver, I tested everything thoroughly.

Now for the hard part: fitting everything in place. Because I soldered the wires directly to my Pi's GPIO to save room, I left some slack in each wire. The speaker wires ended up being a tad short but nothing terrible. I secured everything in place with foam tape, ensuring not to short anything to the original Furby circuitry.

I originally wanted to install a lithium polymer (LiPo) battery to power Furby but since most of the small LiPos are 3.3V I would've needed to use a voltage booster to make it work. Unfortunately, there was no space left in Furby for either of these things, so I opted to simply run a cable out of Furby's back for an AC adapter instead.

Finally, I reassembled Furby's carapace and then he grew some fur remarkably fast. The attached image shows the final assembly after carefully, but lovingly, jamming everything into Furby.

18

Will my Furby catch fire?

Maybe! Just kidding, though I thought about this a lot. Electronics can get hot.

First, I needed to find out how flammable Furby was so I unscientifically lit one on fire in my DIY fire pit. After much observation, I concluded that it was mildly interesting.

I also concluded that because the Pi will never get hot enough to melt through Furby's carapace, and his electronics will never be in direct contact with his fur or skin, he will probably not self-immolate. The Pi may stop working, but we'll see. It's been running continuously for days and so far so good. Still, if you build your own Furlexa, it's better to play it safe and take proper precautions.

19

If you're daring enough to build your own Furlexa or would like to install Alexa for Pi into another enclosure, post in the comments section below. I'd love to hear from you and help you out wherever possible.

If you'd like to get started by building a simpler Raspberry Pi Echo using a Raspberry Pi 3 (without a Furby), we have a guide for that too!