Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: rahulpwns on September 19, 2011, 09:59:48 PM

Title: Powering 2 DC motors with an Arduino Mega 1280
Post by: rahulpwns on September 19, 2011, 09:59:48 PM
Hey guys,

i want to send power to two dc motors with pwm, but the arduino mega cannot supply enough power to the motors.
how can i send power to the dc motors and still be able to control their speed?
should i look into the arduino motor shield?

Thanks,
Rahulpwns
Title: Re: Powering 2 DC motors with an Arduino Mega 1280
Post by: Gertlex on September 19, 2011, 10:51:08 PM
I'm not an arduino guy, but in general, you're probably right.  The more general approach is called a motor driver or motor controller.  One example is the variety sold by Pololu, which can controlled via PWM.  Pololu makes comparing different motor drivers pretty easy: http://www.pololu.com/search/compare/11 (http://www.pololu.com/search/compare/11)
Title: Re: Powering 2 DC motors with an Arduino Mega 1280
Post by: Soeren on September 20, 2011, 07:48:08 AM
Hi,

[...] how can i send power to the dc motors and still be able to control their speed?
If they only have to go one way, just "amplify" the PWM with a power transistor.
If they need to go both ways, use an H-bridge (discrete, integrated or ready made).
Title: Re: Powering 2 DC motors with an Arduino Mega 1280
Post by: rahulpwns on September 20, 2011, 05:08:19 PM
one of them needs to be able to go both ways and the other only needs to go one way.
i don't want to spend more than $30 total to control them.
can you explain how "amplifying" the pwm with a power transistor works?
Title: Re: Powering 2 DC motors with an Arduino Mega 1280
Post by: Gertlex on September 20, 2011, 05:39:34 PM
one of them needs to be able to go both ways and the other only needs to go one way.
i don't want to spend more than $30 total to control them.
can you explain how "amplifying" the pwm with a power transistor works?

Any motor driver can do those things, and thus you'd probably want a dual motor driver.

But we really need to know how much current these motors are going to draw.
Title: Re: Powering 2 DC motors with an Arduino Mega 1280
Post by: rahulpwns on September 20, 2011, 06:29:53 PM
i actually do not know how much current the motors would use, because i am stripping an rc car of its parts
also, what is the difference between a dual motor driver and a normal one?
Title: Re: Powering 2 DC motors with an Arduino Mega 1280
Post by: Soeren on September 20, 2011, 06:52:23 PM
i actually do not know how much current the motors would use, because i am stripping an rc car of its parts
Then you need to measure it!


also, what is the difference between a dual motor driver and a normal one?
The amount of motors it can control  ;)
But given your specs, you could settle for one H-bridge and one single transistor - that is, if you're up to building your own electronics circuits?
Title: Re: Powering 2 DC motors with an Arduino Mega 1280
Post by: Mastermime on September 20, 2011, 07:38:45 PM
Otherwise, if you aren't up to building your own motor driver.  You can buy one from dimensionengineering.com.  They sell a variety of great motor drivers that offer PWM.
Title: Re: Powering 2 DC motors with an Arduino Mega 1280
Post by: WaterPig Master on September 22, 2011, 01:51:45 AM
I have recently built both types of motor driver you need. One of them is a simple MOSFET circuit with pull down resistor, that turns the motor on. The other is a circuit containing 4 MOSFETs (two P channel and two N channel) that can drive the motor both ways, brake or coast.

I can't right now, but later on I'll hunt down some schematics for you.

As soeren says, it would be helpful to know how much current the motors are drawing. To do this, put a multimeter in current mode, starting from the highest current and working down if it doesn't give a reading. Connect the positive terminal of a battery to the one terminal of the motor. To the other terminal of the motor connect the positive meter lead, then connect the negative meter lead to the negative terminal of the battery.

The reading you'll get is the free-running current - this is the smallest amount of current the motor will ever draw. Apply some friction to the motor shaft with your finger to simulate the work the motor will have to do, and get that reading,

Then, double it, and that's the kind of current rating your MOSFETs will need.

Cheers,
Barnaby