I need to control a 12V motor with the 5V output pins. I know I need an h-bridge driver chip, but how do I go about boosting the voltage? I know I can use an op amp comparator, but where do I get the 12 V? If i supplied 12v to the board, would Vin supply 12V? thanks in advance:)
Normally you'd use a 12V power supply (with enough current capability to run the motor). The H-bridge should accept 5V "control" signals from the Arduino.
okay! how would I go about connecting it to the board? I have a ac dc converter.
You only need an H-bridge if you need to run the motor in both directions. If only one direction then a single mosfet switch should do the trick.
I would not bother trying to boost the 5 volts from the Arduino board to run the motor, not enough juice. Check out Hobby King for a couple of 3S Lipo batteries and a suitable charger for stuff you want to build to run around untethered.
For the bench a lot of people use an ATX PC power supply. Lots of info on the web on how to slightly modify one so it will turn on and provide you many amps at +5 , +12 , and +3.3 along with a few other Voltages.
meaghanp:
okay! how would I go about connecting it to the board?
Then you should post more details of what you actually have
okay! how would I go about connecting it to the board? I have a ac dc converter.
Be careful to not exceed 12V powering the Arduino; less (7..9V) would be preferrable; if you have more external devices connected to the Arduino which draw some current, the poor 5V regulator onboard of your Arduino will have to deal with the heat being produced by
(current flow) times (power supply voltage - 5V) = energy being converted into heat!
If you go with MOS-FETs only (either H-Bridge or one MOS-FET, if you need only one direction), this will not draw much (control-) current from your Arduino and you might be fine with a single power supply of 12V to power both: your Arduino and your motor with driver.
But: don't draw the motor/driver current via the Arduino board. Power the Arduino with the 12V and have another wire from the 12V power supply directly connected to motor/driver. Don't forget to connect motor/driver GND with Arduino GND.
Here is an example if you just need one MOSFET:
Note:
The MOSFET type is just an example; others might recommend other MOSFETS; important: low "ON" resistance and compatible to logic levels 3.3V .. 5V (Arduino control level).
Hello,
maybe it's a bit "overpowered" but a very easy-to-use solution for your problem:
MegaMoto Motor Shield
The shield provides a full H-bridge or a double half-bridge functionality, with PWM control (0...100% in both directions) and also current feedback to the analog pins. I am using this for a couple of months now to control very high loads (12V, 10-15A). Works pretty fine! Also the current feedback seems to be quite accurate.
All you need is an external power supply, which delivers 12V and the necessary amps.
With this you just use the 5V (or 3.3V) pins of your Arduino to control the shield, but not for powering the motor. In principle, the shield simply opens and closes the line between your motor and your power supply.
Regards and good luck!