First of all I'm a noob.

I was trying to do the H-Bridge using 2N2222 controlled by an Arduino Uno.

This is the design--->


I joined A1 and A2 to form a common terminal (say A), similarly, I joined B1 and B2 to form B. Now I connected A and B to 2 pins of the arduino (say pin 9 & pin 10 respectively).

So, theoretically, when I should digitalWrite pin 9 HIGH, then current should flow via A1 and A2, i.e. left to right in the motor AND when I should digitalWrite pin 10 HIGH, then current should flow via B1 and B2, i.e. right to left in the motor.

Hence, I can control the direction of rotation of the motor.

BUT.....it wasn't working...!!!!

I need help...!!!

After much thinking I had a hunch...."Perhaps, I am not giving GROUND to the transistors". I thought about it, but was unable to figure out the way of doing it.

So, again, please help me...!!!

  • If Ground is the issue, connect it to the -ve of the battery. You can't just run one wire to the bridge, voltages are meaningless without a reference (commonly called Ground). – Nick Gammon Jan 11 '17 at 3:34
  • This circuit will not take advantage of your 9v supply when you only have 5v logic to drive the upper transistors, and designing a circuit that could is not really a question about Arduino. If your goal is just to control something, look at an FET bridge like a TB6612FNG. If you want to get into the details of designing a bridge from scratch, you are going to need to spend a lot more time understanding transistor circuits. – Chris Stratton Jan 11 '17 at 4:37
  • 1. Make sure you have connect Arduino ground with -VE of battery. 2. If it still does not work, try to drive A1 A2 B1 B2 separately first. – dhimaspw Jan 11 '17 at 7:49
  • Transistor needs like 0.7V from base to emitor to open. Arduino have 5V pins. So the voltage on motor can be max 4.3V to be able open A1. But if you open that, than you connect it to 9V of batery, the motor gets most voltage so there would be more then 8V on the side of motor and A1 closes, as B-E voltage is like 5-8=-3V enough to close it. You can drive the motor from 5V batery (and loss a lot of power), or you need more complicated schema of the H-bridge. I suggest reading scolton.blogspot.cz/p/motor-controllers.html web.mit.edu/first/kart/controller_rev1.pdf to get some ideas – gilhad Jan 11 '17 at 12:35

I am not an electronics guru yet either so others might give you a better answer, but this is one circuit I have messed with a lot because I keep trying to build robots, so I will take a shot at an answer.

Normally you need both NPN and PNP transistors for an H-bridge:

Basic H-Bridge Circuit

The 2N222 is NPN so you'd want to pair two of them with two equivalent PNPs such as the 2N2907.

I've see diagrams that have all NPNs but I have never gotten a circuit to work that way. There is a distinction about where the load goes, before or after the transistor, that makes you chose to use an NPN or a PNP in order to make it all flow properly.

  • 1
    This circuit won't work for the question's power supply, either, as the supply voltage is more than a diode drop above the logic voltage. The maximum voltage at "Forward Input" is 5v, but the emitter of your PNP transistors is at 9v, so they will always be "on" with no way for the Arduino to turn them off. Designing a working H-bridge is not trivial. – Chris Stratton Jan 13 '17 at 3:43

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