Modified sine wave inverter using pic microcontroller

Modified sine wave inverter is designed to using pic microcontroller and push pull topology. MOSFET used as a switches in Push pull operated through control circuit in such a way that iron core transformer produced step up battery voltage having modified sine wave form. PIC16F87A microcontroller is used to generated control signal to derive. Control circuit is also discussed at the end of this article. MOSFET driver IR2210 is used as a MOSFET driver to drive both low side mosfet. If you don’t have idea about MOSFET driver IR2110, I recommend you to go through following article to know how to use MOSFET driver IR2110 as a low side MOSFET driver.

How to use Mosfet driver IR2110

IRF3205 MOSFET is used a switch of in push pull topology. Block diagram of Modified sine wave inverter is shown in figure :

block diagram of modified sine wave inverter
block diagram of modified sine wave inverter

Control Circuit :

Control circuit is used to generate signals for MOSFET driver which turn on and turn off MOSFET of push pull high voltage transformer is such a way that Modified sine wave is produced at the output of high voltage step up transformer. PIC16F877A microcontroller is used to generate control signal. AND gate or NOT gate is used to generate two signals for low side MOSFETS in such a way that only one MOSFET on at a time. Remember if both MOSFETs turn on at the same time, short circuit will occur and it will damage your inverter with in few seconds if you have not used protection circuit. Output of control signals and circuit diagram is shown below :

control circuit for modified sine wave inverter
control circuit for modified sine wave inverter
output of control circuit for modified sine wave inverter
output of control circuit for modified sine wave inverter

Push pull circuit and transformer selection:

Push pull topology and iron core transformer is used to in this project to generate modified sine wave. Circuit diagram of push pull transformer is shown below. MOSFET driver IR2210 is used as low side MOSFET drivers to drive to low side MOSFETs. Because to operate MOSFETS fully we need to give gate signal of 10 volt and voltage level of control signals from control circuit is about 5 about which is not enough to drive MOSFETS fully. That’s why MOSFET driver is used to driver low side MOSFETS. Remember I have used only one MSFET with legs of push pull transformer. You should connect MOSFETS in parallel according to power rating of your inverter and also use proper heat sinks for MOSFET.

NOTE: Use separate heat sinks for MOSFETS connect to upper and lower leg of push pull transformer.Otherwise drains of both sides will become short and short circuit will occur. I did this mistake when I started working on power electronics projects and  got serious shok. 😀

you may also like ” Pure sine wave inverter tutorials

Parallel combination of diode and resistor is used to discharge gate capacitance fast to turn off  Mosfet before turning on mosfet connected to other leg of push pull transformer. 12 volt battery is used as a DC source to which we want to convert into modified sine wave AC can also use 24 volt battery bank , but then you have to select push pull transformer which step up voltage from 24/1.414 into 220 volt AC.  Circuit diagram of is shown below :

pusl pull transformer circuit diagram
push pull transformer circuit diagram

Complete circuit diagram and output wave form :

Complete circuit diagram and output wave form of modified sine wave is shown in figure below :

complete circuit diagram of modified sine wave inverter
complete circuit diagram of modified sine wave inverter

Output wave from of  modified sine wave inverter :

output of modified sine wave inverter
output of modified sine wave inverter


Components list :
Integrated Circuits,"U1",IR2112,
Integrated Circuits,"U2",IR2112,
Integrated Circuits,"U3",PIC16F877A,
Integrated Circuits,"U4",AND gate,
Integrated Circuits,"U5",AND gate,
Integrated Circuits,"U6",40106,
crystal 12Mhz
Iron core transformer 12-220 volt


Code is written in Mikro C and 12Mhz crystal is used. I have also explained the code with comments, but if you still have any issue, you can ask me by commenting on this post. Share this article with your friends.

unsigned cnt;

void interrupt() {

if (cnt==3)
PORTC.f2 = 1; // Toggle PORTB LEDs
else if (cnt==17)
PORTC.f2 = 0; // Toggle PORTB LEDs
else if (cnt==20)
PORTB.f1 = ~PORTB.f1; // Toggle PORTB LEDs
TMR1IF_bit = 0; // clear TMR0IF
TMR1H = 0xf6; // Initialize Timer1 register
TMR1L = 0x65;
void main() {

TRISB =0; // PORTB is output

PORTB = 0x00; // Initialize PORTB
T1CON= 0b00000001; // Timer1 settings
TMR1IF_bit = 0; // clear TMR1IF
TMR1H = 0xf6; // Initialize Timer1 register
TMR1L = 0x65;
TMR1IE_bit = 1; // enable Timer1 interrupT
INTCON = 0xc0; // Enable TMRO interrupt
do {

} while(1);

[button-brown url=”” target=” _blank” position=”center”]Buy proteus simulation in 20$[/button-brown]

If you feel you have gained useful knowledge through this article  , share it with your friends on social media. Because I believe the more knowledge you share, the more you will get. 🙂

15 thoughts on “Modified sine wave inverter using pic microcontroller”

  1. Assalam o alaikum bilal bhai when i make a component in proteus and then stimulate it it shows error regarding new component that the new component is not running which fails stimulation. Can you please tell me how to correct this error? In your design you have make many integrated circuit design chips using proteus and you are also getting output from them. Please tell me how to make my own made components function correct in run time stimulation in proteus.

  2. dear sir which programmer is best for pic microcontroller
    what is difference b/w jdm programmer and pickit 2

  3. Hi Malik,
    The micro controller based modify sine wave inverter is very good project which i will like to implement. Please kindly guide me on how i can add feedback control to the project.

  4. a.o.a i have generated a square wave with 5ms on and 15ms off and alternate on other pin and fed it to the mosfets but didnot get the modified sinewave at the output plz advise

  5. I have used gate driver IC IR2110 . Also I have used the gate driver circuit you have given. But I have not gotten the output. Please give me some suggestion regarding the gate driver.


Leave a Comment