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.

This is another reason why I recomend people to start wit Picaxe; On the 28-board you can just attach 2 motors, one line of code, and they drive.

I think you may have interest in CowGod's postin here as well: http://letsmakerobots.com/node/359 - That is what I would go for in your saituation.

/ Fritsl

Yeah, I'm really happy with that Pololu controller. If you want to have full forward/backward/variable speed control of two motors, and the motors aren't too big (1 amp max per motor, or 2 amps if you only use one motor), that's the way to go. If you don't need that much control, you can do it with less, cheaper hardware.

Dan 

what is the difference between this http://www.solarbotics.com/products/l298/  and a pololu controller? 

~Matt

The chip you linked to is a motor driver, not a motor controller like the Pololu unit. That means it is basically just two H-bridges in IC form, so it doesn't have any onboard intelligence and you need to do more of the work yourself. Pololu has a good description of the difference between motor drivers and motor controllers on this page, I'll copy and paste that:

  • Motor drivers are the simplest modules in the sense that all they do is provide power amplification for low-level control signals (e.g. PWM and direction) supplied by the user; on the other hand, that means that the master device to which the motor driver is connected must take care of the low-level, resource-consuming signal generation.
  • Motor controllers are motor drivers with additional intelligence: an on-board microcontroller generates the low-level signals and presents the user with higher-level interfaces and commands. For example, our dual serial motor controllers allow two DC motors to be controlled by a single serial line, and the master controller simply issues commands only when the speeds of the motors should be changed. Other motor controllers are even more complex, incorporating advanced acceleration commands, current sensing, feedback-based control, and more.

 You can see my longer post below for another explanation of the practical difference between H-bridges and motor controllers. Basically, you'd need to use more of your I/O pins and generate the PWM signals yourself.

Dan

 I see :)

 Thanks ~Matt

so how do these rate compared to an h-bridge ? (cost/control/ease of use)

http://letsmakerobots.com/node/359  (cost/control/ease of use)

~matt 

I'm driving several different motors in several different ways on my Arduino-powered Little Drum Machine. What is it you want to know, exactly? The Arduino doesn't provide enough current through its I/O pins to drive a motor directly, so you'll need some amount of additional circuitry either way, but what you need depends on exactly what you're trying to do -- what size motor you want to control, how much control you want to have over it (simply on/off in one direction, or on/off in both directions, or variable speed control in both directions, etc). But I'd be happy to share with you what I've learned -- I'm no seasoned expert, I just got my Arduino a few weeks ago, but this Little Drum Machine project has presented lots of interesting challenges and forced me to learn a lot, usually the hard way :)

Dan 

I need to know what I will need to drive small dc motors (on off in both directions or variable speed control in both directions if it isnt too hard to do) 3V and up. Do I need to make an H-bridge If so how is that done?

 Thanks :) ~Matt