So, last October I build a Robotic Lamb. With the help of motion sensors, a servo and a Basic Stamp, this ordinary stuffed animal was able to
creep out amuse guests (and my wife) by turning it’s head to watch them as they move around the room. Since then, it has been given a name, Lamby, and has both amused and frightened many visitors.
Yet, lately, I’ve been feeling that it just isn’t enough to have a subtle, animatronic children’s toy following you wistfully with it’s eyes. Yes, it’s time for Lamby to get an upgrade!
Since I received such a great response from my last post on Lamby, I will be putting up articles as I work on this project, with pictures of Lamby under construction, descriptions of the parts I’m using, and the code to any software I write. My goal is for there to be enough information here that anyone with only an amateur background in programing and/or electronics will be able to build the sane thing. For anyone curious, by the way, I have a good background in programing, but only a very basic background in electronics. In fact, I just finished reading “Electronics for Dummys,” which I recommend as a good place to get started.
In this part, I will outline some of the problems I ran into with Lamby so far, and my plans for his upgrade.
Fabric and Motion Sensor Mounting
Lamby was not born to be a robot. In fact, he was originally just a normal stuffed animal you might find in the store. In order to robotify Lamby, I had to cut off his head and also cut out his eye sockets. This allowed me to place PIR motion sensors in his eyes, and then mount his head on a servo motor to allow it to spin. This generally worked fine, but lead to problems, which I’ll be addressing in the upgrade:
Once the fabric was cut, it tended to keep tearing on its own. This led to Lamby’s gradual disintegration, which I halted with scotch tape. Definitely not an optimal solution. While the most obvious solution is to sew the parts of Lamby that were weakened by the scissors, there are 2 reasons why this might not be the best idea: First, it assumes you know how to sew. Second, I would like to more permanently attach the PIR sensors in his eye sockets (they tended to move around a bit), and you can’t sew plastic. Instead, I think a better solution will be crazy glue. I plan on crazy gluing the PIR sensors in Lamby’s eye sockets, and also crazy cluing any loose joints or weak spots in his fabric.
Lamby currently has a single servo. This is mounted in his neck, and allows his head to turn. The servo’s gear is embedded in the stuffing in Lamby’s head, while the servo itself is mounted in the stuffing in his torso. This allowed the head to turn. However, stuffing is soft stuff, and sometimes the servo would turn, but the head would not, or not turn as much. Obviously, it is not a good idea to anchor a servo motor to stuffing :). Instead, Lamby 2.0 will have a plastic skeleton, which I will use to attach his internal components.
Embed the Controller Circuit
While Lamby himself was fairly subtle, the fact that he had wires coming out his neck attached to a circuit board was enough to tip off most people that something was not quite right. Lamby has a fairly large torso … in Lamby 2.0, the circuit board will be placed inside his body. It will be inside an anti-static bag to prevent the stuffing from shorting out the circuit, or causing a fire.
So far, these have been improvements in Lamby’s construction, but there haven’t been any new features. So, there is poor Lamby, and all he can do is watch people as they go by, not being able to participate. I can’t have that! Lamby 2.0 will receive 2 additional servo’s: He will be able to wave each of his arms independently.
The microcontroller inside of Lamby is fairly limited. Until now, Lamby’s only job in life was to look at things moving. However, with his new capabilities, He will have to do more than that. Unfortunately, his microcontroller brain will not be up to the task. Instead, I will fit Lamby with a USB port uplink to a computer. Autonomous functions, such as watching motion, or waving when someone enters the room will be performed by his microcontroller. More complex thinking, however, will be done on the computer. The computer will then send instructions to the microcontroller to tell Lamby how to move and act.
You’re probably wondering what sort of actions are so complicated when Lamby only has 3 servos and 2 sensors? Well, thanks to the advances of cheap USB sound cards, Lamby will also have a speaker and microphone embedded in his chest. This will be connected via a USB sound card (less than $10!) back to the computer as well.
The software running on the computer will include basic voice recognition and voice synthesis. This means, that you will be able to walk up and say “Hi Lamby,” and Lamby will reply back “hello” while waving. This is where the processesing power of the computer comes in.
This one I’m not entirely sure about yet. I think that I might install an X10 controller on the computer Lamby is connected to, and then connect some of the lights in my apartment to X10 plugs. This would allow Lamby to turn lights on and off in my apartment, potentially on voice command, when he sees motion, or when he wants to mess with you.
I plan on developing two pieces of software for the computer, as interfaces with Lamby:
The first is going to be a voice interface. I’ve found that one of the main problems with voice recognition interfaces is that you have to know what commands you can say, and what will be recognized by the computer/robot. Since you are interfacing with a robot though, and not a computer, I can use the whole computer screen to show what Lamby is thinking. The first program will blank out the whole computer screen. On the top half of the screen will be a voice modulator bar, which will just be some eye candy showing Lamby’s voice output. You know, the horizontal line that deforms based on the sound coming out the speaker? The bottom half of the screen will be a list of words or phrases. These are the current list of phrases that Lamby is listening for. For example, if you say “Lamby,” the list of words might display “what is the weather, what time is it, look to the left.” If you say “what is the weather,” the list will change to be “now, later, tomorrow, this week.” My goal is that this will be intuitive to people who have never seen it before — ie, visitors in my house.
The second application will be mainly for development. This will be a direct control program. Basically, when you run it, your mouse (or XBox controller) will take direct control of Lamby’s arms and head. Also, it will record your motions, so that they can be played back later. I’ll be able to use this program to do 2 things. First, I can use it to control Lamby like a puppet. Second, I’ll be able to record complex motions for Lamby which he can play back on his own. This will make things like waving, shaking his head, etc much more natural looking than just a simple programatic command.
Here are some sample use-case behaviors I expect Lamby to be capable of when his upgrade is complete:
- When someone walks into the room, or moves after staying still for a while (watching tv?), Lamby will wave or say hello .
- When someone moves around the room, Lamby will look at them.
- You will be able to ask Lamby the time, weather, or stock ticker price, and he will answer in voice
- Lamby may make random “intelligent” comments, like “Wow, its dark out already,” or “It’s unseasonably cold out today,” or “Hey, aren’t you supposed to be at work?!” most of this information he can get off the internet, courtesy of controller software running on the computer.
- With X10, you can tell Lamby to turn the lights off, and he will.
- You can tell Lamby to wake you up “in 10 minutes” or “at 8:00,” and he will by turning on the lights, and yelling at you until you tell him to stop.
End Result: Lamby 2.0
So, the plan is that after the upgrades, Lamby 2.0 will become not just an animatronic toy, but basically an avatar. With the addition of speech and voice recognition, it will appear to be intelligent. Since I can use it as a front-end to web-enabled scripts, Lamby will appear to have real-world intelligence. He will know if its raining, if you’re home from work early, and if it’s rather warm for this time of year.
Oh yeah … he’ll also be able to watch you as you walk around the room.