1

I am in hold of an Arduino board and 12V DC motor. I need to be able to control the motor speed gradually, my intention is to output a PWM current in range of between 0 and the maximum 5V of the board to the motor.

My question is what do I need to have in order to multiply the output from the range of 0 - 5V to 0 - 12V to fit the motor?

Daniel Grillo
  • 7,659
  • 18
  • 51
  • 69
user33305
  • 113
  • 1
  • 3

1 Answers1

3

enter image description here
image selected at random from somewhere in the intertubes.

enter image description here
ditto

Some people prefer MOSFETs

enter image description here
ditto

See also prior art

For a bigger motor you might use a BJT to turn on a heftier MOSFET

enter image description here
ditto

Important notes

  • Ensure you use a switching device that can comfortably handle more than whatever maximum current the specific motor will need.
  • It is good practice to have a snubber diode across the motor to prevent it causing damage to the switching elements.
  • The ground of the motor's power source should be connected to the ground of the Arduino's power source (e.g. the header socket marked "GND")
RedGrittyBrick
  • 14,602
  • 5
  • 37
  • 77
  • 1
    And have a snubber diode across the motor, either discrete or within the switching device itself. – Ignacio Vazquez-Abrams Nov 26 '13 at 10:45
  • 2
    How do we vote to add this to the Wiki as the answer to 50% of all the *duino/pic/Pi questions posted here? – John U Nov 26 '13 at 11:55
  • If it is added to a Wiki type thing, I think it is important to note that 2 of those drawing/schematics explicitly show the common ground between the motor power source and the microcontroller power source and 2 don't. A word about the need for a common ground would be useful in my opinion. – mikeY Nov 26 '13 at 15:44
  • The internal diode in the MOSFET will not replace the external diode in this configuration. When the MOSFET turns off, the voltage on the drain will spike positive (not negative). You still need the diode across the motor. – Tut Nov 26 '13 at 16:00