How can i power and control 2 motors?

How would i power 2 3v motors and control their speed with an arduino?

From another question i asked here i learned that the digital pins on the arduino output enough voltage to power my motors but not enough amps (Not sure how much these small hobby motors use but i was told the digital pins only output 40ma each).

So i need to figure out how i can power and control the speed of each motor. My idea so far has been power the motors using the 3.3v power pin (im assuming it pumps out more amps, will need to research). Then in between the power supply and the motor add a piece of hardware that will close and open the circuit for the motor using a digital pins on/off state. (I have no idea what kind of hardware could be used to accomplish this though).

I'm still new to alot of this stuff so if anyone has ideas please explain everything in detail.

Thank you for any help :D

You're not that far off.....

Have a look at a circuit like this which uses a transistor to switch the power off and on by the PWM control of one of the data pins. But you would need an external supply to run the motor: the Arduino only does the control.

If you need to reverse direction as well, then you need to look at an h-bridge which have the added bonus of being able to run two motors.

Just don't use an L293 or L294 unless you want to give away 2 volts of your supply voltage. Those devices are not designed to drive low voltage devices.

Use something like: http://www.pololu.com/product/2135

Note they even give you a schematic on how to connect things.

rmetzner49: Just don't use an L293 or L294 unless you want to give away 2 volts of your supply voltage.

You mean a 298 I think.

But yes good point, and I should have mentioned that fact. I use a 2130.

You mean a 298 I think.

Yes. I have used the 298 in the past on a DFRobotics Romeo Board but I used a 15V supply to drive 12V motors. Of course living with the voltage drop is OK if you have it, but the OP was talking 3.3V motors, so either of the "L" chips is a bad choice.

The product you cited goes down to 2.7V, so that should be fine.

h4344: How would i power 2 3v motors and control their speed with an arduino?

From another question i asked here i learned that the digital pins on the arduino output enough voltage to power my motors but not enough amps (Not sure how much these small hobby motors use but i was told the digital pins only output 40ma each).

40mA is the absolute max - you don't go that high if you want the chip to last. Motors take MUCH more current than a logic chip can provide, don't even think about it!

So i need to figure out how i can power and control the speed of each motor. My idea so far has been power the motors using the 3.3v power pin

That's one way to destroy your Arduino. The 3.3V pin cannot supply high current either, on some boards its limited to an absolute maximum of 50mA. External supply is the correct way to power any motor. Motors put spikes onto their power rails that can reset or damage logic chips, keep it separate.

(im assuming it pumps out more amps, will need to research). Then in between the power supply and the motor add a piece of hardware that will close and open the circuit for the motor using a digital pins on/off state. (I have no idea what kind of hardware could be used to accomplish this though).

If you use PWM you can use a higher voltage supply than 3V and simply limit the maximum PWM duty cycle to prevent overloading the motor.

The darlington-based L298 and L293's lose about 2 to 2.5V across their output drivers so you can drive a 3V motor from these if powered from 5--6V. Don't use the Arduino 5V to power the motors though.

I'm still new to alot of this stuff so if anyone has ideas please explain everything in detail.

Thank you for any help :D

Normally a MOSFET H-bridge would be a good choice for low voltage driver as the voltage losses are much less than in a L298 etc. However they need a minimum voltage to work, typically 5 or 6V... This is because MOSFETs need a minimum gate voltage to turn on.

Pololu have a nice range of motor drivers and its worth looking at what they have.

Let me emphasize something MarkT said - do NOT use the 3.3V output from the Arduino to power those motors. You'll likely smoke the regulator on the Arduino. That is a low current output, motors typically draw a lot of current when starting. It is called Stall Current.