Arduino 3 Phase Inverter Circuit with Code

Arduino 3 Phase Inverter Circuit with Code

In this post we learn how to make a simple microprocessor Arduino based 3 phase inverter circuit which could be upgraded as per user preference for operating a given 3 phase load.

We have already studied an effective yet simple 3 phase inverter circuit in one of our earlier posts which relied on opamps for generating the 3 phase square wave signals, while the 3 phase push pull signals for driving the mosfets was implemented using specialized 3 phase driver ICs.



In the present concept also we configure the main power stage using these specialized driver ICs, but the 3 phase signal generator is created using an Arduino.

This is because creating an Arduino based 3 phase driver can be extremely complex and is not recommended. Moreover, it is much easier to get off-the-shelf efficient digital ICs for the purpose at much cheaper rates.

Before building the complete inverter circuit, we first need to program the following Arduino code inside an Arduino UNO board, and then proceed with the rest of the details.

Arduino 3 Phase Signal Generator Code

void setup() {
// initialize digital pin 13,12&8 as an output.
pinMode(13, OUTPUT);
pinMode(12,OUTPUT);
pinMode(8,OUTPUT);
}
void loop() {
int var=0;
digitalWrite(13, HIGH);
digitalWrite(8,LOW);
digitalWrite(12,LOW);
delay(6.67);
digitalWrite(12,HIGH);
while(var==0){
delay(3.33);
digitalWrite(13,LOW);
delay(3.33);
digitalWrite(8,HIGH);
delay(3.34);
digitalWrite(12,LOW);
delay(3.33);
digitalWrite(13,HIGH);
delay(3.33);
digitalWrite(8,LOW);
delay(3.34);
digitalWrite(12,HIGH);
}
}

Original Source: http://forum.arduino.cc/index.php?topic=423907.0

The assumed waveform using the above code could be visualized in the following diagram:

3 phase square wave image

Once you have burned and confirmed the above code in your Arduino, it's time to move ahead and configure the remaining circuit stages.

For this you will need the following parts which hopefully you might have already procured:

Parts Needed

IC IR2112 - 3 nos (or any similar 3 phase driver IC)
BC547 transistors - 3 nos
capacitor 10uF/25V and 1uF/25V = 3 nos each
100uF/25V = 1no
1N4148 = 3nos (1N4148 is recommended over 1N4007)

Resistors, all 1/4 watt 5%
100 ohms = 6nos
1K = 6nos

Constructional Details

To begin with, we join the 3 ICs to form the intended 3 phase mosfet driver stage, as given below:

Arduino 3 phase driver

Once the driver board is assembled, the BC547 transistors are hooked up with the HIN and LIN inputs of the IC, and illustrated in the following figure:

arduino 3 phase inverter driver

Once the above designs are constructed, the intended result could be quickly verified by switching ON the system.

Remember, the Arduino needs sometime to boot, therefore it is recommended to switch ON the Arduino first and then switch ON the +12V supply to the driver circuit after a few seconds.

How to Calculate the Bootstrap Capacitors

As we can see in the above figures, a circuit requires a couple of external components near the mosfets in the form of diodes and capacitors. These parts play a crucial role in implementing precise switching of the high side mosfets, and the stages are called bootstrapping network.

Although already given in the diagram, the values of these capacitors could be specifically calculated using the following formula:

full bridge bootstrap capacitor formula

How to Calculate the Bootstrap Diodes

The above equations can be used for calculating the capacitor value for the bootstrap network, for the associated diode we have to consider the following criteria:

The diodes activate or are enabled in the forward bias mode when the high side mosfets are turned on and the potential around them is almost equal to the BUS voltage across the full bridge mosfet voltage lines, therefore the bootstrap diode must be rated enough to be able to block the full applied voltage as specified in the specific diagrams.

This looks fairly easy to understand, however for calculating the current rating, we may have to do some math by multiplying the gate charge magnitude with the switching frequency.

For example if the mosfet IRF450 is used with a switching frequency of 100kHz, the current rating for the diode would be around 12mA. Since this value looks quite minimal and most diodes would have a much higher current rating than this normally, specific attention may not be essential.

Having said that, the over temperature leakage characteristic of the diode can be a crucial to be considered, especially in situations where the bootstrap capacitor may be supposed to store its charge for reasonably sustained amount of time. In such circumstance the diode will need to be a ultra fast recovery type to minimize the magnitude of charge from being forced back from the bootstrap capacitor towards the supply rails of the IC.

Some Safety Tips

As we all know that mosfets in 3 phase inverter circuits can be quite vulnerable to damage due to many risky parameters involved with such concepts, especially when inductive loads are used. I have already discussed this elaborately in one of my earlier articles, and it is strictly advised to refer to this article and implement the mosfets as per the given guidelines.

Using IC IRS2330

The following diagrams are designed to work as a 3 phase PWM controlled inverter from an Arduino.

The first diagram is wired using six NOT gates from the IC 4049. This stage is used for bifurcating the Arduino PWM pulses into complementary high/low logic pairs so that the a bridge 3 phase inverter driver IC IC IRS2330 can be made compatible with the fed PWMs.

The second diagram from above forms the bridge driver stage for the proposed Arduino PWM, 3 phase inverter design, using the IC IRS2330 bridge driver chip.

The inputs of the IC indicated as HIN and LIN accept the dimensioned Arduino PWMs from the NOT gates and drives the output bridge network formed by 6 IGBTs which in turn drive the connected load across their three outputs.

The 1K preset is used for controlling the over current limit of the inverter by suitably adjusting it across the shut down pin of the I, the 1 ohm sensing resistor may be reduced appropriately if the current a relatively higher current is specified for the inverter.

Wrapping it Up:

This concludes our discussion on how to build an Arduino based 3 phase inverter circuit. If you have any further doubts or questions on this subject please feel free to comment and get the replies quickly.

Similar Circuit Ideas

High Current Li-Ion Battery Charger Circuit The post explains a high current Li-Ion battery charger circuit which can be used for charging any high current, high AH rated Li-ion battery from a c...
Calculating Solar Panel, Inverter, Battery Charger The following post explains through calculations how to select and interface the right solar panel, inverter and charger controller combinations for a...
How to Make a 3 Phase VFD Circuit The presented 3 phase VFD circuit (designed by me) can be used for controlling the speed of any three phase brushed AC motor or even a brushless AC mo...
Designing a Grid-Tie Inverter Circuit A grid tie inverter works quite like a conventional inverter, however the power output from such inverter is fed and tied with the AC mains from the u...
Automatic Micro UPS Circuit The following article discusses a simple automatic micro UPS circuit which can be used with modems for acquiring uninterrupted power from a DC source,...

2 thoughts on “Arduino 3 Phase Inverter Circuit with Code”

  1. Good day sir.. Please sir I need your assistance I want to produce a pure sinewave solar inverter that can carry 5 air conditioner of 5horse power for up to 8 to 12 hrs…. Please Sir I need the diagram and the quantities of solar panels with the watts and the batteries with the current ratings….. Thanks sir and God bless you

Leave a Comment