October 2015 - The Resurection
After having issues with the old laptop running Box Head, I pulled it offline and stuck the laptop in the server room. Box Head sat for two long years as other robots, life, old cars, and other projects got in the way. With a renewed interest in robotics in mid 2015 I thought is was worth trying to get him back online. With just a bit of unstalling of junk software on the laptop and some minor work his "brain" is back again and seems to be working. I've added a few phrases he can understand and functions he can do to the list and hopefully will keep him up and running for a while this time. In the mean time, here is Box Head's history:
This is content from back in January 2013 when I built Box Head along with some newer updates as I just revivied him after sitting on the shelf a couple years.
Just wanting all to say “Hello Box Head” - literally that is - to, well “Box Head”. Just like many of my builds, this one began as a discarded item - old old GoPro II display case. I saved it from certain destruction and dumped it into the “why not keep” pile for some future, unknown, possible use. I originally had thought of mounting some motors on it and making it yet another little mobile robot but other projects received attention first.
After watching what Chickenparmi did with Processing, a webcam, and an Arduino, I thought that would be something cool to try. (BTW that STILL doesn’t work for me but it’s my limited capability I imagine) BUT instead of going the normal route and popping a cam on a couple servos I wanted it to have more personality.
The Box Head Solution...
The Voice and Ears... err, Ear...
The VB.Net app is based on the Microsoft Speech Recognition engine and the Text To Speech solution. It’s very simple to use, and free, which is always good. In my case I have the 5.1 Speech SDK installed on a very old XP laptop and am using Visual Basic Express 2008 as the IDE. To make the Speech recognition and Text to Speech work required only a few lines of code from samples found online and adding the system references to the Box Head project. I’ve used the MS Text to Speech API before with VB 6 and wrote a small “SayIt” program that I still use today in our Home Automation systems so it wasn’t all foreign to me. But it’s still pretty easy to do with the sample code that is out there.
Once you get the hardware configured the Arduino code is similar to the rest of my robots. The only exception is that the commands are, for the most part, taken from the serial port as to what to do. I do have some things on the Arduino that the VB app never knows about such as looking away if you get too close to the sonar sensor. I would like to have the VB app aware of that action but haven’t added that yet. I have re-used my stepping code from TED the BiPed to allow a bit more fluid head movement for most routines which has turned out rather well in my opinion. He slowly moves from position to position actually slowing down as he approaches the final requested point. The only exception to that is the “find closest object” routine that drives the servos directly as he searches for what he thinks is the thing closest to him. Some noise and bugs there but the core function works.
Otherwise it’s just pretty fun interacting with Box Head. Sure the actual command and control is being run by the PC and he is tethered but with that connection comes lots of options for speech. For example Box Head can read the latest news headlines through an RSS read subroutine, can get the weather by running my home automation weather speaking VBScript routine, and in the long term I hope can decipher some search data and give me the results. THAT however requires a big step beyond the limited recognition setup currently being used and turns into the dictation functions which appear to be more complicated to me.
Of course as with any current, and especially free, voice recognition solution, you have to know what to say and have to say it pretty specifically. “Tell me the weather forecast” works, “What is the weather forecast” doesn’t. But since I wrote the code I remember most of the commands for now at least.
With my home automation system and my online house code I’ve developed over the years, I can have Box Head tell me if the garage door is open, tell him to turn certain lights on and off and have him turn the coffee pot on or off as well. This is only limited by how much time I want to spend adding the commands and responses to the special link that he talks through.
Right now I have Box Head listen all the time once I have work him up with “Hello BoxHead”. Sometimes it’s funny just letting him sit there and listen to what’s going on and respond randomly, sometimes correctly, sometimes completely off the wall.
Long term I would like to have more flexibility with the commands and recognition and make it a little more friendly to other speakers but that may be difficult with the current setup I am using. I’ve also been eying my LTBotV2 platform that has a netbook running on it already and would make an excellent mobile base for Box Head to get around on. I even have the motor controllers and needed hardware to make that work and the motors have some pretty good encoders on them. Maybe Box Head won’t be “Stuck here on my base” for too much longer if I stick with it.
I'm already looking for a smaller but similar "box" from something to make a mini-box head with some 9g servos. Thinking I'll use the female voice and call her "Boxy". ;-) Update 10/20/2015: Hmm.. I never did give this a try.
Box Head has a Base, Mouth and Tweets
Finally finished up a basic base for Box Head - he used to have his guts all hanging out all over the place but now has a workable place for them. Nothing fancy but functional. Inside his base is where the Arduino Pro Mini clone is, the speaker up front for his speech, power regulator, and a four port USB hub for the camera, two USB to TTL converters and the power run for the little speaker. The goal of the base was to cover everything up and I believe that goal is accomplished. Additionally I wanted to end up with only a power wire, USB, and speaker connection which the hub allows.
Since the original concept of Box Head was some way to play with Face Tracking I figured I needed to get it working somehow. I ended up using RobotSee from the RobotVision Tool Kit and am quite happy with results. The down side is I have to use another serial connection to the Arduino / PC in addition to the one for the VB.net app but it is simple and effective. After saying Hello Box Head he initially turns on FaceTracking mode which is just another mode he can run in. The PC .see script runs sending UP/Down/Left/Right commands as needed to stay centered.
Update 10/20/2015: This isn't working properly anymore and I'm not sure why. Camera output really doesn't look clean so that may be it. Hopefully I can get that fixed someday.
Box Head’s Mouth
The goal from the start was to give Box Head some type of LED mouth moving from the center out and after watching people playing with LED VU meters like Hoff70’s (10/20/2015 - Man I miss that guy :-(...) VU Meter Robot Face I decided to give it a go. However I didn’t want to make the main Arduino try to do that along with movements, etc so I drug out one of my ATTiny85 chips and changed the code they used to only drive three outputs and then wired up the mouth with five total LEDs. One green on in the middle, two yellow outside of that tied together, and two reds on the outside tied together. The then basically light up from the inside out. With only that many it’s a little hard to see the actual movement but better than nothing to me. A serial connection between the main Arduino and the ATTiny85 is setup with my goal for future abilities of the VB.net App, RobotSee, or just the Arduino having the ability to send a command to the ATTiny to change mouth “modes” or whatever.
Box Head Tweets
Chatting on an old robot site about things with others about Twitter reminded me about my NolenHouse account and how my house tweets activity. At first I wanted to setup a completely different BoxHeadRobot Twitter account for Box Head but with the need for the account, a proxy or email proxy account to post, etc I decided to just let Box Head talk through the Nolen House account. You can see any possible tweets here http://www.Twitter.com/NolenHouse He’s part of the house anyhow and adds some traffic to the account. I’ve kept the Tweets pretty minimal: startup, goodby, what’s his age, etc for now but may add more over time as he learns new things and has new responses.
$ 0.00 - Plastic Box
$ 7.00 - Pro Mini Clone
$15.00- Cheap webcam on sale
$ 2.10- HC-SR04
$10.00- PIR Sensor (Way overpaid at RS)
$ 0.00- Junk servos - need replaced eventually
$10.00- Portable speaker
$ 7.00- Four Port USB hub
$ 2.00- LEDs for mouth
$ 2.00- ATTiny85 CPU
$ 2.00- Power regulator
$ 0.00- VB.Net and RobotVisionToolKit
Misc other: Old plastic from dog door, switch from junk, alumn from scrap, etc
Of course you have to have a computer for this but I think we all do already
The New Future
The main thing I want to do with Box Head is add some more commands and functions. The current possibilities are;
1) "Who called today" - Reads the Caller ID data from the Home Automation log
2) Turn On/Off XXXX - Add more lights and devices to the command page
3) More RSS feeds - Roxanna said she would get the CKR rss feed info to me
4) Face Tracking working - This was fun to have him track you as he talked - worth a try again
5) What else? Suggestions anyone?