Home » 220V Inverters » Arduino Modified Sine Wave Inverter Circuit
Arduino Modified Sine Wave Inverter Circuit

Arduino Modified Sine Wave Inverter Circuit

In this post we are going to construct a modified sine wave inverter using Arduino. We will explore the methodology of the proposed sine wave inverter and finally, we will take a look at simulated output of this inverter.

By Arduino Guru

Difference Between Squarewave and Modified Squarewave Inverter

Inverters saved us from short term power cuts at home, industries and emergency rooms. The quality of power of delivered by inverters vary depending on what type of inverter is used. Inverters are classified into three types: square wave, modified sine wave and pure sine wave inverters.

A square wave inverter has poor quality output and contains lot of harmonic noise which may not suitable for many electronic gadgets. Its wave form goes up and down peak. But, resistive loads such as incandescent bulbs, heater and some devices which employees SMPS don’t exhibit problem with square wave inverters.

A modified sine wave or modified square wave to be precise can run most of the electronic gadgets without much issue.

The wave form goes peak up and come down to zero volt and stays for some interval and goes negative peak and come back to zero volt and cycle repeats. It has harmonic noise but not as bad as square wave and can be filtered easily. This design is used in most of the inexpensive inverters.

A pure sine wave inverter has most sophisticated design and expensive one. It can run all electronic devices including inductive loads such as motors which have problems in operating with other mentioned designs. It has no harmonics and wave form is smooth sinusoidal.

By now you know the basic difference between sine, modified sine and square wave inverters.

In this project we are constructing an inverter which can deliver output equivalent to sine wave inverter.

The circuit can be understood better by given block diagram below:

The proposed design consists of an Arduino which generates 50Hz constant square wave. An IC 555 chopper circuit generates high frequency pulse.

The actual chopping of these two signals is done by IC 7408, which is AND gate. The mixed signal is fed to gate of MOSFET. The frequency of IC 555 can be varied for adjusting the output voltage by tuning the variable resistor.

Circuit Diagram:

Arduino Modified Sine Wave Inverter Circuit

The constant 50Hz square wave is generated across pin #7 and pin #8 of Arduino. This flip-flop signal is fed to pin #1 and pin #4 of IC 7408. These two pins are of two different AND gates.

The high frequency chopping signal is fed to pin #2 and #5. The AND gate allows only when two inputs are high, since the Arduino frequency output is lower and IC555 higher, we get chopped signal at the corresponding gate output.

The chopped output is fed to MOSFET with a current limiting resistor for limiting the gate capacitor charging rate.  A 12V 15A or higher rated transformer can be used if you need higher wattage output.

A 400V metal oxide varistor is utilized across the output for suppressing initial high voltage surge while turning on the inverter; it could be several hundreds of volts in magnitude.

A 9V regulator is used for arduino as constant voltage source. A 1000uF or higher capacitance can be used at battery input for smooth starting and to protect the inverter from sudden voltage fluctuations.

Chopper circuit:

The chopper circuit is simple variable frequency generator, and the circuit is self-explanatory.
Now let’s see how well the frequency from Arduino is chopped by high frequency generator circuit to achieve sine wave equivalent.

The above simulation describes the output from arduino. It’s a simple and stable 50Hz signal.

The above simulation shows the wave form after chopping the constant 50Hz signal. The width of the chopping ratio can be adjusted by tuning the variable resistor and which also determine the output voltage.

The above chopped signal may not look like sine wave. A real sine wave inverter’s chopped wave form increase and decrease exponentially across x-axis. But begin a simple design the chopping frequency stay constant and good enough to run most of electronic gadgets.

Program for Arduino:

//-------------Program developed by R.Girish-----------//
int out1 = 8;
int out2 = 7;
void setup()
void loop()
//-------------Program developed by R.Girish----------//

For a Full Bridge version you can refer to this design: https://www.homemade-circuits.com/arduino-full-bridge-h-bridge-sinewave-inverter-circuit/


About the Author

I am an electronic engineer (dipIETE ), hobbyist, inventor, schematic/PCB designer, manufacturer. I am also the founder of the website: https://www.homemade-circuits.com/, where I love sharing my innovative circuit ideas and tutorials. If you have any circuit related query, you may interact through comments, I'll be most happy to help!

90 thoughts on “Arduino Modified Sine Wave Inverter Circuit”

  1. Hi sir, do we need to include a feedback from the output of the transformer to the arduino board in order to have a better output voltage regulation on the system while loaded?

    • Hi Reigneth, for this simple design it may not be required. Moreover since the PWM is fixed the output RMS would be also reasonably fixed, unless the load exceeds the maximum rating of the inverter.

    • No it won’t work here, There’s one issue in the above design regarding the use of the IC 7408. All 74XX series ICs work with 5V and output 5V, which may be not sufficient for driving the mosfet. A mosfet will require at least 10 at its gate to function optimally. The same applies for your design also..You can try a replacing your 7406 with CMOS equivalent and check the results

        • I am not sure what you mean by driver here, I cannot suggest until I see your circuit. Normally a mosfet can be driven directly from any oscillator IC as long as the IC is able to produce around 10 to 12V. If you are using a full-bridge mosfet configuration then you might require a special driver ICs.

          • We are connecting 5 V pin on Arduino UNO Board to Mosfet driver IC and then connected the output of it to the gate of the N channel Mosfet IRF540N . As u said that mosfet requires 10-12 volts at Gate for working optimally, can u suggest IC which can provide us above 10-12 volts as Output ?
            ( Presently we are using DM 7406 )

            • I have already suggested you, it is IC4049. connect the output from the Arduino to the input of the IC 4049, connect the Vcc of the 4049 to 12V, and connect the output from the 4049 to the gate of the mosfet

            • 4047 is an oscillator IC, it cannot be used as a buffer…but if you intend to use it as an oscillator for driving the mosfets, then definitely you can go ahead with it….

  2. Hello..
    I want to have a square wave pulse generation on an oscilloscope. I use IRF520N Mosfet and LM7406 Driver for the switching high frequencies. I only use one mosfet along with a driver. I followed the same circuit as yours. What should be the conditions and prerequesites for getting a square wave with no distortion? Presently i am getting distortion at the beginning. I am not able to find the reason. I want a frequency around 60kHz..Please help..

    • At what point are you getting the distortions, if it is at the transformer secondary then that’s normal due to transformer inductive spikes.

      • We are not using transformer. We are two electrodes cathode and anode for machining. We want voltage pulse at high frequencies ( 60KHZ ) on the oscilloscope. The pulses are distorted and are not square wave.We are using DM 7406N IC and IRF540N Mosfet for switching frequencies.

        • If you use a PCB with proper grounding and capacitive filtering then the results will be perfect. The distortions are possibly due to parasitic inductance across the connecting wires. You can check the signal directly across the arduino outputs you may find a better response.

          Alternatively try connecting a 100uF and a 0.1uF capacitors directly across the IC’s Vcc/Vss pinouts and check the response

      • We are designing a Dc pulse power supply. For switching the power at high frequency, presently we are using a mosfet ( IRF540N ) , but there is a distortion in the square wave pulse generated. So we are thinking to use some driver for switching at high frequency .. Please suggest some suitable driver for switching .

        • which oscillator circuit are you using at the moment, I thought you are using the above explained Arduino circuit?? There are some very accurate oscillator circuits such as IC 4047, IC 4060, SG3525, LM567, etc which you can try as driver ICs

          • Sir we are using Oscillator circuit DM 7406 as IC and Arduino UNO as microcontroller . Can we go on with above IC or should we change?

            • Vamsi, instead of an external IC for an oscillator you could try getting the frequency from an Arduino itself, an Arduino would provide better square waves than an external IC circuit according to me.

              However all CMOS based oscillators are supposed to produce perfect square waves, you can try employing capacitors across the supply pins of the IC and see if that helps in improcving the distortions, and make sure all the linked connections are as short as possible.

            • We should vary pulse frequency as well as duty cycle. So can we use microcontroller directly or we should employ any other circuit? Please share if you have any example regarding this.

            • sorry microcontroller is not within my range of expertise so suggesting this might not be possible for me at this moment. However I think controlling frequency and PWM together using a single Arduino should be possible.
              By the way achieving the same may be possible, by using a couple of IC 555, very accurately as shown in the folowing example article


              R1 could be used for frequency control, and the 500 ohm preset for pwm control

            • I had experimented the above circuit discussed with power supply. For only 1 volt, its flowing 0.38 A ..so huge..What can be the fault and the problem? Please help?

            • that’s impossible, such high current will be consumed only if the load is rated with that much current or if the pwm is not working. It is always important to check the stages thoroughly before implementing the final design in order to succeed without issues.

  3. sir if i use l298 to amplify 5v of a modified sine wave from arduino to 12V to feed mosfet will it work,
    and if i use a center tapped transformer …. what should be its rating . 12V-0-12V,,,,,,,, 12amp ,,,,,, is enough?
    i an intended to make a transformer of 350watts……

  4. hello bro…. i have made your circuit in proteus 8. but problem is the output before mosfet is a square wave but the output after mosfet becomes distorted…. why is it so….

  5. Sir i've stringed up the above circuit on the proteus program but the result is not a sine wave but still a square wave, can you tell me using filter value to be a sine wave ?? If on proteus has changed into sine I will realize it please help me… thankyou

    • Zodiak, please check and verify the RMS voltage value and the peak value from the transformer output….if the RMS is around 220V, and the peak is around 310V then the results can be considered OK…

      you won't get a sinusoidal wave for this design.

    • you can try putting a 0.45uF/400V capacitor across the transformer output winding and see if that changes the waveform i your simulation.

  6. Also I'm not able to get any and gate ic.
    I only have not gate chips 4049.

    Could I replicate the and gate action by using 2 npn transistors and some Resistors?

  7. I'm aware that there is none in this circuit but wouldn't it be required
    If I use a 12v battery and a 12v transformer?

  8. Hi,
    According to the given Arduino program it has error in frequency the total time period is 20ms+20ms=40ms

  9. Hi, i tried to simulate this but when i chop my square wave with the high frequency waveform from the 555 timer, i am only chopping either the positive portion or the negative portion. So how do I get the 2nd diagram shown in this page? Do I have to add up both the waveform to get that?

    • Hi, only the positives are chopped, the negatives are at 0V, and therefore are not relevant.

      The last diagram refers to the output from the transformer, where both the half cycles can be seen due to the push pull action at the primary side of the transformer.

  10. Hi kikiloaw,

    Yes it is possible! Different functions must written into single program and one function should not create bugs for another function.


    • i am confuse checking the exact voltage of the battery since the inverter is in load. the battery will eventually drop voltage. i know checking the voltage but no load in present. so how we can do while this inverter is working on load?

    • When pulling high currents from batteries, the voltage should be monitored on-load. As an example, the ideal cutoff point for a 12VDC car battery would probably be about 10 VDC ON LOAD ! Measuring voltage off load doesn't give as accurate an idea of available power with lead/acid batteries (and some other types) because the battery will always try to restore to its nominal voltage or a bit above. Performing some experiments whilst taking measurements of voltage and current should lead to a clear understanding of the best monitoring choices for any given type of battery. Hope this helps.

  11. hi,
    since this is an arduino. we can add more features like checking the battery for low voltage., but the question is., how can we check the battery voltage while the inverter having an high power laod.??

  12. Hi MIR,

    Please share wave form from your simulation.

    The transformer is 12-0-12V if you can't find in your simulator no problem (try similar specification), you have to focus on wave form than output voltage. when you try the circuit practically, you will get correct voltage.

    The chopped wave form shown in the article is from the GATE of the MOSFETs and not from the transformer. Two wave form from both MOSFETs is merged together(in the simulator), this what look like when you practically try on oscilloscope.

    I used "multisim" for simulation which is not arduino oriented, but I have used function generator in place of arduino, I excluded transformer and rest if the circuit is same.

    Don't always trust simulator they give incorrect results some time. When I tried it was giving error in during simulation and the culprit was transformer. The transformer was not optimized well in the software, so it forced me to exclude transformer. If you try it practically I am very sure that it works fine.


  13. Hi M. Swagatam. I think Arduino, alone, is able to generate the modulated signal shown on the 2nd oscilloscope image. No 555, no add. gate. What is your opinion ? Arduino must have one (or more) counter and certainly a prescaler, as many small µ controlers have. Or maybe the freq. is too high ? It doesn't look more than 1kHz. Thx for your huge work and informative site.

    • please explain what exactly you are trying to achieve….the image only shows a mosfet/trafo stage with a square wave output…

    • i did create the circuit above including the chopper and the Arduino compiled with code.,,.
      that image shows the output from the transformer., and i can see is that most likely not a sine-wave., i tried to varied the variable resistor but having same waveform output.,

    • I would suggest you build it practically and then check the output with a scope…because simulation may not be always right.

  14. Hello SWAGATAM . Thanks for another helpful Post, how much wattage can i get with this design and how to design it with a charging circuit for 260AH battery . actually few months ago i have loss my modified sine wave inverter, now i want to make a new one with batter equipment's or if i sent you my old inverter circuit pictures with fault detail's for diagnose it burnt the MOSFET within a day some time it happens after a week i have checked many components and found good

  15. Sir I have a LED light which has 60 LED's in it the converter driving it is all burnt, the sticker on the converter specifies output 3V DC input 220V AC, can you please help me build one from scratch, its a very small circuit with few Resistance total 6 one electrolytic capacitor, 4 diodes and a Polyester PF.

    All is burnt so badly no value can be identified.

Leave a Comment