Let's Make Robots!

Driving a motor with arduino...

I need some help with driving dc motors with arduino. I have already looked at the arduino site and all I found was this http://www.arduino.cc/en/Main/ArduinoShields and no guide or parts list.

I have gone thru all of the lessons here http://www.ladyada.net/learn/arduino/  and ithas been really fun so far but I WANT TO BUILD ROBOTS! NOT BLINKIE LIGHTS! :)

 

 

Comment viewing options

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

Hehe, just keep in mind that I've only been building robots and working with microcontrollers for like a month, so I am no seasoned voice of authority :) Just sharing the things I've stumbled across as I flailed around wildly in the robotics universe :)

Dan

Nice post, but one lie:

Arduino if you use some of the PWM-capable pins on the Arduino to control it. However, if you do that, you can't do anything else while you're moving the motor.

 

At Arduino website, here you can read:

After a call to analogWrite, the pin will generate a steady wave until the next call to analogWrite (or a call to digitalRead or digitalWrite on the same pin). 

 

Aha, thanks for catching that. I must have been confusing it with the PWMOUT command for the Basic Stamp, where you have to specify how long you want the pulse to be generated, and the code will wait until the pulse completes before continuing execution. See? Take everything I say with a grain of salt :)

Dan

lols, ya.. basic limits us a lot in that way..

 thats why i'm migrating to arduino now..

i'm thinking in buy some h-bridges from sparkfun:

http://www.sparkfun.com/datasheets/IC/SN754410.pdf

when i do, i will post some info.

other thing.. you know any equivalent of this TI ic from maxim? ty

thank you that was exactly what I needed to know

~Matt

 

P.S how long did that take you to type? it makes me tired just reading it :)

Awesome, I'm glad that helped. And yeah, it made me tired to type it too :)

Dan

Adafruit recently had motor driver shield out. This link has the info. It has 2 servo ports, 4 DC bi-diretional motors and 2 step motors.

http://www.adafruit.com/index.php?main_page=product_info&cPath=17_21&products_id=81

-Pandit

Dan, this just cleared up a lot of questions I had.  Thanks.  :)

I'm glad it continues to help people :)

Dan

Dan, 

 

Wouldn't a diode be needed for the 2N3904 method to protect the arduino, I have seen this on other sites where they put it in parallel with the 2N3904 but some sites have said to put in in parallel with the motor, which of these will give the best results.

Also i was thinking of using an RC car as a base for my first robot, I am presuming it would have a motor controller built in, what are the chances of salvaging this for reuse with the arduino.