H-Bridge with 4 Transistors and varible voltage


I would like to build an H-Bridge with 4 transistors, which can be controlled by arduino. I would like to use it to discharge a capacitor (charged to any voltage between 0-30V) over a solenoid.

Here is a circuit I found:

(Source: What Is an H-Bridge? - Build Electronic Circuits)

I understand I have to use NPN transistors for the lower ones. I can control them by simply using an I/O and set it to HIGH (+5V). The voltage drop of points 3 and 4 to ground will always be 5V.
But I don’t know how to deal with the PNP transistors. From what I understand, I need a certain voltage difference between the base and emmitter to open the transistor. If I would set VCC to 10V I could still use HIGH = 5V. But what can I do if the circuit shall work with an arbitrary voltage VCC between 0-30V?

Thanks for your help.

Your logic needs some research. Your schematic shows a motor, not a capacitor. You show no connections to the Arduino or which arduino you need. I do not understand why you used an H bridge, it looks like you put your hand in the air to see which way the wind is blowing. A much better explanation of your project will help.

If I want a current to flow in either direction through a consumer, I could do that with an H-bridge? So it should not matter too much if the power source is a battery or a capacitor and what kind of consumer it is.

To keep it simple we can stay with the DC Motor shown in the sketch. How can I use 4 I/O pins of an arduino uno to control the motor, if VCC is arbitrary?

You mean a load?
What are you trying to do?
If you put a capacitor where the motor in the picture is, charge it, and then discharge it in the other direction you fry the planet.

To turn off the PNP transistors in that circuit, the voltage on the base has to be higher than Vcc-0.6V. For example, if Vcc = 30V, the PNP base voltage has to be higher than 29.4 V.

Appropriate base resistors are required on all the transistors.

To use that circuit to charge/discharge a capacitor, put a suitable current limiting resistor in series with it.

This makes literally no sense at all.

Why do you need an H-bridge to discharge a capacitor? Just use one transistor to switch on a resistor load.

Why do you need an H-bridge to drive a solenoid? The solenoids I know don’t care about current direction. Only motors and speakers usually need H-bridges, I think.

What are you even trying to do?

What I think @t_guttata is trying to do is control a motor/solenoid (edit) using the H-Bridge.
The source of power for the motor can be between 0 and 30V, possibly using a capacitor as the power source.

Tom… :grinning: :+1: :coffee: :australia:

Usually you’d add an additional 2 npn transistors between the pnp bases and ground.
I think you can only get away with a 4-transistor circuit if the load voltage is the same as the logic voltage. Because you end up with Vcc-Vbe at node (1)…


Thanks, you are absolutely right :slight_smile:

It does not really matter what kind of load, the problem stays the same. I’m looking for a high side switching possibility with transistors / mosfets for a variable power source!


I think you mean this?
(Source: » High-side switching » JeeLabs)

You seem to be missing the point everyone is making which is you CANNOT discharge a capacitor with NO current limiting resistor , which, you have not mentioned at all.
You do not seem to understand that when you short a capacitor , the inrush current is
infinite since there is nothing to limit it. You will blow up the cap.

The resistance of the load (solenoid) will limit the current, but that’s not the point.
I should not have mentioned the capacitor, it just resulted in confusion.

But I think, the high-side switching circuit is what I need. Obviously it’s just one element and I will have to try and then expand the circuit to my needs.

There was NO solenoid in the schematic.
A solenoid not a bidirectional bipolar device
like an actuator. Thus an H-bridge is the wrong device. You should havevl requested a solenoid driver circuit.

Yes, like that. Although 100k seems way too high for the base resistor (and 1k might be too high for the other base resistors. If the Hbridge transistors are typical power transistors, they don’t have a lot of current gain, and you need base currents significantly larger than OutputCurrent/Gain to achieve saturation.

(all reasons why chip-scale H-bridges are so popular.)


Do you need to have control of the direction of current AND magnitude of current flow though the load?
Do you need to have control of JUST the magnitude of current flow though the load?

Tom… :grinning: :+1: :coffee: :australia:

I will try to calculate all the resistors once I know how the circuit should look like.
I only need to control the direction of the current. The magnitude will be set by chosing a capacitor as the power source, charged to a certain voltage between 0-30V.
I might need MOSFETS for the PNPs instead of BJTs. The dissipated heat will be very low, because the power on time will be very low. However, peak current will be in the range of 10-20 A.

What I intend to to is basically implementing an H-Bridge with 4 regular switches (hand switch or relay) with transistors. I need to change current direction and the H-Bridge is the only way I found.

You’ll need the six transistors. Note that the NPNs in the high-side circuit don’t need nearly as high a power rating…

You could also use a DPDT relay:


At what frequency?
What is the overall purpose of this project.
Sounds like a resonance/tesla coil project.
Will you be using just squarewave switching, or modulated PWM to give sinewave response?

Because if you are changing current direction in an inductor, be aware of the phase difference between voltage and current and back EMF of the inductive load.

Tom… :grinning: :+1: :coffee: :australia:

@ westfw

Did not know the DPDT relay (just the regular ones). I did not favor relays because of the sound.


Nothing fancy. I’m new to the arduino world and have not designed any circuits yet (I’m a mechanical engineer). I would like to experiment and learn. I thought I could discharge a capacitor and find the relation between charge (voltage of capacitor) and the angle of rotation of the motor.