Dr. Furby

So, years ago, when my sister and I were still kids I uh… well, I’m going to skip my role in all of this(it was minimal, trust me); and, skip to the part where my sister woke our parents up crying on night that her Furby was haunted and trying to hurt her. Now years later it is a family joke that my sister doesn’t like Furby’s. Hence the idea… Why not take something that use to scare my sister and make it something she… “loves.”

So in the spirit of the season, this year I have elected to personalize a Furby for my little sister.

The Plan:

  1. Tear the Furby apart
  2. Remove its guts
  3. Throw a Raspberry Pi Zero in it
  4. Have the Pi control the motors via an old MotoZero to notify my sister when Furby has a new message for her(this was a spectacular let down because my Furby’s motor was dead.)
  5. Throw an LED in the forehead and behind the eyes(because the motor was dead)
  6. Throw a scaled-back version of an old “digital assistant” I wrote
  7. Write a fun bit of code that allows my family to “email the Furby,” and have it read the messages back to my sister over her TV.
  8. Use Crontab to start (6) and (7) on boot.

The Tear Down:(It may be advisable for you to have a drink first, this thing is creepy “naked”)

To start… We’ve got to do something about all of that pesky fur on the outside. To “skin” the Furby, we begin by cutting a zip-tie hidden under the fur just below the tail. Then start pulling the fur up. You might have to pull a few spots loose here and there because it was glued down. You’ll keep pulling until you get up to the ears. There you’ll find strings attaching the fur to the now not so fury Furby. Cut them and pull it the rest of the way off. Finally, we’ve got to take that pesky shell off. To do that, just locate the screws holding it all together and pull it apart.

1213191645.jpg

SCALPEL! :

motors

Ok, so first start pulling out the tabs connected to the board. To do this, I just used a screwdriver and a pair of needlenose pliers. Next, we need to identify the wires to the motors. I’ll give you one guess where they might be.

Chop-suey!!! :

It may help to remove the “head” from the “body.” Now…

CUT’EM ALL! ALL THE WIRES!!!! Except for those two… They should be left alone. Don’t cut them. We need the motor wires for later. But all the other wires… CUT’EM!!! Cool ok! Now that board on the bottom… DITCH IT! Yea… definitely ditch it. We need to make room for all of our boards. Now, screw the head and body back together.

So uh… I was running out of time to get this made before XMas, and totally forgot to take pictures… But, I’ll try to do this over again and add them then. Also, the Furby I bought on the Goodwill website had a bad motor. So, I’ll be skipping over that for now too. As a result, I’ll be adding LEDs to the Furby that will flash when a message is received.

LET THERE BE LIGHTS!!!! :

So, just because we need to let the person know they have messages and my motor is shot, we’re going to throw some LEDs in. So, I put 3 LEDs in, one in the forehead thing and then one behind both eyes… Yea… You can’t see the one behind the eyes, so just use the one. Trust me, it’s better this way… it was hard to put back together with all 3.

To start, grab yourself an LED… you want it to go into one of the holes in the head. You’ll also want a resistor. To pick the resistor with the appropriate resistance, look up the forward voltage(F) value and the necessary current(A) to power you LED. The resistance of your resistor needs to be (Source-F)/A. Assuming you’re using one of the pins on the Pi to power the LED then you’re source is going to be 3.3v.

Soder the resistor to the long leg(positive lead) of the LED and wires onto the other end of the resistor and remaining LED leg(negative lead). Now, soder the “negative wire” to a ground pin on the zero and the “positive wire” to any of the GPIO pins.

pinout

CODE IT! :

Now it’s time to rattle the keys… Here is a copy of the quick sketch I through together-

mesList = []

def Short():
	from gpiozero import LED
	from time import sleep
	eyes = LED(23)
	head = LED(24)
	for count in range(5):
		eyes.on()
		head.on()
		sleep(1)
		eyes.off()
		head.off()
		sleep(1)
		
def On():
	from gpiozero import LED
	from time import sleep
	eyes = LED(23)
	head = LED(24)
	eyes.on()
	head.on()
		
def Off():
	from gpiozero import LED
	from time import sleep
	eyes = LED(23)
	head = LED(24)
	eyes.off()
	head.off()

def getEmails():
	import easyimap
	import datetime
	moment = datetime.datetime.now()
	login = 'ACCNT'
	password = 'PWD'
	print("Getting emails at " + str(moment))
	imapper = easyimap.connect('imap.mail.yahoo.com', login, password)
	for email in imapper.unseen():
		if ("furby" in email.title.lower() or "tucker" in email.from_addr.lower() or "@vtext.com" in email.from_addr[10:]):
			print("e-mail preprint: ", str(email.body))
			mesList.append(email.body)

# Responsible for vocalising responses
def speak(audioString):
	from gtts import gTTS
	import pygame
	print(audioString)
	tts = gTTS(text=audioString, lang='en-uk')
	tts.save('DrFurby/srcs/audio.mp3')	
	pygame.mixer.init()
	pygame.mixer.music.load('DrFurby/srcs/audio.mp3')
	pygame.mixer.music.play()
	while pygame.mixer.music.get_busy() == True:
		continue

# Responsible for "listening and returning the users comments
def Listen():
	import speech_recognition as sr
	On()
	# Record Audio
	r = sr.Recognizer()
	with sr.Microphone() as source:
		r.adjust_for_ambient_noise(source)
		audio = r.listen(source)
	# Speech recognition
	data = ""
	try:
		data = r.recognize_google(audio)
		print(data)
	except sr.UnknownValueError as e:
		print("Error: ", str(e))
		speak("Can you please repeat that")
		Listen()
	except sr.RequestError as e:
		print("Error: ", str(e))
		speak("Can you please repeat that?")
		Listen()
	Off()
	Short()
	Short()
	return data

def init():
	import datetime
	moment = datetime.datetime.now()
	print("Timestamp: " + str(moment), "Number of messages: " + str(len(mesList)))
	getEmails()

	while len(mesList) > 0:
		try:
			if (Listen() == "messages" or Listen() == "message" or Listen() == "read"):
				getEmails()
				for m in mesList:
					speak(m)
					mesList.remove(m)	
		except Exception as e:
			print(e)

while True:
	init()

Put It Altogether:

So, you’re probably going to have to cut this down considerably with a Dremel to make everything fit. If you do, be careful! It’s easy to make a mistake and break something if you do.

Categories:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s