arduino controlled robot with ping sensor

bud_weiser's picture

Description: 

This is my first robot. It uses the Arduino Diecimila. It also uses a ping ultrasonic sensor to detect objects in front of it. For motor control I used the SN754410NE. I mounted the chip on a dip ic board, that I then mounted on a home made arduino proto shield. I use a 9 volt battery as the motor voltage source and 4 AA batteries as the Arduino voltage source. My goal now that I have gotten this far is to add a servo to turn the ping sideways and to add more to the program. Right now it only goes forward and reverse. I hacked a remote control truck for the wheels and used a piece of wood to mount everything on. I'll post more details later. Pretty crude right now, but it's taken me a while to get to this point. Thanks for reading.
Your rating: None
Chainer's picture

Awesome!

I like it, has a different look than I have seen on here, and it is a good one.  Also, props on the Coke can, good to see Soda/Pop/Cola (depending on region) featured in a pic for once.
the_keywork's picture

Hail to the COKE can! 

Hail to the COKE can!  Looks good. I think you might find that you want to point that ultrasonic sensor down some.  It doesn't really do the robot any good to see obastacles above it.  Keep it up!
bud_weiser's picture

product placement

Thanks for the positive feedback. The ultrasonic sensor will point lower, except that the harness I used isn't long enough right now. I have a pir and some ir sensors I want to add, but I'm learning as I go since I never programmed in C language before, only ladder logic. Actually, I have a question for the LMR members out there, I'm having trouble coming up with the program for the servo to make it continuously turn from 0 - 180 and back again. Similar to Frits' pic programming but only in Arduino language, or C+. I already learned how to control the servo with a potentiometer, and also to go to a certain angle, but not like I described from 0 - 180, and back again, repeat... If anyone has any ideas, I'll try them out and post my success or lack thereof. Peace.

ericski's picture

Do you want it to stop in

Do you want it to stop in the middle of the program and scan or have it panning back and forth during the program?

edit:

here is some UNTESTED code that should sweep the servo back and forth while your main program runs

 

#include <Servo.h>

byte currentPos = 0;
byte positioner = 15;
Servo sensorServo;

//
// Called periodically to adjust the servo position in 15 degree increments
//
void moveServo()
{
if ( currentPos == 0 )
{
positioner = 15;
}
else if ( currentPos == 180 )
{
positioner = -15;
}
currentPos += positioner;
sensorServo.write(currentPos);
}

void setup()
{
sensorServo.attach(9);
}

void loop()
{
//
// do some stuff
//
moveServo();
//
// do more stuff
//

}

voodoobot's picture

One thing to look at to

One thing to look at to control the motor a little smoother is using the pwm. It'll let you ramp up and down the speed a little smoother. it'll cut down on the spiking when you change from forward to reverse.
maneuver's picture

props for the self made

props for the self made motor shield.

Looks like a fun project for with hours of swearing behind it, and hours of fun ahead...

Keep it up, we need more Arduino projects in here to balance out Fritsls and his likemindeds Picaxe fanatism.

 

/ vzz-clck-"Maneuver"

RobotGrrl's picture

Interesting bot :) It would

Interesting bot :) It would be cool to see it do more stuff- but at least it runs on an Arduino!! :D

 

PS: My dad has the same laptop

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.