Simple h-bridge problem

I am working on simple circuit to drive a clock. This clock require 24V pulse each minute with alternating polarity between each pulse. I decided to use an simple H-bridge but it is shorting power supply. I did not connected output yet (no clocks attached) but it should work even without any load, right? :thinking:
Operation should go like this: normally I keep both control inputs high, meaning pnps closed and npns open, actively shorting outputs to GND. If I want create a pulse I pull one input low, meaning one npn closed and one pnp open creating a path for current. That is theory and simulation which worked flawlesly. In reality it's shorted even in it's 'idle' state. Not sure where I made mistake, resistor value maybe? Drawing of circuit attached. Handmade :smiley:

Please advise, thank you :slight_smile:

That doesn't look very nice unless you are driving D2 and D3 with a voltage swing of 0 to 24 volts.
Sounds like some bad shoot through.
An alternative to designing your own circuit is to use a motor driver chip, say L293 (but there are newer and better ones)

By default both high and low side transistors are ON, what kills both pairs.

If D2/D3 come from an Arduino pin, then your circuit can't work.
For the PNP transistors to turn off, D2/D3 must switch to 24volt, which an Arduino pin can't provide. The circuit also has shoot-through (Google it). And it needs kickback diodes across the transistors.

Much easier to use an H-bridge chip, like the L293D.

1 Like

Oh, thanks, that makes a sense actually. 5V on base of pnp isn't enough so it's still open, at least partially. I did saw few circuits with npn used to drive high side, wondering why. Now I know :smiley:
Why flyback diodes are needed? I thought those ore only required for motors and big inductive loads. I will be driving very small coil acting as electromagnet, is that still issue?

I would do it like this, so nothing will happen to the Arduino and there is no short circuit either.

You can control this H-Bridge with the 5V signals from the Arduino. A HIGH level (or HIGH pulse) at ONE of the two control inputs 'Arduiino_D2' or 'Arduino_D3' controls the clock's motor. So if you alternately send high impulses to D2 / D3, your clock will run. A simultaneous HIGH or LOW on D2 / D3 does NOT create a short circuit, but the clock then does not carry out a step.

the flyback diodes prevent the motor coil, which can generate a very high reverse voltage when it is switched off, from killing the transistors because the douden dise voltage then short-circuits or limits it to its forward voltage. This protects the transistors.

That looks good with the NPN and PNP transistors interchanged. Out of curiosity, I checked out one half bridge with LTspice and it solves the shoot through problem.

Yes, that's exactly why the transistors are swapped. Without this, the circuit plays Indians and gives smoke signals.

Nah, it did not released any magic smoke, all parts should be good, the Arduino was not even connect yet, it was just bridge with inputs tied high.
That circuit seems interesting and I never thought about it like this, swapping a transistors. I will look into it. Thank you.

1 Like

You're welcome. The circuit as I am showing it here has been used several times in RC model making. I have been using this circuit concept in this form for over 40 years, but instead of the Arduino with 5V digital logic ICs. Back then, microcontrollers were not as much an issue as they are today, and many functions that are nowadays solved with software are 'programmed' with logic ICs and operational amplifiers in hardware. But even then you often needed half bridges to control motors, which were also controlled with 5V logic.

I see the circuit is sometimes referred to as a "complementary emitter follower" H bridge.
Now that I know what to look for, I found a slightly simpler one here where stacks of different H bridge designs are discussed: GO LOOK IMPORTANTBOOK: Transistor upgrade system to operational amplifier and then At a glance Developing a flying car o Auto Mobile AMNIMARJESLOW GOVERNMENT GOOD JOB GOOD COLLABORATION ON MA THE MATIC 222 2049 91220017


1 Like

yes, only my solution has the advantage that it doesn't matter if for some reason inputs A AND B go HIGH at the same time. It is therefore safer to use with the Arduino because a possible program error is not expressed in smoke signals. Saving components is not always associated with an increase in operational safety (or protection against programming errors). that's why I recommended this variant.
I am aware that there are simpler solutions than mine, so use them myself if I am sure that the rest is also okay. However, if I have to recommend something where I do not have it completely under my own control that external errors do not cause any damage, I also choose the slightly more complex variant.

Remarkable handmade scheme. Impressive.

But of course everyone can use the circuit solution that suits them best.

In my case there should be no way to have both inputs high (if I would want use this 'unsafe' bridge) since which output goes high is controlled by bool statement.
The things is that I am limited by space, that is why tried to go with simplest solution with fewest parts possible which did not work as expected :smiley:
Again thanks for ideas!

1 Like

No problem, if you can ensure that both never go HIGH, not even BEFORE, or during the void setup, then it is no problem at all to use the simpler variant. Saves space and money, you are absolutely right.

Just be careful, a digitalWrite can take a few microseconds to execute, so the order in which you switch the outputs can be important. Also, as mentioned in the previous post, the pins will be floating when the arduino is reset.

Floating pins can be fixed by pull down resistors. During start up and void setup to avoid both go high, first do pinMode on first one then do digitalWrite low on it, then declare the second output and drive it low. That is idea now at least.
Since this device is basically a clock signal generator it should run non-stop, so not much starts

:+1: :+1: :+1: