Intern’s Corner: Makey robot’s sonar and maiden voyage

Arduino Robotics
Intern’s Corner: Makey robot’s sonar and maiden voyage

MAKE: Intern's Corner
Every other week, MAKE’s awesome interns tell about the projects they’re building in the Make: Labs, the trouble they’ve gotten into, and what they’ll make next.

By Kris Magri, engineering intern

How I designed Makey, Part III: The Ping sonar rangefinder and maiden voyage

As we return to our robot design saga, making Makey the Robot for MAKE, Volume 19

The actual robot is still just a prototype with 2 wheels and motors and no sensors, electronics, or brains inside. The better body exists only in the computer. Maker Faire is looming. I’ve been tapped to give two “Make Your Own Robot” workshops, and I reckon that having a working robot would be a very good idea.

M_076-87_Robot_F1.jpg

I’m trying to get the Arduino into the robot body. Suddenly I learn a profound lesson regarding computer-aided design. In real life, circuit boards cannot morph through walls into their desired resting place. In the computer, it happens all the time. With a simple motion of the mouse, the Arduino circuit board has glided into place, right through the aluminum robot body … but in real life, it won’t fit. There is no possible angle or tilt that will get the Arduino into the robot. Out come the Vise-Grips and hacksaw. I saw, bend, and twist off the offending aluminum tabs. This is reality-aided design.

Photo01_Removal.jpg

The battery pack doesn’t fit because it hits the nuts and bolts that hold the motors in. It fit just fine in the computer model, since I didn’t bother including the nuts and bolts. I’m ready to toss the computer out the window.

Photo02_NothingFits.jpg

I show up at the Make: Labs with my fail robot. Our crew has been working like demons for weeks getting ready for Maker Faire — preparing demos, packing everything under the sun, buying materials — the lab is a madhouse. Eric, myself, and Steven are practically tripping over each other. I’m frantic to get the Arduino into the body and get the sonar sensor mounted somehow. Eric suggests double-stick tape. I refuse. Tape and glue, I assert, are for people who don’t know about bolts and rivets. Eric manages to cram the Arduino in sideways. It barely fits, actually, it doesn’t quite fit, it sticks up a little. When I drill a mounting hole, 1/3 of the hole isn’t there. But the bolt manages to hold.

Photo03_Arduino.jpgPhoto04_Janky.jpg

At this point I only have a vague idea of what motor will be turning Makey’s “eyes” or how to fit it inside. We zoom off to the local hobby shop and pay way too much for the smallest servomotor they have in stock.

Steven offers to take on the servomotor/sonar sensor mounting problem. He’s making detailed measurements and calculations, trying to figure out how much space there is and where the servomotor will fit into this 3D space without hitting the electronics. He marks everything and explains his calculations to me. I can’t follow them, but it sounds good and looks like it might just fit. I drill the holes, we put the servo in, then close up the robot. It fits! There is much rejoicing.

Read full story


From MAKE magazine:
make volume 19 cover.gif
In MAKE, Volume 19: Robots, Rovers, and Drones, learn how to make a model plane with an autopilot and a built-in robot brain. We’ll also show you how to make a comfortable chair and footstool out of a single sheet of plywood, a bicyclist’s vest that shows how fast you’re going, and projects that introduce you to servomotors. All this, and lots more, in MAKE, Volume 19! Subscribe here. Buy the issue in the Maker Shed.


Steven glues a tube to the shaft of the servomotor and somehow attaches the other end of the tube to the sonar sensor. The Ping sonar unit sends out an ultrasonic burst and measures the return time, which lets us easily calculate distance to obstacles. The servo has to turn the sonar unit constantly from side to side, scanning for obstacles in Makey’s path.

In the meantime, I’m trying to figure out how to control a servo with the Arduino. I’ve done it a zillion times with the BASIC Stamp, but never the Arduino. I find a handy Arduino library, Servo.h. We are in business. We hook everything up and run the program. The servo slams to one end of the stop and spazzes out, twitching. I must have misunderstood something in the documentation. Hmmm.

Now Steven notices that glue has gotten into the servo shaft. The motor won’t move at all anymore, no matter what I do with the programming. He takes the motor out to clean out the glue. The case of the motor falls apart. As we work to snap it back together, we notice that the wires have been sliced by the sharp edges of the metal robot body. We do what we can and bolt everything back together, but the motor never moves again. Destroyed in 20 minutes.

Somehow by the end of the day, between the three of us, and one more trip to the hobby store, the robot comes together. The servo is installed, the Arduino is installed, and the two halves of the body actually fit together. Who could ask for more? Oh, you want it to do something? That will have to wait.

Off to Maker Faire. The programming doesn’t happen at midnight in the hotel after the first day at Maker Faire. Too tired. The programming finally happens early the next morning. By 8 a.m. I’ve got the robot moving around and avoiding objects, with three hours to spare — the workshop is scheduled for 11:00. Ha! I’m way ahead.

The workshop is packed. Some friends from school give me a thumbs-up from the audience. I show off Makey, roaming around on the tabletop, then shut down the power and pull everything apart. I explain all the steps to make a robot, in great detail, showing all the bits and pieces involved, then reassemble the robot. At last, the programming. I type in a bit of code to make the robot move back and forth.

It doesn’t work. All eyes are on me. “Oh well,” I announce, “it never works during a demo. You saw it working at the beginning of the workshop, right?” Some astute member of the audience spots the problem in the code. I type in his correction. The robot moves! Success! I throw up my arms in triumph, beaming. Makey zips off the edge of the table, falls, and smashes into a great many parts. Workshop over!

I’m ecstatically happy — I can tell that everything will be a cinch from here on out!

More:
How I designed Makey the robot, Part I: The first design
How I designed Makey, Part II: Creating the “stretchy” robot body in Inventor

What will the next generation of Make: look like? We’re inviting you to shape the future by investing in Make:. By becoming an investor, you help decide what’s next. The future of Make: is in your hands. Learn More.

Tagged
Discuss this article with the rest of the community on our Discord server!

ADVERTISEMENT

Escape to an island of imagination + innovation as Maker Faire Bay Area returns for its 16th iteration!

Prices Increase in....

Days
Hours
Minutes
Seconds
FEEDBACK