3
\$\begingroup\$

I have an mbed project with firmware that controls some PwmOut switches. All works fine firmware opens and closes switches as expected. I tested this with a LED (and resistor).

Now my goal is that instead of a light coming on, a electric brush motor (with a simple +/-) 3v-5v should run. I understand that the PwmOut from the mbed will not provide enough current to run the motor.

Will I need a transistor that connects the PwmOut port with the motor?

If yes:

  • how do I know what type I need?
  • these three legged guys - how are they hooked up?
RedGrittyBrick
14.9k5 gold badges40 silver badges81 bronze badges
asked Nov 15, 2013 at 10:13
\$\endgroup\$
1
  • \$\begingroup\$ It's worth adding how much current the motor draws (or a datasheet if you're not sure). If it's a small motor you could probably use the circuit from the answer to electronics.stackexchange.com/questions/7235/… \$\endgroup\$ Commented Nov 15, 2013 at 10:20

1 Answer 1

2
\$\begingroup\$

You can follow the recipe at http://mbed.org/cookbook/Motor which uses the Motor interface for driving a standard DC motor with PWM and an H-Bridge.

enter image description here

If, instead of using the L293D dual H bridge driver, you want to use a transistor to drive the motor. You choose the transistor mainly by looking for a switching transistor which has a current and voltage rating that exceed the current and voltage ratings of the motor (so it depends on the motor) - for high currents you may need a heatsink for the transistor.

For a bipolar junction transistor (BJT) you'll need a resistor to limit base current. Most driver circuits incorporate a diode to prevent harm to the transistor from back-EMF from the motor windings.

enter image description here

The connections to a BJT are base, emitter, and collector

enter image description here

You can find out which leg is which by looking at the data sheet for the specific transistor you have chosen. For example

enter image description here

You can instead use a MOSFET, these can be more efficient (lower voltage drop when 'on')

Some rather good instructions can be found here

answered Nov 15, 2013 at 11:04
\$\endgroup\$

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.