Step 28: Moving the eyes with a Basic Stamp

Now let's look at another video of making the eyes move with a Basic Stamp 2
Here is the code dor the routine.

' {$STAMP BS2}
' {$PBASIC 2.5}
' test motor movement and check vr's for proper poition and move eyes rt and lt
Result VAR Word 'Word variable to hold result.
LOW 10 ' set pin 10 low eye right
HIGH 8 ' set pin 8 high eye left to move motor eye left
LOW 8 ' ser pin 8 low eye left to stop motor eye left
pwmduty VAR Byte
pwmout PIN 6 'LED connected to P6
pwmduty=0 'set duty cycle to 0

GOSUB checkeyes
IF RESULT =1 OR RESULT =0 THEN GOTO BUG ' if vr has no signal stop program
IF result <= 1100 THEN GOTO EYELEFT
IF result >= 2300 THEN GOTO eyeright
GOTO eyeright

DEBUG "bug found in VR READINGS = ", DEC RESULT,CR ' if signal loss stop routine

checkeyes: ' checking the VR location

HIGH 7 'use pin 7 to Discharge the cap circuit
PAUSE 1 'for 1 ms.
RCTIME 7, 1, Result 'Measure RC charge time. convert analog to digital


eyeright: ' move right eye to the right
HIGH 10 ' turn motor on

DEBUG "eye right mode", DEC result, CR
GOSUB checkeyes
IF Result < 1100 THEN GOTO LINESLOW 'check to see if it at the lower limits


eyeleft: 'move eye to the left

HIGH 8 'turn on motor

DEBUG "eyeleft mode", DEC result

GOSUB checkeyes
IF Result > 2300 THEN GOTO LinesLow ' if over limit turn off motor


LinesLow: ' turn off motor
LOW 10
DEBUG "droped lines low" , CR
GOSUB runhigh

GOTO main

DO WHILE pwmduty<255 'keep increasing dutycycle till 255 is reached
PWM PWMout, pwmduty,15 ' run to increase voltage to LED decrease last # for faster
pwmduty=pwmduty+1 'Increase duty cycle by 1

IF pwmduty>=255 THEN pwmduty=254 'set duty cycle to 254
DO WHILE pwmduty >=1 'continue to decrease voltage to LED
PWM pwmout,pwmduty,25 ' run to decrease voltage to LED increase last # for faster
pwmduty=pwmduty-1 'Decrease cycle by 1
PAUSE 2000


Thanks to this guide, I'm celebrating Presidents Day in the US with the Elvis Alive and Chimpanzee from Wowee. Powered by Arduino! <br> <br>http://www.youtube.com/watch?v=qnObaoilr10
<p>I can fix your Elvis. johnnyi25@hotmail.com</p>
Can some one fix my Elvis??
<p>Sure, I can fix your Elvis. johnnyi25@hotmail.com</p>
<p>Hello, Can anyone fix my Elvis to just be Elvis? When the head operates it works only cocked to Elvis' right. All else works. It worked great for about 15 minutes, then the headcock began. I will happily pay to have him repaired. Regards, Rich</p>
<p>Yes, I can fix your Elvis. Richard. And anyone else's too. e-mail me @ johnnyi25@hotmail.com</p>
please can you provide the schematic of the IR tracking sensors and how they make his head follow movement ?
Hello your blog is really fascinating. I really wish someone can fix my Elvis he just stop working and I don't know why. I wonder If you could fix him for me.
Got mine up and running! <br> <br>http://www.youtube.com/watch?v=RXUj3FaVH8A&amp;feature=youtu.be
please i bought this used ELVIS from EBAY; when powers on it only repositions its neck and then nothing happens. please any advise ? I tried fresh batteries and better adaptor; I also pulled all connectors between allboards and placed them back in place one by one. so far no success...Please advise me...many thanks....
It is most likely a malfunctioning limit switch. There is a square plate at the base of the neck on in the inside of the torso. It slides around with the L/R, U/D of the neck. At the extremes, it closes a limit switch. One of these is not working working properly and telling the firmware that the head is in an impossible position. <br> <br>When you first power up the bust, it moves the neck through the fulle range of motion to calibrate it and then set it in a nuetral position (since removing power can be done at any time and the head will just stop wherever it was.) If it is unable to sense where the neck limits are, it just hangs up. <br> <br>You will need to test the switches and either replace or clean them. They may all appear to work fine, but check them with an ohm meter while holding them closed. If the value is bouncing around all over the place, then the switch is faulty (remember, this is just a switch so it should only be either 0 ohms or infinite.) <br> <br>This is a common problem for the Elvis bust.
Checked the neck limit switches, yes one of them was leaking. But the surgery did not end there. As advised by RetroPlayer before; I removed one of the two neck motors, found that its plastic base melted in a way it is now sitting tilted.(see the pictures). This also caused one gear to break, and the slotted wheel that feeds the position optosensor is no longer sitting in place between sensor slot. later I took off the motor found that it still works, but has major damage inside due to overheating; parts of the amature shattered inside the motor. <br>I will try to replace the motor with something similar, and get a gear from a toy and put things together hope it works. If someone have this part for sale I will buy it.... <br>Any idea's why the motor melted its enclosure? please educate us ....
BTW retroplayer; do u do WowWee regretted selling ELVIS at only 80$ ? I mean when u open it; and after reading ur hacks inside it; it is some peice of work. all that animatronics for just 80$..hwat di u think ?
Thanks Retro Player. I must admit that you know ELVIS bust like ur own son. I m gonna check the limit switch and report bck. God bless u man
It sounds like you have a burned out sensor board or possibly CPU board. Go to Robots and Androids on ebay. They sell all the boards. Or you can see if their web site &quot;http://www.robots-and-androids.com&quot; has instructions.
Did you have any issues with the paint not sticking too well since the skin is silicone? Thanks!
You mention the existing Elvis Alive has a complex power board. Do you know if it uses the full 9v to control all the DC motors, or is it 5v? Specifically, the motors to tilt the head left/right and up/down.
NICE INSTRUCTABLE,i am looking at a different controller that works using SD84 IT HAS 84 inputs and using very cheap servo's for the servo board <br>servo board can get for $5 on ebay new from china,and just remove the pot and motor ,and add motor and feedback pot from ELVIS head,very easy and you free up a lot of inputs for other stuff,using microcontroller board you will many many I/O on SD84 ONLY NEED IS 7 rc inputs <br>ever thought of using it,also servo boards can be used with any microcontroller <br>SD84 has 4 on board for other servo's hands,pan and tilt and more
Never hear of the SD84 but I'll look into it. But one thing the Elvis does not have any servos it has only DC motors with Variable Resistors as a positional sensor. If you want you could remove all the motors and replace them with small servos but that is a lot of work to do and there for your really not hacking the Elvis but only using the plastic mechanics for your hack. <br><br>Jax
not a great idea ,mostly because of cost <br>what i did is buy very cheap futuba servos from china remove the pcb and pot and motor and make my own servo <br>servo is a controller with feedback and h-bridge plus motor and feedback pot <br>its very simple ,cheap and works perfect $5 total per motor and only 1 wire per servo on SD84 <br>THEN YOU HAVE OVER 70 PORTS LEFT /IO ,SERVO AND A-D
another thing about using a board from a cheap servo is that the h-bridge can be parallel to have higher current or easy replace the chip with higher current h-bridge,i bought 50 to have on hand to make my own servo's from motors and feedback pot, futaba s3003 is perfect ,easy to remove parts cheap from china $5 or less and great info in seattle robotics club on the circuit
This is inspiring stuff. I'm a bit new to all of this, so forgive me if I have some newbie questions. The main thing I don't get is the ELV-09 board. I'm not clear what this board actually does and why you felt the need to replace it. Can you elaborate?<br><br>I'm interested in controlling this with an Arduino board. Have you ever looked into that? I know it can read VR data, but I'm not sure about how the neck motors will integrate...
What the ELV-09 board does is it controls a lot of the facial movements by turning the motors on and off and reading the VR positions in a digital form with a ADC chip (Analog to Digital Converter) <br><br>The reason I built the new ELV-09 board is because I wanted an analog signal which I can control where the motors are better than a digital signature of it and with the ADC chip along with shift registers it does not give me that kind of info I need from these VR's. I hope you understand the reason. But if you want to control the facial movements as they are you can tap into the ELV-01 Main boards shift registers for that. Also look at the video about the eye movements, this is where I took out of circuit the ELV-09 board all together and showed how the new ELV-09 board would work mounted on the breadboard for moving the eyes only. Yet I did not slow down the eyes on this video because I wanted to see if I could read the VR going with the motor at full speed and no problems there and it worked great.<br><br>Yes I have looked in to the Arduino board in which I have one but really the PIC 16F884 or 887 would do a better job than the BS2 series because of the amount of I/O's it has and I think it like 33 or 35 I/O's I'd have to look that one up again.<br><br>For the neck motors you would only need a one bit I/O line to read it's location and for it's speed once you setup the calibrations with those 4 switches 2 for each motor. This one is very simple to write into your program for what ever MCU you use.<br><br>I hope I explained the questions you asked and if you have any others just ask again.<br><br>Jax
Thanks for the response! I was considering the Arduino Mega board, which has 54 digital outs and 16 analog inputs. Would that be enough? Or do I need an input for each neck switch?<br><br>Like I said, I'm new at this. But I'm assuming that by utilizing the boards that are already inside Elvis, the digital outs on my Arduino would work to control direction of each motor and the VR can be fed through the analog input to determine positional data. Also, I assume using the existing boards means I don't have to deal with the volts as much.<br><br>Do I sound like I'm on the right track here?
Yep your on the right track... for the neck switches those are digital I/O's and so are the neck motor encoders. You have plenty of I/O ports. Now on the ELV-09 board you need to cut the traces going to the ADC chip lines for the VR's and you'll need to solder in some extra jumper wires on the board. All VR's have a cap on them so you don't have to worry about adding those. If you need help with this I can scan in the bottom of the board and show you where to cut and then what lines to use. It can be a little tricky but if you can do it great. It would take me awhile to do this because of all my other projects going on right now have deadlines that I have to meet.<br><br>Jax
Yikes, that does sound tricky. Maybe I would be better at building a new ELV-09 board as you did. But yeah, if you could provide that scan, I would be very thankful.
No problem just give me some tie to get it done.<br><br>Jax
Have you had a chance to scan the bottom board to show me where I need to cut these wires?
I have updated the ELV-09 boards pin out in-case you still need that..<br>I also looked at what you could do about cutting the traces and really the best thing to do is to remove the SNAD01 chip and connect your wire harness to the VR signal lines to your MCU.<br>Jax
No Sorry, I have bad news.. My house had a bad fire in the attic on 29 April at 12:30 in the afternoon and destroyed all my robots including the Elvinator and it's boards. I have no unpublished photos now and all my data is lost. The only way I can help you now is if you scan in the bottom of the board for me and then I can edit it for you to show you where to cut them.<br><br>If I do get another Elvis I will rebuild the Elvinator again with different mods but we'll have to see about that.<br><br>Jax
Damn, sorry to hear that man. Don't worry about it, I think I've pretty much figured everything out. The only thing left I have to work out is how to get my Arduino microcontroller to interface with the ELV-13 board properly.
Well, the more I think about it, the more I do think building a new board as you suggested might be the way to go. But that does lead to one other question. I assume this would mean I should hook this board up to the PWM outputs on the Arduino board instead of the digital outputs, right?
Trying to figure out what the requirements are for controlling all of Elvis' components I have come up with the following I/O requirements: <br> <br>16 inputs (10 from VRs, 4 from neck switches, 2 from IR boards Rx) <br>22 outputs (10 for each motor/direction, 2 for IR boards Tx) <br> <br>Have I over looked something?
Only 8 Motors have VR (Variable Resistors) the Neck motors that control tilt function with the 4 switches uses Tacit sensors (PT disk in the casing) I did not include this in any part of the article because the rest of the custom electronics were not finished. I had put this off for so long I'll need to check everything else you stated but it does sound right. <br>I'll post more when I have a chance very soon for you.<br><br>Jax
I appreciate all of your help!<br><br>I am eager to bring my Elvis alive. I am attempting to translate your instructable into Arduino (that's all I have right now).
Sorry I thought I posted the plug layout for the ELV-09 board. So here they are:<br><br>&bull; M11-white connector-controls L/R head movement <br>&bull; M6-blue connector-controls eye brows <br>&bull; M1-Grey connector controls jaw movement <br>&bull; J33- power connector <br>&bull; pin1-red + <br>&bull; Pin2-GND - <br>&bull; J12- main controller plug <br>&bull; pin1-red-neck right <br>&bull; pin2-yellow-neck left <br>&bull; pin3-green-jaw down <br>&bull; pin4-blue-jaw up <br>&bull; pin5-purple-eye brow down <br>&bull; pin6-black-eye brow up <br>
Looks like that is the pinout for ELV-07 not ELV-09.
Let me look into this for you.
Have you listed which VRs (which color plug) go with which motor? I am trying to avoid taking the guts out of the face, and since i am working from behind i can't see where all of the plugs are going to.
I forgot to hit the reply button to your question but the answer has been posted for you.<br><br>Jax
GWJax, <br>I'm confused. Where are the 7 VR's? I am putting together a shopping list for this project, but I don't know if I need to supply my own VR's or if they are already in Elvis... <br> <br>This is an awesome Instructable!
The VR's are on the motors them self. They are what the motors use to determine where and how fast they move.<br><br>Let me know if I can help anymore for you.<br><br>Jax
I am anxiously waiting for the face movement step...
I did it! Thanks, Jax, for the great walk through. My daughter and I kept alternating between different sized small screwdrivers that fit the different contours. You were right about the chest being hard to get off. We just kept pulling and wiping the screwdrivers gently across the glue jams and they slowly relented.
Great I'm glad to hear that all went well Jellyfish. When you need to re-glue the new skin back on just use superglue to tack it back on. It will be harder to do when it comes to the eye lids to keep them in the correct position. It's all about taking your time with it.<br><br>Jax
When I clean my <a href="http://www.ugglinks.com/" rel="nofollow"><b>UGG Boots</b></a>, I always be so careful and gentle. I perfer use my hands to other instruments. I suggest to use Diaopai soap than other detergents because I think Diaopai soap can wash my <a href="http://www.ugglinks.com/ugg-30th-anniversary-c-65.html" rel="nofollow"><b>UGG Classic Boots</b></a> so clean and white. First, you should make Diaopai soap full foaming and then use your hands to make your boots be full of bubble. All these are done and then you can use your hands to constant rubbing on the surface, which is in order to make your boots new. From <a href="http://www.ugglinks.com/" rel="nofollow"><b>UGG Boots Outlet</b></a>.
hi jwjax love your project,cant wait to take my elvis apart and add it to my AI animated robot design keep up the good work,it shame i cant get on trossen my robot will win top prize with great mods i made also my johhny five projects is getting really good too ,both with AI SOFTWARE after both done working on full detail full size johnny five
Slightly disturbing, this.<br /> <br /> Something between Terminator at the very end of the first film and a Barbie doll, i think it's the pink that hints &quot;Barbie&quot;.<br />
This is just sooooo creepy, not just the remodelling, but the actual device itself, but I suppose it's one step closer to actual androids, but still, creepy... :S Great job though... :D
great stuff ! Now I understand.. Elvis is not dead.. he's been terminated.. Thanks for solving that mystery.

About This Instructable


44 favorites


Bio: I love to make and hack into robots and make them do things that they are not designed for. Also I enjoy programming in PBasic ... More »
More by GWJax: WowWee's Elvis Alive to The Elivinator Project
Add instructable to: