8
\$\begingroup\$

Is it possible to build a motor driver using only a 2N2222 transistor?

If yes, then how?

\$\endgroup\$
2
  • 16
    \$\begingroup\$ Yes. (Trade you a better answer for more details). \$\endgroup\$ Commented Nov 28, 2010 at 13:34
  • \$\begingroup\$ No, not with only a 2N2222. You need more components... \$\endgroup\$
    – Bart
    Commented Mar 8, 2023 at 11:45

2 Answers 2

19
\$\begingroup\$

Well, by motor driver... you could mean anything.

Is the motor AC or DC? Do you want to be able to vary the direction of the motor? How about the speed? What about braking the motor?

A 2N2222 is quite a powerful transistor, but is only good up to 800mA or so. So any motor you use must not consume more than this current when spinning and when stalled, or the transistor may burn. Also, the 2N2222 is rated for 40V maximum, so you can't drive high voltage motors.

Here is probably the simplest circuit:

+12V ---------+---------+
              |         |
             / \        |
             |M| motor ---  1N4001
             \ /       / \
              |         |
              +---------+
              |
            |/
CTL -/\/\/--|    2N2222 NPN
      1k    |\>
              |
             ---
              -

The 1N4001 is a flywheeling diode. As the motor is an inductor, when you turn it off the energy has to go somewhere. The diode provides a path for this; otherwise, the transistor could be burnt out by switching the output off.

This "driver" allows you to run the motor forwards and coast it. With PWM, you can vary the speed.

Here is a H-bridge using four 2N2222 transistors.

+12V --------+------------------------+
             |                        |
      1k    /  c                    c  \   1k
1 --/\/\/---|   2N2222        2N2222   |--/\/\/--- 3
            \> e                    e </
             |       +       -        |
             |-------- MOTOR ---------|
             |                        |
     1k     /  c                    c  \   1k
2 --/\/\/---|   2N2222        2N2222   |--/\/\/--- 4
            \> e                    e </
             |                        |
            ---                      ---
             -                        -

Making S1 = 1, S2 = 0, S3 = 0, S4 = 1 the motor would go forwards

Making S1 = 0, S2 = 1, S3 = 1, S4 = 0 the motor would go backwards

Making S1 = 0, S2 = 0, S3 = 0, S4 = 0 the motor coasts

Making S1 = 1, S2 = 0, S3 = 1, S4 = 0 the motor would brake (slow down quickly)

Making S1 = 0, S2 = 1, S3 = 0, S4 = 1 the motor would also brake

Making S1 = 1, S2 = 1 would be bad and should be avoided. It would cause both transistors to come on giving a direct path to ground. The transistors would burn up, and you could damage your power source. The same applies for S3 = 1, S4 = 1, as well as setting all switches on.

There should also be diodes across each transistor, anode to the emitter. For simplicity and due to the text-only media, I omitted these. Use the same 1N4001's.

You could also replace the 2N2222's with something else to allow it to drive heavier loads. With heavier loads it's a good idea to use heatsinks on each transistor.

The inputs can be controlled from an Arduino.

\$\endgroup\$
22
  • \$\begingroup\$ It's a DC motor. Change in direction is required and so is change in speed. Is that possible with the circuit you provided above? \$\endgroup\$
    – gomek
    Commented Nov 28, 2010 at 11:23
  • \$\begingroup\$ To change the direction can I use just any PNP transistor or do I have to use specific ones? Also can I use this motor driver with an Arduino? \$\endgroup\$
    – gomek
    Commented Nov 28, 2010 at 11:36
  • \$\begingroup\$ You don't need a PNP transistor, it just makes the circuit easier. \$\endgroup\$ Commented Nov 28, 2010 at 13:35
  • \$\begingroup\$ @gomek If you want to reverse the direction you can install the motor backwards. But if you want to be able to change the direction with your Arduino when you want, without removing the motor and installing it backwards, you can use a H-bridge. \$\endgroup\$
    – Thomas O
    Commented Nov 28, 2010 at 13:37
  • \$\begingroup\$ @Fake Name, the circuit is designed for an NPN. Using a PNP would probably not work well. \$\endgroup\$
    – Thomas O
    Commented Nov 28, 2010 at 13:38
1
\$\begingroup\$

Yes, it can be done very simply, but you don't get much power or position control.

schematic

simulate this circuit – Schematic created using CircuitLab

The circuit uses the back-EMF from a single motor coil to drive the transistor, so that one transistor is all that is needed to turn the motor. Because of the back-EMF drive, it can work on different kinds of motors such as pendulums as shown in this patent, here is a also a good link.

\$\endgroup\$

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.