# How to build an H-bridge using MOSFETs? [duplicate]

I want to reverse the polarity of my current source, which is a capacitor in this case, in the middle of discharging phase. Also the capacitor bank is being discharged through a coil to make a short time electromagnet. What I want is to reverse the polarity of that magnet in middle of discharge. How can I achieve this using MOSFETs or other fast switching components?

Below is the single polarity simple circuit. Also I'm using polarity sensitive capacitors in my capacitor bank.

I know that H-bridge would be the component in this situation, but I'd like to build my own "H-bridge" using n- and p-type MOSFETs to handle these high currents.

simulate this circuit – Schematic created using CircuitLab

• What voltage are you charging the capacitor to? At what point in the 'middle of discharging phase' do you want it to switch? What is the resistance of your electromagnet? What is the purpose of the 1N4148 diode? Oct 2, 2014 at 5:28
• @BruceAbbott I have an incoming low voltage signal to indicate when switching is required. Diode is there just to protect the polarity sensitive capacitor from being damaged after the electric field collapses when capacitor runs out of electricity. Oct 2, 2014 at 5:32
• It is more likley that the coil will generate enough volatge to kill the diode. You will need some path for the coil current to dissipate the energy stored in the coil. Oct 2, 2014 at 7:55
• As for your main question: have you considered a H bridge chip? a DPDT relay? Oct 2, 2014 at 7:55
• You need some serious [high voltage diode based] clamps which will shunt (redirect) the current and voltage during the inductive voltage spike, while keeping it hopefully as close to the intended voltage level as possible Oct 2, 2014 at 11:22

Here's a basic MOSFET H-bridge:

simulate this circuit – Schematic created using CircuitLab

It's more common for L1 to be a motor, but as far as the H-bridge is concerned, an inductor is the same. A motor is just an inductor that happens to produce mechanical motion.

There are many ways you might drive these MOSFETs. Search for H-bridge drivers at your favorite electronics supplier: they are commodity components. Proper selection is not a trivial topic. I suggest:

If switching speed is not critical, you may be able to the MOSFETs directly with a microcontroller. Also you could consider a discrete driver.

Note that the diodes drawn need not actually be diodes, they can be the inherent body diode of the MOSFETs if your design parameters allow. There will be current in the diodes only transiently as the H-bridge is changing states, so depending on how fast the switching is, and what the current in that time is, you may remain within the MOSFET's operating parameters. Read the datasheet.

The rate at which you can reverse the current in L1 is limited by the inductance and the voltage you can apply to it (in this case, determined by C1). This is a fundametal property of inductors:

$$v(t) = L \frac{\mathrm di}{\mathrm dt}$$

It follows that if you want to reverse the current very quickly, you must minimize inductance and maximize voltage.

Also bear in mind that when you change directions on the H-bridge, the inductor will reverse the direction of current in the capacitor and charge it. This will continue until the current has decreased to 0, at which point the capacitor will start discharging and current will start flowing in the opposite direction.

• What do you think about adding two zener diodes to short out the voltage spike during switching? Also my capacitors are polarity dependent (electrolytic) so the spike coming back to the capacitor charging it with wrong polarity wouldn't be good. Oct 4, 2014 at 9:47
• Also is the current coming from c1 to the coil in this schematic? Oct 4, 2014 at 9:47
• @Theamateurprogrammer, the diodes in the schematic already clamp the voltage to within 0.65V of the supply rails. Zener diodes would add nothing. Also, the voltage polarity is the significant thing on electrolytic capacitors. When you switch the H-bridge, the voltage polarity remains the same. The direction of current reverses. That's not a problem: it's no different than how capacitors are normally charged. Oct 4, 2014 at 13:29