My First Robot (with Arduino)

This is based off of the "First Robot" tutorial and uses the Arduino Decima board instead of Picaxe; it's also the first robot I've ever built.

The Arduino board doesn't have a dedicated slot for the motor driver chip, so it had to be on it's own board. After doing that I decided to make that board the main one and use several pin/header rows to connect it to the Arduino board and peripherals (sensor, servo, motors). This way I could easily unplug the motor when I wanted to test the servo or reconfigure things on this fly. It ended up working very well.

At first I was having some trouble with the motor driver, so I added an LED to each of the 4 control pins of the driver chip. Now I can see which ones are high and low (see second video).

Programming the Arduino does take a little more code to control the servo, but I personally feel more comfortable with thta style of programming than Basic. Plus, since I'm a Mac user it's nice to have a development environment that works on my system. I am also learning Picaxe basic and will be building some robots with my Picaxe 18x project board soon. I've already built a controller to run a big brushless motor through an RC motor controller with the Picaxe 08m (will post pics and videos soon).

To judge distances the robot uses a Parallax Ping ultrasonic sensor that I picked up at my local Radio Shack. This sensor has 3 pins: 1 for data, 2 for power (vin, gnd). The results were very consistant until I plugged everything else in. I suspect that the electrical noise from the servo and motors were causing a slight "blip" (technical term) in the results, so I added a function to average it out.

To debug the code there are a number of Serial.println functions that send a message to the serial viewing window. It's very handy.

I've uploaded the code for anybody who might want to try it. You need to remove the "_.bas" extension -- I added this to get through the content upload filters. The code requires the Servo.h library that you'll need to download and unzip in the "hardware/libraries/" directory which is in the same directory as the Arduion IDE program.

Adruino with lots of wires and pins

 

 

 


This is a companion discussion topic for the original entry at https://community.robotshop.com/robots/show/my-first-robot-with-arduino

Cool, nice work, feels good,

Cool, nice work, feels good, doesn’t it? Have made electric life… :slight_smile:

I hate videos shot in the dark - however, it is actually pretty funny and cool that in your first video the bot drives towards a sign that says “Track ->”, and it turns that way and drives on :smiley:

A new robot is born, it makes me happy :smiley: Thanks for sharing!

Thanks, it does feel really
Thanks, it does feel really good to have it “come to life”! I tried to get as much light for the video as I could but my camera phone always makes things look darker. I’m going to try to fix my other camera so I can get better videos.

Sunlight is the keyword here
Sunlight is the keyword here :slight_smile:

You should be able to upload
You should be able to upload .pde files from now :slight_smile:

Quote!
“DR.Henry Frankenstein: Look! It’s moving. It’s alive. It’s aliveIt’s alive, it’s moving”

How you made the head stand up

That thing you have on the servo that connects the head to the sensor… was $9 int the shops here!

theres supposed to be brackets for the Ping))) but i didnt want to wait for it in the mail

so i used rubber foam :slight_smile:

Ping Stand

The Ping stand was actually pretty simple.

  • I bought a cheap Perf Board from my local electronics shop (Radio Shack) and used my dremel tool to cut it down to that smaller size.
  • Soldered the Ping to one side and a row of male pin headers (http://tinyurl.com/4rn7q5) to the other.
    • The headers are optional, I could have soldered the wires straight to it. However, this way I can unplug it when I need.
  • I attached the perf board setup to the servo with a couple of small screws through the existing holes and into the servo horn.
It makes for something that is very modular and can be moved between servos or other setups.

Hey that is a pretty good

Hey that is a pretty good "ping stand" - you should make a walk through (just a short one) - Everyone are struggeling to mount their sensors, you have found a nice solution! :slight_smile:

F.