The H-bridge operation of Inverter is what I am writing about in this note. H-bridge are used for driving motors in both the direction and in case of Inverters, H-bridge is used to control the energy flow through the transformer primary such that sinusoidal AC waveform is generated in the secondary. In many cases the Arduino output current driving the H-bridge circuit may not be sufficient. In that case one can use the IR2210 mosfet driver IC or IR2104 mosfet driver IC.
The following shows circuit diagram of Inverter designed with H-bridge driven by Arduino.
The H-bridge is made up of two P-channel IRF9540 Q1 and Q2 mosfets and two N-channel IRF540 Q3 and Q4 mosfets. The gates of the Q1 and Q3 are connected to the drain of BJT transistor 2N2222 Q5, similarly the gates of Q2 and Q4 are connected to the drain of the BJT transistor 2N2222 Q6.
The bases of the BJT transistors Q5 and Q6 are connected to Arduino pins 10 and 9 respectively. When 10 is High then 9 is Low and after 20ms 10 is low and 9 becomes high. So they alternatively are high and low at the frequency of 50Hz, which is 20ms delay. This alternating pulses from the pin 9 and 10 to the BJT transistors turns them also alternatively on and off.
Consider that pin 10 is high and pin 9 is low, then in this case the BJT transistor Q5 is turned on and BJT transistor Q6 is turned off. Since Q5 is ON, the gates of both mosfet transistors Q1 and Q3 are grounded and so p-channel Q1 mosfet is turned on(P-channel are active low) and n-channel Q3 mosfet is turned off. Similarly, on the other half, since Q6 is off, the p-channel transistor Q2 mosfet is turned off and the n-channel transistor Q4 mosfet is turned on. So overall, when signal at pin 10 is high and signal at pin 9 is low, then in the H-bridge circuit, transistor Q1 and Q4 are turned on, while the transistors Q2 and Q3 are turned off. There there will current flowing from the 12V through transistor Q1 into the primary winding of the transformer then into the transistor Q3 and back to the -ve terminal of the 12V battery. This is illustrated in the circuit diagram below.
After 20ms, for 50Hz AC signal, pin 10 is low and pin 9 is high. So in this case, similarly to the above explained operation, the H-bridge transistors Q2 and Q4 are turned on and Q1,Q3 are off. The current signal flow in this case is shown in the circuit diagram below.
So in this note I described how the mosfets of the h-bridge circuit in inverters works. An alternative of H-bridge circuit for inverter design is to use push-pull circuit for inverter design which is illustrated in Arduino Inverter Circuit.
The Arduino program used in this demonstration is below.
//Code for Arduino Inverter
//www.ee-diary.com
const int x = 10;
const int y = 9;
void setup(){
pinMode(x, OUTPUT);
pinMode(y, OUTPUT);
}
void loop(){
digitalWrite(x, HIGH);
digitalWrite(y, LOW);
delay(20);
digitalWrite(x, LOW);
digitalWrite(y, HIGH);
delay(20);
}
I have posted a video which demonstrates how this inverter h-bridge circuit works.