robogrover

posted Mar 10th 2005 9:45am by Jason Striegel
filed under: robots hacks

robo grover
grover sat alone on the shelf, placid red smile stiched across his goofy blue face.  his fabric eyed gaze never shifted.

he couldn’t see it coming.

when the knife pulled free from the back of his head, his polyester brains spilled to the floor.  only a sad smile remained.  had grover only been able to see his attacker, things may have been different.

grover the muppet — barely alive.
we can rebuild him.  we have the technology.

scene of the crime

robo grover attacked

we’ll be giving grover the ability to see his attacker before it’s too late.  he’ll be outfitted with muppet vision and the ability to face his enemy.

materials

robo grover materials
i chose to use the basic stamp and developer board that i bought for the robot walker howto.  we’ll be using the basic stamp to determine which direction motion is coming from, and to control a servo to turn robogrover’s head in that direction.

in addition to the microprocessor / control system of your choice, you will need the following:

  • servo motor (1)

  • photoresistors (2)

  • 0.1uf ceramic capacitors (2)

  • 220ohm resistors (2)

eyes

robo grover eyes

robogrover will be able to ’see’ using 2 photoreisistors.

the resistance across the leads of of a photoresistor varies depending on the amout of light shining on it.  with a simple circuit, your can time how long a capacitor takes to discharge across this resistor.  your program can use this measurement to determine the light level.

we can watch for a change in light level, which robogrover can interpret to mean ‘movement’.  by using two light detector circuits, with a photoresistor in each of robogrover’s eyes, we can measure which ‘eye’ detected more light change and rotate the head in that direction.

as luck would have it, you can easily poke the photoresistor through grover’s eye fabric and it fits nicely in his pupil.

robo neck

robo grover neck

i used a hobby servo to turn grover’s head.  it will just barely cram in there.  you can make grover a ’spine’ out of an old broken pencil or a lego beam and attach this to something in his rump.  that way when the servo rotates, his whole body twists.

the neck isn’t quite pliable enough to flex on it’s own (without a whole body twist), so if you want only his head to twist, you will have to sever it from his body and fashion him some sort of neck.

wiring

robo grover wiring

to make one eye, connect a capacitor to a photoresistor in parallel.  then wire the resistor in series to an i/o pin on the basic stamp.  connect the other side to vss and you are set.

wire up the second eye the same way but to a different i/o pin.

software

to measure the light levels, you raise an i/o pin to charge a capacitor, then lower it and measure the time it takes for the capacitor to discharge.  you can use the rctime pbasic command to do this measurement.  here is a quick routine to detect the light level on i/o pin 5:

 time var word

high 5pause 2rctime 5, 1, time 

the higher the value in the time variable, the lower the light.  as light decreases, the value stored in time will be lower.

the routine i’ve been playing with does the following:

  • measure the light value for each eye

  • wait a tenth of a second

  • measure the light value for each eye again

  • calculate the absolute value of the difference between the new light value and the old

  • rotate the servo proportionally based on which eye recorded the most change

you’ll have to play around a bit to figure out what works best.

if you sum up a few measurements for each recording, you can smooth out random fluctuations a little, but your loop will take longer.  it’s a bit of a tradeoff.

rebirth

cautious robo grover

with a bit of fine tuning, robogrover now has some mad vision and neck-turning skills.  i almost get the feeling that he is a little cautious of me.

i hope that his new street smarts will serve him well the next time tickle-me elmo tries to jump him in the back alleys behind sesame street.

Recent Posts



Reader Comments

Leave a Reply

Hack a Day serves up fresh hacks each day, every day from around the web and a special How-To hack each week.

Send us your hacks











Hacks

Resources

RSS newsfeeds

Powered by WordPress

Most commented on (30 days)

Recent comments