NPN Transistor H Bridge Problem with Arduino

Hi!

I'm trying to make a H bridge with four BC337 NPN transistors. When I connect all the transistors bases to separate four arduino pins it works. But when I connect two transistors on the same pin (1 - 3 , 2 - 4) it's not working. Im sure the circuit is correct. I think Arduino digital pins can't supply enought current to 2 transistors because it's working when connected separately. How can I solve this?

Sorry for bad English.

images.png

I'm biased toward this solution: All NPN H-bridge

We live and learn: I always thought 2 of the 4 transistors needed to be PNP.

Thanks for your replies. But it works when I connect the bases separately. Why Arduino can't control two transistors from same pin?

anc:
Thanks for your replies. But it works when I connect the bases separately. Why Arduino can't control two transistors from same pin?

It can if they're wired properly. I'm betting yours aren't. Double check the wiring.

kenwood120s:
We live and learn: I always thought 2 of the 4 transistors needed to be PNP.

That's certainly better than all NPN because you don't have to worry about the base voltage drop, but it's not impossible to do all NPN.

Many H-bridges are made with all N-channel MOSFETs too. N-type silicon has better conduction properties than P-type, so there's a distinct advantage to using N-channel on the high side even though the driving circuitry (called a bootstrap driver) is more complicated.

Thank you all. I will check the wiring again. But I'm wondering is there a possibility of Arduino can't supply enought current to both transistors from same digital pin? I think it's 40 mAh maximum for output pins. Or should I buy some PNP transistors and make a H-bridge with both NPN and PNP transistors? Is it better? And can Arduino control PNP transistors?

Hi,
Do you have a DMM to do some basic troubleshooting?

Tom... :slight_smile:

Yes I have but I don't have the circuit with me now and for a few days. I will do it when I get the circuit. Thanks!

Perhaps post a picture of YOUR circuit, and how you have it wired up to the arduino. Include the resistor values and transistor part number.

Like I said I don't have the circuit with me. I think you can't help me without any pictures. I will send some pictures when I get the circuit. Thank you all for your replies.

Hi,
Also post your code along with the images.

Thanks..Tom.. :slight_smile:

Google "Emitter follower".

But I'm wondering is there a possibility of Arduino can't supply enought current to both transistors from same digital pin?

No.
Two 500R resistors in parallel is 250R. So ignoring all the voltage drops that would make the current less, that is a maximum current of 5/250 = 20mA, well within the capability of an Arduino pin.

Note with this design the voltage at +V can not be greater than the voltage from an Arduino pin.

Thanks. Probably there is a problem with the wiring. I will check it.

anc:
Hi!

I'm trying to make a H bridge with four BC337 NPN transistors. When I connect all the transistors bases to separate four arduino pins it works. But when I connect two transistors on the same pin (1 - 3 , 2 - 4) it's not working.

PNP for the high-side drivers is how to do it, or else use a charge pump arrangement to bias the top
devices into saturation.

Im sure the circuit is correct.

Ahem.

You are using emitter-follower for switching - I'd call that a mistake.

You have base resistors on an emitter follower - unnecessary/lowers performance.

You have chosen rather high base resistors for the low-side drivers, 150 ohms might be more
sensible if you want to be able to use the 0.8A capability of the BC337 in saturation. Even lower would
be better but would overload the Arduino pin...

As it is your devices will overheat at as little as 0.3A I reckon - the top two because thay are
emitter followers (not saturating at all), the lower two because the high base resistor value
prevents a decent level of saturation at full load.

At saturation the Vce should fall to 0.5V or less, meaning low heat dissipation at high current.
The base current will be 5 to 10% of the collector current. The transistor gain figure hfe
does not apply to a transistor in saturation.

[ Good modern switching transistors can saturate at <0.1V or less for >1A, much better than
old-school devices like this or the 2N2222 ]

Thank you for your reply! What should I do for make the circuit better? Should I use PNP transistors at the top?

What's the motor exactly? Supply voltage?

BTW I've used this circuit before for powering small motors:

Note the freewheel diodes which were missing in your circuit come to think of it, its drawn
swapped over from the normal layout for an H-bridge, sorry about that. The current setting resistors
(R5, R6) are tuned for the supply voltage and expected stall current to keep the devices in saturation

It's a cheap 3-6V motor and I guess max current is about 600mAh. Thanks for the circuit. I will try that one too. And should I use both PNP and NPN transistors? I see most of the H-Bridges are half PNP and half NPN. What are the disadvantages of using all NPN transistors? If half PNP half NPN is better then how should I connect them? (Like "PNP transistors emmiter to V+ , NPN transistors emmitter to V-" or opposite)

If half PNP half NPN is better then how should I connect them? (Like "PNP transistors emmiter to V+ , NPN transistors emmitter to V-" or opposite)

Yes, that's the way pnp transistors are hooked up. Just like in MarkT's diagram. You should be able to figure out the pin assignments easy enough.

It's a cheap 3-6V motor and I guess max current is about 600mAh

That mindset will get you in trouble. For a motor, it is easy enough to get the amps. Just use a ammeter (dvom) in series and check at voltage under load/no load. While it is running under no load, it might be 600mA, but grab hold of the shaft and stop it, get the reading, and let it go. Don't dawdle while stalling the motor or you can damage it. That gives the running and stall current, which might be well over 1A.

anc:
I guess max current is about 600mAh.

Current doesn't come in mAh, that's capacity. Current comes in mA.