That time I built a robot.

Kim Arnett  - May 4 '17 - - Dev Community

I was always kind of curious about robotics. As a mobile developer, I realize how fast technology changes & understand I might not be working on iPhones in 10 years. I may be working on some kind of software-hardware-Alexa-human-body combination. Who knows.

Robots. The wheels started turning back in college. I had a professor who created programs for robots and I was memorized. His robots were built out of humor more so than practicality, but the basis of them was still impressive. A small robot to jerk around quickly and sporadically with the sole purpose of cat entertainment, or a computer hacked into a power wheels to drive around the campus sidewalks. We watched the webcam's live stream while it cruised around.. entertaining to say the least.

At some point, I came across this book: Robotics: A Project Based Approach. The one flaw I encountered was it isn't 100% complete. Parts were missing, instructions were missing, there was some guessing involved. Hoping to blog both here and on my personal site as I work through the book to fill in some of the gaps. I still recommend it though. There were a lot of great code samples. I will also be posting how I built this, so you can build your own too.

TLDR:

What I built (& soon you can too):

Project 1 is a Prototype Roomba. Proto-roomba roams around the room aimlessly avoiding walls. That's all.

Rundown
The brains of the robot is all through the Arduino Uno. The Uno is the computer orchestrating which ports get power and when. (I will spell this out better in the next post) The Uno is sandwiched on the back half of the robot between the battery pack (bottom) and Ardumoto Shield (top).

The Ardumoto Shield will plug into the Uno via the stackable headers you'll need to solder into place. (Only soldering required for project 1). Ardumoto is what controls the motors of the chassis.. on, off, clock-wise or counter clockwise.

Other important piece is the blue & black eyes in the front. This is the Ultrasonic Sensor, which tells the Uno when a wall or object is getting close. Based off this value, your code will tell the motors to turn.

Supplies:

Here's the supplies you will need to get started in robotics.

  1. Arduino Uno R3 - Newegg $4.09

  2. Ardumoto Board - Amazon $6.99

  3. Stackable Headers (Recommend at least 2) - Sparkfun $1.50

  4. Magician Chassis - Amazon $29.95

  5. Breadboard (need 1) - Amazon $9.00 for 3 pack

  6. Ultrasonic Sensor (need 1) - Amazon 2 pack $6.38 or Sparkfun $3.95

  7. Solderless Jumper Wires - Amazon $7.20

  8. Soldering Iron / Solder ** I picked up a "Learn to Solder Kit" From my local computer store. I strongly suggest similar practice before you try soldering the Uno (If you are new).

  9. Computer screwdriver set - Amazon $13.29

Immediate Lessons Learned:

  • Debugging hardware and debugging software are complete opposites. And you will be doing both simultaneously.

  • Test hardware before & after soldering.
    I was lucky to not have any problems, but I saw others discover their boards weren't working. If you discover this before soldering, its easy to contact the company and swap out a bad part. If you discover this after soldering, it could very well be the soldering & the company won't be replacing it. (I did have to buy another ardumoto board because I soldered the wrong part. So check everything twice, but if you buy what I suggested above, you should be good).

  • Code / Build / Test frequently & in small iterations.
    It could be a bad connection.
    It could be lower power.
    It could be your code.
    It could be any combination of things.
    You will get frustrated, so keeping iterations small helps with process of elimination. It's much easier to get something working that you last tested 10 minutes ago, than something you haven't tested since yesterday.

  • Realize everything you learn can be applied to other projects.
    If you're not into my proto-roomba, there's a thousand other nifty robots out there. Spark fun has a million components, you can literally go wild over. Have fun. :)

Stay tuned for a full tutorial on Proto-roomba! Feel free to leave any thoughts or questions down below in the mean time.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .