{"id":1385,"date":"2019-11-17T09:57:48","date_gmt":"2019-11-17T15:57:48","guid":{"rendered":"https:\/\/www.protowrxs.com\/?page_id=1385"},"modified":"2019-11-17T09:57:50","modified_gmt":"2019-11-17T15:57:50","slug":"box-head-robot","status":"publish","type":"page","link":"https:\/\/www.protowrxs.com\/index.php\/robotics\/box-head-robot\/","title":{"rendered":"Box Head Robot"},"content":{"rendered":"\n<p>January 2013<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignright\"><img loading=\"lazy\" width=\"373\" height=\"500\" src=\"https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/11\/boxhead-a.jpg\" alt=\"\" class=\"wp-image-1386\" srcset=\"https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/11\/boxhead-a.jpg 373w, https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/11\/boxhead-a-224x300.jpg 224w\" sizes=\"(max-width: 373px) 85vw, 373px\" \/><\/figure><\/div>\n\n\n\n<p>The Beginnings&#8230;<\/p>\n\n\n\n<p>Just wanting all to say \u201cHello Box Head\u201d &#8211; literally that is &#8211; to, \nwell \u201cBox Head\u201d. Just like many of my builds, this one began as a \ndiscarded item &#8211; old old GoPro II display case. I saved it from certain \ndestruction and dumped it into the \u201cwhy not keep\u201d pile for some future, \nunknown, possible use. I originally had thought of mounting some motors \non it and making it yet another little mobile robot but other projects \nreceived attention first.\n<\/p>\n\n\n\n<p>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\u2019t work for me but it\u2019s 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. Something that would feel kind of  cool if \u201cIT\u201d watched YOU, or you could talk to it, etc. Of course I\u2019m  still working on that watching you part but maybe soon. <\/p>\n\n\n\n<p class=\"has-medium-font-size\">The BoxHead Solution&#8230;<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignright\"><img loading=\"lazy\" width=\"373\" height=\"500\" src=\"https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/11\/boxhead-1.jpg\" alt=\"\" class=\"wp-image-1387\" srcset=\"https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/11\/boxhead-1.jpg 373w, https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/11\/boxhead-1-224x300.jpg 224w\" sizes=\"(max-width: 373px) 85vw, 373px\" \/><\/figure><\/div>\n\n\n\n<p>I took the easiest route to animation, two servos for movement, NeckRoate and NeckTilt. In fact one of the existing servos was from an old pan\/tilt setup I have on my home security cams that can be moved around via the web with a servo controller board, thus the extra servo horn glued to the side. A Baby Orangutan from another project is currently running the motion side but I have a Pro Mini clone I am building to make it a more permanent install. The Arduino just reads the serial commands from the VB.net app and does movements, reads sonar, etc. There is a LOT more work to be done on both sides of the solution to develop a more fluid Box Head but the basics are working right now. <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignright\"><img loading=\"lazy\" width=\"373\" height=\"500\" src=\"https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/11\/boxhead-b.jpg\" alt=\"\" class=\"wp-image-1388\" srcset=\"https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/11\/boxhead-b.jpg 373w, https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/11\/boxhead-b-224x300.jpg 224w\" sizes=\"(max-width: 373px) 85vw, 373px\" \/><\/figure><\/div>\n\n\n\n<p class=\"has-medium-font-size\">The Voice and Ears.. err, Ear<\/p>\n\n\n\n<p>The VB.Net app is based on the Microsoft Speech Recognition engine \nand the Text To Speech solution. It\u2019s very simple to use, and free, \nwhich is always good. In my case I have the 5.1 Speech SDK installed on a\n very old XP laptop and am using Visual Basic Express 2008 as the IDE. \n&nbsp;To make the Speech recognition and Text to Speech work required only a \nfew lines of code from samples found online and adding the system \nreferences to the Box Head project. I\u2019ve used the MS Text to Speech API \nbefore with VB 6 and wrote a small \u201cSayIt\u201d program \n(http:\/\/protowrxs.com\/files\/) that I still use today in our Home \nAutomation systems so it wasn\u2019t all foreign to me. But it\u2019s still pretty\n easy to do with the sample code that is out there.\n<\/p>\n\n\n\n<p>Once you get the hardware configured the Arduino code is similar \nto the rest of my robots. The only exception is that the commands are, \nfor the most part, taken from the serial port as to what to do. I do \nhave some things on the Arduino that the VB app never knows about such \nas looking away if you get too close to the sonar sensor. I would like \nto have the VB app aware of that action but haven\u2019t added that yet. I \nhave re-used my stepping code from TED the BiPed \n(http:\/\/letsmakerobots.com\/node\/35632) to allow a bit more fluid head \nmovement for most routines which has turned out rather well in my \nopinion. He slowly moves from position to position actually slowing down\n as he approaches the final requested point. The only exception to that \nis the \u201cfind closest object\u201d routine that drives the servos directly as \nhe searches for what he thinks is the thing closest to him. Some noise \nand bugs there but the core function works.\n<\/p>\n\n\n\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Box Head Test 3\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/p-iuHpj3HHA?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p class=\"has-medium-font-size\">Interaction&#8230;<\/p>\n\n\n\n<p>Otherwise it\u2019s just pretty fun interacting with Box Head. Sure the \nactual command and control is being run by the PC and he is tethered but\n with that connection comes lots of options for speech. For example Box \nHead can read the latest news headlines through an RSS read subroutine, \ncan get the weather by running my home automation weather speaking \nVBScript routine, and in the long term I hope can decipher some search \ndata and give me the results. THAT however requires a big step beyond \nthe limited recognition setup currently being used and turns into the \ndictation functions which appear to be more complicated to me.\n<\/p>\n\n\n\n<p>Of course as with any current, and especially free, voice \nrecognition solution, you have to know what to say and have to say it \npretty specifically. \u201cTell me the weather forecast\u201d works, \u201cWhat is the \nweather forecast\u201d doesn\u2019t. But since I wrote the code I remember most of\n the commands for now at least.&nbsp;\n<\/p>\n\n\n\n<p>With my home automation system and my online house code I\u2019ve  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. <\/p>\n\n\n\n<p class=\"has-medium-font-size\">The Humor&#8230;<\/p>\n\n\n\n<p>Right now I have Box Head listen all the time once I have work him up with \u201cHello BoxHead\u201d. Sometimes it\u2019s funny just letting him sit there and listen to what\u2019s going on and respond randomly, sometimes correctly, sometimes completely off the wall. <\/p>\n\n\n\n<p class=\"has-medium-font-size\">The Future&#8230;<\/p>\n\n\n\n<p>Long term I would like to have more flexibility with the commands and\n recognition and make it a little more friendly to other speakers but \nthat may be difficult with the current setup I am using. I\u2019ve also been \neying my LTBotV2 platform (http:\/\/letsmakerobots.com\/node\/34323) that \nhas a netbook running on it already and would make an excellent mobile \nbase for Box Head to get around on. I even have the motor controllers \nand needed hardware to make that work and the motors have some pretty \ngood encoders on them. Maybe Box Head won\u2019t be \u201cStuck here on my base\u201d \nfor too much longer if I stick with it.\n<\/p>\n\n\n\n<p>I&#8217;m already looking for a smaller but similar &#8220;box&#8221; from  something to make a mini-box head with some 9g servos. Thinking I&#8217;ll use  the female voice and call her &#8220;Boxy&#8221;. \ud83d\ude09 \u00a0 <strong>Update 02\/08\/2013<\/strong> <\/p>\n\n\n\n<p class=\"has-medium-font-size\">BoxHead has a base, Mouth and Tweets<\/p>\n\n\n\n<p>Finally finished up a basic base for Box Head &#8211; 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. <\/p>\n\n\n\n<p class=\"has-medium-font-size\">Face Tracking&#8230;<\/p>\n\n\n\n<p>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. Watch for a separate write up of how it works as well as hopefully an AtTiny85 version as well.. <\/p>\n\n\n\n<p class=\"has-medium-font-size\">BoxHead&#8217;s Mouth&#8230;<\/p>\n\n\n\n<p>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 hoff\u2019s VU Meter Robot Face (http:\/\/letsmakerobots.com\/node\/36063) I decided to give it a go. However I didn\u2019t 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\u2019s 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 \u201cmodes\u201d or whatever. <\/p>\n\n\n\n<p class=\"has-medium-font-size\">BoxHead Tweets&#8230;<\/p>\n\n\n\n<p>Chatting on the LMR Shout Box 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\u2019s part of the house anyhow and adds some traffic to the account. I\u2019ve kept the Tweets pretty minimal: startup, goodby, what\u2019s his age, etc for now but may add more over time as he learns new things and has new responses.   <\/p>\n\n\n\n<p class=\"has-medium-font-size\">Price Listing&#8230;<\/p>\n\n\n\n<ul><li>$ 0.00 &#8211; Plastic Box\n<\/li><li>$ 7.00 &#8211; Pro Mini Clone\n<\/li><li>$15.00- Cheap webcam on sale\n<\/li><li>$ &nbsp;2.10- HC-SR04\n<\/li><li>$10.00- PIR Sensor (Way overpaid at RS)\n<\/li><li>$ &nbsp;0.00- Junk servos &#8211; need replaced eventually\n<\/li><li>$10.00- Portable speaker\n<\/li><li>$ &nbsp;7.00- Four Port USB hub\n<\/li><li>$ &nbsp;2.00- LEDs for mouth\n<\/li><li>$ &nbsp;2.00- ATTiny85 CPU\n<\/li><li>$ &nbsp;2.00- Power regulator\n<\/li><li>$ &nbsp;0.00- VB.Net and RobotVisionToolKit\n<\/li><\/ul>\n\n\n\n<p> 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 <\/p>\n\n\n\n<p class=\"has-medium-font-size\">Original Testing Videos&#8230;<\/p>\n\n\n\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Testing BoxHead\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/vnNRjFa8-ZE?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Box Head Test Two Again\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/dZkbWI16Frg?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>January 2013 The Beginnings&#8230; Just wanting all to say \u201cHello Box Head\u201d &#8211; literally that is &#8211; to, well \u201cBox Head\u201d. Just like many of my builds, this one began as a discarded item &#8211; old old GoPro II display case. I saved it from certain destruction and dumped it into the \u201cwhy not keep\u201d &hellip; <a href=\"https:\/\/www.protowrxs.com\/index.php\/robotics\/box-head-robot\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Box Head Robot&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":19,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"spay_email":""},"categories":[],"tags":[],"_links":{"self":[{"href":"https:\/\/www.protowrxs.com\/index.php\/wp-json\/wp\/v2\/pages\/1385"}],"collection":[{"href":"https:\/\/www.protowrxs.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.protowrxs.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.protowrxs.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.protowrxs.com\/index.php\/wp-json\/wp\/v2\/comments?post=1385"}],"version-history":[{"count":1,"href":"https:\/\/www.protowrxs.com\/index.php\/wp-json\/wp\/v2\/pages\/1385\/revisions"}],"predecessor-version":[{"id":1389,"href":"https:\/\/www.protowrxs.com\/index.php\/wp-json\/wp\/v2\/pages\/1385\/revisions\/1389"}],"up":[{"embeddable":true,"href":"https:\/\/www.protowrxs.com\/index.php\/wp-json\/wp\/v2\/pages\/19"}],"wp:attachment":[{"href":"https:\/\/www.protowrxs.com\/index.php\/wp-json\/wp\/v2\/media?parent=1385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.protowrxs.com\/index.php\/wp-json\/wp\/v2\/categories?post=1385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.protowrxs.com\/index.php\/wp-json\/wp\/v2\/tags?post=1385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}