I'm new and i know almost nothing about electronics (i'm a programmer). I have to control a DC motor by using a transistor with a PWM pulse given by my raspberry. This is the scheme i thought about, is it correct or will i burn it all? The motor used is: www.amazon.com/Yeeco-Electric-Torque-Engine-Machinery/dp/B072HDDSHG

enter image description here

  • 1
    \$\begingroup\$ Show the pin names on the 2N2222 to be unambiguous. \$\endgroup\$
    – Andy aka
    Commented Jul 29, 2018 at 15:30
  • 1
    \$\begingroup\$ The maximum continuous collector current for a 2N2222 is 600 mA DC. The stall current for the motor you linked to is in excess of that. You should select components for reasonable bad conditions, say the motor got jammed at 99% PWM. Exceeding a maximum value will usually severely damage or destroy the transistor. \$\endgroup\$ Commented Jul 29, 2018 at 15:38
  • \$\begingroup\$ Welcome to EE.SE! Please provide a proper schematic, showing the emitter, base, and collector of the transistor and how they are connected to the rest of the circuit. Show the anode and cathode of the diode. At first glance, it looks like you are trying to use an NPN transistor as a high-side switch (between 3.7V and the battery) which will not work well. \$\endgroup\$ Commented Jul 29, 2018 at 17:37

1 Answer 1


Your connection scheme will burn out the transistor- the diode is forward biased and the transistor is an emitter follower.

The 2N2222 not a very beefy transistor, the motor has to be very small for it to be appropriate. In any case, the correct method is more like this:


simulate this circuit – Schematic created using CircuitLab

It would be better to subsitute a logic-level power MOSFET for the 2N2222 if the motor is more than 100mA or so. It's also better to use a Schottky diode for the flyback.

Your ground connection is correct on your schematic.

  • \$\begingroup\$ Thanks for the answer, could you recommend me an adeguate MOSFET for using the motor (i just see that the max consumption current of the last one is about 1.3A with 3v)? Changing the transistor with MOSFET must i change the circuit too? \$\endgroup\$
    – lampaDT
    Commented Jul 29, 2018 at 15:54
  • \$\begingroup\$ Here is one possibility. The same circuit can be used, E->Source, B->Gate, C->Drain. There are very few through-hole parts with the required characteristics. The one I linked to is a TO-252 which is easy to work with. \$\endgroup\$ Commented Jul 29, 2018 at 16:01
  • \$\begingroup\$ @lampaDT Using a MOSFET is more ideal than using an NPN when it comes to this type of application. However, it depends on what the specs of your motor. I have done a similar project but with solenoids and I was using a MOSFET instead. \$\endgroup\$
    – user103380
    Commented Jul 29, 2018 at 16:36

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.