• Skip to main content
  • Skip to primary sidebar

Homemade Circuit Projects

Need circuit help? Post them in the comments! I've answered over 50,000!

Blog | Categories | About | Contact | Calculators-online
You are here: Home / Electronics Theory / Sine wave PWM (SPWM) Circuit using Opamp

Sine wave PWM (SPWM) Circuit using Opamp

Last Updated on September 7, 2021 by Swagatam 136 Comments

SPWM refers to Sine Wave Pulse Width Modulation which is a pulse width arrangement in which the pulses are narrower at the start, which gradually get broader at the middle, and then narrower again of the end of the arrangement. This set of pulses when implemented in an inductive application like inverter enables the output to be transformed into an exponential sinewaveform, which may look exactly identical to an conventional grid sine waveform,

Table of Contents
  • Simulating a Sine waveform is not Easy
  • What is SPWM
  • Using two Input Signals
  • Creating an SPWM with Triangle wave and Sinewave
  • Opamp Processioning the SPWM
  • Circuit Diagram

Acquiring a sinewave output from an inverter can be the most crucial and the most advantageous feature for rendering maximum efficiency to the unit, in terms of its output quality. I have explained how to make sine wave PWM or an SPWM using an opamp.

Simulating a Sine waveform is not Easy

Achieving a sinusoidal wave output could be quite complex and may not be recommended for inverters, because electronic devices normally do not "like" exponentially rising currents or voltages. Since inverters are essentially made by using solid state electronic devices, a sinusoidal waveform is normally avoided.

Electronic power devices when forced to operate with sinusoidal waves produce inefficient results since the devices tend to get relatively more hot compared to when operated with square wave pulses.

So the next best option for implementing a sine wave from an inverter is by the way of PWM, which stands for Pulse width modulation.

PWM is an advanced way (digital variant) of putting forth an exponential waveform through a proportionately varying square pulse widths whose net value is calculated to exactly match the net value of a selected exponential waveform, here "net" value refers to the RMS value. Therefore a perfectly calculated PWM with reference to a given sine wave can be used as a perfect equivalent for replicating the given sinewave.

Furthermore, PWMs become ideally compatible with electronic power devices (mosfets, BJTs, IGBTS) and allow these to run with minimal heat dissipation.

However generating or making sinewave PWM waveforms is normally considered complex, and that's because the implementation is not easy to simulate in ones mind.

Even I had to go through some brainstorming before I could correctly simulate the function through some intense thinking and imagining.

What is SPWM

As explained at the beginning of the post, an SPWM is a digital equivalent of an analogue sine waveform. An analogue sine waveform has a gradually increasing waveform at the start, which grows maximum at the center of its travel, and then it gradually descends downwards towards the zero mark. In the same way an SPWM has thinner pulses at the start of the waveform, the thickness or the width of the pulses gradually get bigger and maximum at the center of the travel, and then the pulses slowly grow thinner towards the end of the waveform.

relation between SPWM and analogue sine wave

When this SPWM consisting of growing and shrinking pulse widths is applied to a transformer, the output from the transformer transforms this SPWM into an analogue equivalent which closely replicates an analogue sine waveform.

The easiest known method of generating a sinewaver PWM (SPWM), is by feeding a couple of exponentially varying signals to the input of an opamp for the required processing. Among the two input signals one needs to be much higher in its frequency compared to the other.

The IC 555 can also be used effectively for generating sine equivalent PWMs, by incorporating its built-in opamps and an R/C triangle ramp generator circuit.

The following discussion will help you to understand the entire procedure.

New hobbyists and even the professionals will now find it quite easy to understand regarding how sine wave PWMs (SPWM) are implemented by processing a couple of signals by using an opamp, let's figure it out with the help of the following diagram, and simulation.

Using two Input Signals

As mentioned in the previous section, the procedure involves the feeding of two exponentially varying waveforms to the inputs of an opamp.

Here the opamp is configured as a typical comparator, so we can assume that the opamp will instantly start comparing the instantaneous voltage levels of these two superimposed waveforms the moment these appear or are applied to its inputs.


In order to enable the opamp to implement the required sine wave PWMs correctly at its output, it's imperative that one of the signals has a much higher frequency than the other. The slower frequency here is the one which is supposed to be the sample sine wave which needs to be imitated (replicated) by the PWMs.

Ideally, both the signals should be sinewaves (one with a higher frequency than the other), however the same can be also implemented by incorporating a triangle wave (high frequency) and a sine wave (sample wave with low frequency).

As can be seen in the following images, the high frequency signal is invariably applied to the inverting input (-) of the opamp, while the other slower sinewave is applied to the non-inverting (+) input of the opamp.

In a worst case scenario, both the signals can be triangle waves with the recommended frequency levels as discussed above. Still that would help you to achieve a reasonably good sinewave equivalent PWM.

The signal with the higher frequency is termed as the carrier signal, while the slower sample signal is called the modulating input.

pwm2Bgeneration

Creating an SPWM with Triangle wave and Sinewave

Referring to the figure above, we can clearly visualize through plotted points the various coinciding or overlapping voltage points of the two signals over a given time span.

The horizontal axis signifies the time period of the waveform, while the vertical axis indicates the voltage levels of the two simultaneously running, superimposed waveform.

The figure informs us regarding how the opamp would respond to the shown coinciding instantaneous voltage levels of the two waveforms and produce a correspondingly varying sine wave PWM at its output.

The procedure is actually not so difficult to imagine. The opamp simply compares the fast triangle wave's varying instantaneous voltage levels with the relatively much slower sinewave (this can also be a triangle wave), and checks the instances during which the triangle waveform voltage may be lower than the sine wave voltage and responds by instantly creating high logic at its outputs.

This is sustained as long as the triangle wave potential continues to be below the sine wave potential, and the moment the sine wave potential is detected to be lower than the instantaneous triangle wave potential, the outputs reverts with a low and sustains until the situation reverts.

This continuous comparison of the instantaneous potential levels of the two superimposed waveforms over the two inputs of the opamps results in the creating of the correspondingly varying PWMs which may be exactly the replication of the sine waveform applied on the non-inverting input of the opamp.

Opamp Processioning the SPWM

The following image shows the slo-mo simulation of the above operation:

output AXjMBP 2

Here we can witness the above explanation being implemented practically, and this is quite how the opamp would be executing the same (although at a much fater rate, in ms).

The upper figure shows a slightly more accurate SPWM depiction than the second scrolling diagram, this is because in the first figure I had the comfort of the graph layout in the background whereas in the second simulated diagram I had to plot the same without the help of the graph coordinates, therefore I might have missed a few of the coinciding points and therefore the outputs looks a little inaccurate compared to the first one.

Nevertheless, the operation is quite evident and distinctly brings out how an opamp is supposed to process a PWM sine wave by comparing two simultaneously varying signals at its inputs as explained in the previous sections.

Actually an opamp would process the sine wave PWMs much more accurately than the above shown simulation, may be  a 100 times better, producing a extremely uniform and well dimensioned PWMs corresponding to the fed sample. sinewave.

Circuit Diagram

SPWM

You'll also like:

  • 1.  How Logic Gates Work
  • 2.  How RC Circuits Work
  • 3.  MOSFETs – Enhancement-Type, Depletion-Type
  • 4.  How Buck Converters Work
  • 5.  What are the Different Types of Transformers? Explained
  • 6.  How Transformers Work

About Swagatam

I am an electronics engineer with over 15 years of hands-on experience. I am passionate about inventing, designing electronic circuits and PCBs, and helping hobbyists bring their projects to life. That is why I founded homemade-circuits.com, a website where I share innovative circuit ideas and tutorials. Have a circuit related question? Leave a comment.... I guarantee a reply!

Previous Post: « Automatic Sliding Gate Controller Circuit
Next Post: Simple Scrolling RGB LED Circuit »

Reader Interactions

Comments

  1. Joseph says

    October 23, 2023 at 10:39 pm

    Sir, my question is where is pin5 and pin 9 of the ic 556 will be connected?
    Thanks

    Reply
    • Swagatam says

      October 24, 2023 at 6:38 am

      Joseph, pin#5 and pin#9 can remain unconnected or open.

      Reply
      • Joseph says

        October 29, 2023 at 7:21 am

        Thank you sir, I now understand

        Reply
  2. Herilala says

    October 1, 2023 at 9:06 pm

    Merci beaucoup mille fois pour l’amour de t’aider les autres.

    Reply
    • Swagatam says

      October 2, 2023 at 7:43 am

      You are welcome!

      Reply
  3. Fermaz says

    September 24, 2023 at 1:05 pm

    Hi dear friend. I need a 115 volt ac power supply with variable frequency that i can change the frequency from 10 to 500 Hrz..
    I have a 24V DC 5A power supply and a 240V AC 50Hz power supply, please help me to design and build this circuit. Thank you. Email me the circuit help me to design

    Reply
    • Swagatam says

      September 24, 2023 at 1:37 pm

      Hi Fermaz, You can try the circuit design shown below. You will need a small transformer for converting the DC into AC:

      " rel="ugc">comment image

      Reply
  4. Erasmus says

    June 11, 2023 at 11:52 pm

    I really appreciate everything you have been doing here. Pls sir, my major problem now is linking/connecting the circuits/diagrams of both techniques with the other parts of the inverter. Can you pls assist me with that?

    Reply
    • Swagatam says

      June 12, 2023 at 11:53 am

      Which circuit do you want to link?

      Reply
      • Erasmus says

        June 13, 2023 at 3:09 am

        I got a clearer picture after reading through your article titled” 3 high power sinewave inverter”. You’re the best. much love for showing us this love.
        Can you pls present a transformerless and a transformer base sine wave inverter circuit for a solar powered inverters that can also charge the battery bank. Best regard.

        Reply
        • Swagatam says

          June 13, 2023 at 9:02 am

          Thank you very much, actually I already have all those circuits posted in this blog. You just have to search them using the search box above, you will be able to find them.

          Reply
          • Erasmus says

            June 14, 2023 at 8:13 am

            I have read through some related articles of yours and I have these few questions to ask: 1. How can I incorporate the solar charge controller in your article titled “solar charge controller for 100Ah battery” into the upgraded spwm circuit in your article titled “3 high power SG3525 pure sinewave inverter circuit”?
            2. How can I upgrade the charge controller to work efficiently with a higher short circuit amps eg. 80amps, 12 to 15 high powered solar panels of eg. 600w, 45v connected in series or parallel. I.e, improving the total input solar array wattage, voltage and amperage.

            Reply
            • Swagatam says

              June 14, 2023 at 12:04 pm

              You will have to connect the charger output across the battery terminals through a 2-way switch so that you are able to keep the inverter switched OFF while your battery is charging and switch ON the inverter when the battery is fully charged.

              Reply
              • Erasmus says

                June 14, 2023 at 1:15 pm

                I apologize for too the much questions. Pls to be cleared with this statement, can you also let me have a rough sketch of what you mean by the above statement?

                Reply
                • Swagatam says

                  June 14, 2023 at 1:31 pm

                  In the circuit shown in the following article, you can connect the “LOAD” terminals across the inverter battery terminals, and allow the battery to charge. While the inverter battery is charging do not switch ON the inverter, keep it switched OFF. Once the battery is fully charged then you can switch ON the inverter.

                  https://www.homemade-circuits.com/solar-charge-controller-for-100-ah-battery/

                  Reply
          • Erasmus says

            June 14, 2023 at 8:48 am

            Is it correct to connect the main output of the charge controller (load) to the main output of the SG3525 waveform converter?

            Reply
  5. Ifeanyichukwu says

    May 19, 2023 at 7:53 pm

    Mr swag thanks for your innovative post I tried out this circuit it worked out fine high pulses set at 405hz and low from Osc output I got a non flickering wattage at 51.2hz frequency but are there any other other options for spwm like with transistors or other components

    Reply
    • Swagatam says

      May 20, 2023 at 9:01 am

      Thank you Ifeanyichukwu,
      An opamp circuit is much easier to build, if transistors were used, it would require at least 20 transistors to replicate the function, so it is not a feasible idea.

      Reply
  6. jboy says

    April 24, 2023 at 10:49 pm

    The out put of the spwm is showing 400Hz instead of 50Hz why and how can that be corrected

    Reply
    • Swagatam says

      April 25, 2023 at 8:43 am

      The SPWM will not be 50 Hz it will be equal to the fast triangle wave frequency

      Reply
      • jboy says

        April 25, 2023 at 12:39 pm

        How do I converter it back to 50Hz

        Reply
        • Swagatam says

          April 25, 2023 at 1:06 pm

          When to integrate the SWPM with an inverter with an output capacitor, the frequency will finally become 50 Hz.

          Reply
          • jboy says

            April 25, 2023 at 3:16 pm

            Sir I also noticed that the duty cycle is not 50% kindly explain how to get 50% duty cycle and also how to get 50Hz frequency because I want to use it on H-bridge inverter of 5000kva

            Reply
            • Swagatam says

              April 25, 2023 at 5:40 pm

              Jboy,
              The 50 Hz slow triangle will need to be derived from Ct pin the inverter IC. All inverter ICs will have a Ct pin and Rt pinout. If these Rt and Ct are adjusted for 50% duty cycle and 50Hz frequency then the output of the op amp will generate sets of 50Hz SPWMs, with each SPWM set having 300Hz or 400Hz frequency.
              These two sets of 300/400Hz SPWMs will chop the external mosfets gates at the rate of 50 Hz each to generate a 50 Hertz alternating AC cycles at the output of the transformer. But still these 50 HZ AC cycles will be composed of 300/400 Hz SPWM frequencies which will need to be eliminated by adding a 3uF/400V filter capacitor at the output of the transformer.
              For more information you can go thrugh the following article:

              https://www.homemade-circuits.com/sg3525-pure-sinewave-inverter-circuit/

              Reply
              • jboy says

                April 25, 2023 at 7:09 pm

                Good explanation but the example you gave is half bridge inverter I have sg3524 which I I use an rc filter to get 50Hz triangular wave and the 400Hz triangular wave I generated with NE555 timer and also did an RC network to get the triangular wave now the two out puts are showing 400Hz but some of the pulse are in phase not completely out of phase with the upper frequency and I freed it to ir2110 gate driver IC the out put from Ir2110 is not stable and one phase is oscillating while the other phase is not please I want to use it to drive the inverter in H-bridge mode I direction on how to achieve that.

                Reply
                • Swagatam says

                  April 26, 2023 at 8:52 am

                  Please see the second diagram from the following article. It shows how to configure an SPWM circuit with a full bridge inverter IC:

                  https://www.homemade-circuits.com/5kva-transformerless-inverter-circuit/

                  Reply
  7. Emmanuel Offiong says

    February 14, 2023 at 3:19 am

    Hi sir
    can we make this SPWM circuit to alternate (ie Q and Q”) so that we can just linked the two output to the BJT without thinking of chopping any other existing PWM signals from another oscillator IC.

    Reply
    • Swagatam says

      February 14, 2023 at 9:21 am

      Hi Emmanuel,
      yes that’s possible. I already have a related circuit using Arduino. You can find the circuit in the following link:
      https://www.homemade-circuits.com/arduino-pure-sine-wave-inverter-circuit/

      Reply
      • Emmanuel Offiong says

        February 16, 2023 at 3:11 am

        Hi swagatam
        i know we can achieve that using Arduino but I was talking about how we can alternate this particular SPWM Generator circuit.

        Reply
        • Swagatam says

          February 16, 2023 at 8:58 am

          Without an Arduino, such a circuit can be very big and complex. The chopping concept would be much easier instead. So there are two easy options, either use the chopping concept or use the Arduino, anything else can be unnecessarily a lot more complex.
          The complexity would be because of the synchronization issue of the SPWM for each cycle.

          Reply
          • Emmanuel Offiong says

            February 17, 2023 at 12:37 am

            Alright sir

            Reply
  8. Richard Jombo says

    December 14, 2022 at 1:52 am

    Dear Swagatam
    What will happen if the inverting pin of the opamp is fed with the fast triangle wave and the non inverting is fed with a 50 Hz square wave, will we achieve the same spwm signal at the output of the opamp

    Reply
    • Swagatam says

      December 14, 2022 at 10:46 am

      Hi Richard,
      In that case the output will be reversed. The PWM will start with a broadest pulse and will narrow down towards the center of the waveform.

      Reply
      • Richard Jombo says

        December 14, 2022 at 12:09 pm

        Can such a signal be classed as an spwm or a modified square wave, which is witch sir?

        Reply
        • Swagatam says

          December 14, 2022 at 12:35 pm

          It is SPWM…

          Reply
          • Richard Jombo says

            December 14, 2022 at 4:08 pm

            Thanks for your assistance

            Reply
  9. Eniola says

    December 20, 2021 at 1:24 am

    Thanks a lot for you nippy reply,one more thing sir,must the higher frequency be fixed at 200hz or it must be varied?due to lack of oscilloscope,or at around what frequency must it be set so as to get the sine wave signal?

    Reply
    • Swagatam says

      December 20, 2021 at 8:50 am

      You are welcome Eniola. Without an oscilloscope the SPWM project cannot be accomplished. Yes it must be around 200 Hz otherwise your iron core transformer will start getting hot

      Reply
  10. Eniola says

    December 15, 2021 at 1:16 am

    Hi sir, the above article showed that the inverting pin should be connected to the fast frequency (pin2) while non inverting should be connected to low frequency, but in one of your article I read it was of lm742 opamp, fast frequency was connected to pin2 while slow frequency was connected pin 3.which one is correct ?or it can it connected anyhow?

    Reply
    • Swagatam says

      December 15, 2021 at 11:03 am

      Hi Eniola, the information provided in the above article is the correct one.

      Reply
  11. patrick says

    September 4, 2020 at 4:29 pm

    Hello Sir ;
    I want to build the above spwm,but i am not comfortable with the frequency values i got using the formula; 1.44/((R1+2R2)C. For 1k and 100k i got 3512hz. For 1k and 20k i got 716hz.
    please is the formula and the figures right.What of if i use a variable resistor for any pair of the upper or lower resistors.
    Thank you.

    Reply
    • Swagatam says

      September 4, 2020 at 6:09 pm

      Hello Patrick, you can use any online IC 555 astable calculator software for getting the desired values

      Reply
  12. Paul says

    July 30, 2020 at 3:20 pm

    Hello!

    Can you tell me please which inverter should I use for a vacuum cleaner?
    Modified sine wave or pure sine wave and why?

    Thank you very much!

    Reply
    • Swagatam says

      July 30, 2020 at 5:56 pm

      Hello, both types should work!

      Reply
      • Paul says

        July 30, 2020 at 7:05 pm

        I tried 1400W vacuum cleaner on a modified sine wave inverter with 1000W continuous and max. peak 4000W. It moves, but it has no power in suction. Tried 600W vacuum cleaner and same thing happened. The motor is moving, but it has no power in suction. AC power goes from 223V to 160-170V in load. I’m confused.

        Reply
        • Swagatam says

          July 30, 2020 at 8:45 pm

          It cannot be because of the waveform, it may be due to lack of power from the inverter. The inverter wattage must be much higher than the load wattage, otherwise voltage will drop causing load malfunction

          Reply
  13. Aliyu Babatunde says

    July 19, 2020 at 10:40 pm

    Thanks once again. The title of the circuit was sine wave inverter 250va. However I will be expecting the one using only two 555 timers as promised.

    Reply
    • Swagatam says

      July 20, 2020 at 12:43 pm

      No problem, If I find it I’ll inform you.

      Reply
  14. patrick says

    April 15, 2020 at 12:28 pm

    Please sir
    The above diagram in which two triangles ,one 50hz and the other 200hz are fed to the 556 ic ,is it pwm or spwm,iam confused here.Thank you very much for taking the time to attend to our questions.

    Reply
    • Swagatam says

      April 15, 2020 at 12:50 pm

      It is SPWM, in which the the pulse widths are created with a pattern that simulates a sine wave equivalent.

      Reply
      • satish raju says

        October 11, 2020 at 9:49 pm

        hi can you explain me how to produce high frequency inverter with 50hz output frequency .
        and how to fed the pulses to inverter switches(mosfets).
        and how to design spwm . how many ways to produce spwm.

        thank you .
        regards
        satish.

        Reply
        • Swagatam says

          October 12, 2020 at 12:11 pm

          Hi Satish, you can efer to this artcile for knowing the basic inverter principles:

          How to Design an Inverter – Theory and Tutorial

          for SPWM you can refer to the following article:

          Sine wave PWM (SPWM) Circuit using Opamp

          Reply
          • satish raju says

            October 12, 2020 at 9:16 pm

            Hi thanks you. Good information

            Reply
  15. Daniel says

    January 13, 2020 at 8:48 pm

    Good day Mr swagatam, thanks for the article , I am designing an inverter, I was able to to generate am SPWM using the CCP module of a PIC microcontroller , the signals were well tested to be 50hz.
    My main challenge is that whenever I add a load the output drops drastically from 220VAC pls how can I implement feedback in such a case in hardware or software. Thanks

    Reply
    • Swagatam says

      January 14, 2020 at 1:30 pm

      Daniel, voltage drop can happen due to wrongly matched transformer, battery and load. A Feedback can never correct a voltage drop due to wrong configuration, it can only ensure a constant output as long as the parameters are correctly matched, and the inverter is not overloaded.

      Please read the following article to understand the RMS matching issue

      https://www.homemade-circuits.com/inverter-voltage-drop-issue-how-to-solve/

      Reply
  16. Bernard Tendengu says

    November 15, 2019 at 12:54 pm

    Hi Swag,
    Thank you very much once more for your advice with regard to modified sine wave filtering.I am still a bit confused with regard to the issue of blocks in which case you can increase or decrease the number of filtering capacitors.Is there a formula for determining the number of capacitors or one has to this through a scope.

    Reply
    • Swagatam says

      November 15, 2019 at 2:37 pm

      Thanks Bernard, The calculation is simple, more number of blocks will enable smoother sinewave formation and therefore lower value of filter capacitor will be required for the smoothing. Its just a matter of some trial through an oscilloscope and by optimizing the fast triangle wave frequency.

      Yes scope is definitely required for examining the waveform and the optimization.

      Reply
  17. Manahor says

    November 4, 2019 at 11:58 pm

    Sir I am a student and want to pursue further in electronics sir wanted to know that how can I make a modified sine wave inverter at home please help sir

    Reply
    • Swagatam says

      November 5, 2019 at 11:53 am

      Manahor, you can try the first circuit from this article:

      https://www.homemade-circuits.com/modified-sine-wave-inverter-circuit-2/

      Reply
  18. BERNARD TENDENGU says

    October 30, 2019 at 3:20 pm

    Dear Swag
    In a 250 watt to 5000 watt pulse width modulated inverter self charging, how do you convert the modified sine wave inverter to a pure sine wave at the inverter ac output. Please help out Swag I am stuck.

    Reply
    • Swagatam says

      October 30, 2019 at 4:41 pm

      Dear Bernard, Connect a 4uF/400V capacitor across the output winding of the inverter transformer

      Reply
      • Bernard Tendengu says

        October 31, 2019 at 9:27 am

        Dear Swag,
        Thank you very much.Just one more question, will this capacitor have to be a ceramic or electrolytic one?

        Reply
        • Swagatam says

          October 31, 2019 at 10:30 am

          Dear Bernard, it should be polypropelene (PPC) or metallized polyester (MKT) type

          Reply
          • Bernard Tendengu says

            October 31, 2019 at 5:26 pm

            Dear Swag,
            Thank you very much for the advice.

            Reply
            • Swagatam says

              October 31, 2019 at 6:40 pm

              No problem!

              Reply
        • BERNARD TENDENGU says

          November 14, 2019 at 12:20 pm

          Hi Swag,
          With regard to converting a modified sine wave at the transformer ac output you suggested that I use
          a 4uF/400V metallized polyetser (mkt) capacitor or a polypropelene this was a case for 250 watts to 5000 watts pwm self charging modified sine wave inverter. Is it the same case with other inverters like say, 1000kw,1500 kw, 2000 kw, or its a different case altogether.

          Reply
          • Swagatam says

            November 14, 2019 at 2:59 pm

            Hi Bernard, the capacitor filter size depends on the SPWM structure, it’s frequency and number of blocks in it. Higher number of blocks will require lower filter capacitor value and vice versa. The wattage is not relevant to the size of the capacitor.

            Reply
      • BERNARD TENDENGU says

        October 31, 2019 at 9:56 am

        Dear Swag,

        Sorry for the inconvinience, I did ask a question concerning the type of the 4uf/400 volt capacitor. I did ask whether its ceramic or electrolytic? I later realised that its an AC filter capacitor.

        Reply
        • Swagatam says

          October 31, 2019 at 10:32 am

          No problem Bernard, Actually capacitors are never AC or DC according to me, they are differentiated by their polar or non polar nature and the breakdown limits.

          Reply
          • Bernard Tendengu says

            October 31, 2019 at 1:27 pm

            Dear Swag,
            Thank you very much.

            Reply
            • Swagatam says

              October 31, 2019 at 2:39 pm

              You are welcome Bernard…

              Reply
  19. Faith says

    June 3, 2019 at 10:56 am

    Thank you once more for your assistance so far I have sent you a picture of my last update please sir, what frequency I’m I expecting at the output of the buffer i.e to the mosfet
    The last picture was the one I get when I connect it to the MOSFET from the buffer the inverter came up no noise no heating but the frequency is high is this right?

    Reply
    • Swagatam says

      June 3, 2019 at 12:15 pm

      You will have to synchronize the SPWM with the SG3535 frequency, I have updated the IC 555 diagrams and how to synchronize, please check out the following diagram:

      https://www.homemade-circuits.com/sg3525-pure-sinewave-inverter-circuit/

      Reply
  20. Dayo says

    August 21, 2018 at 7:43 pm

    Is it possible to make spwm with one ic 555 and an opamp. Thanks

    Reply
    • Swagatam says

      August 21, 2018 at 8:06 pm

      No, that may not be possible, but using one 4060 and one opamp may be possible.

      Reply
      • Dayo says

        August 22, 2018 at 7:10 pm

        I didn’t get any circuit for 4060 and opamp. Can I use two 741 ICS for spwm generation

        Reply
        • Swagatam says

          August 23, 2018 at 6:51 am

          2 IC 741 will not work, you will have to use 3.

          Reply
          • Dayo says

            August 23, 2018 at 2:26 pm

            Thank you Engineer Swagtagam, please which one produce bette waveform between 2 555 ic with an opamp and 3 opamps spwm

            Reply
            • Swagatam says

              August 23, 2018 at 5:15 pm

              Both the versions can be used for creating good SPWMs, IC 555 also uses opamps internally for all the processing

              Reply
            • Dayo says

              August 25, 2018 at 3:43 pm

              I tried the 555based spam but the output from the opamp 741 was 2v which was not able to trigger the but stage, but without the spwm the inverter came up, please how can I solve this.

              Reply
              • Swagatam says

                August 25, 2018 at 6:22 pm

                you will strictly need an oscilloscope for the adjustments…

                Reply
            • Dayo says

              August 25, 2018 at 6:42 pm

              I calculated the fixed resistors values and capacitors, to get the frequency, should I incorporate a variable resistors instead of fixed ones.

              Reply
              • Swagatam says

                August 25, 2018 at 7:44 pm

                You can use a variable resistor for experimenting with the frequencies

                Reply
            • Dayo says

              August 26, 2018 at 7:42 pm

              Thank you, I don’t know why the MOSFETs(1 for each side,) were getting hot when the spwm was connected, but no issues when the spwm was not connected but the oscillator was connected directed.

              Reply
              • Swagatam says

                August 27, 2018 at 6:26 am

                try keeping the fast frequency of the SPWM to 350Hz, not more than this. try adding a 1K resistor across gate/source of each mosfet

                Reply
            • Dayo says

              August 29, 2018 at 8:09 pm

              Thanks Swag, I have made the fast frequency to be 350hz, it is not getting hot any more, when I connected the spwm the humming sound from the trafo was not good, I tried to set the preset for the frequency with the sound( which I do easily without the spwm) because my frequency meter is bad presently.

              The sound for modified sine inverter is quiet and cool at average frequency of 50hz, but for the spwm connected, it was harsh and coarse, please any advice.

              Reply
              • Swagatam says

                August 30, 2018 at 9:06 am

                Dayo, It can be difficult for me to troubleshoot without having a practical look at it, and moreover without an oscilloscope it can too difficult to judge the accuracy or issues with an inverter waveform…you will have to get an oscilloscope to diagnose it correctly

                Reply
            • Dayo says

              September 5, 2018 at 11:57 am

              Please Can I use a comparator instead of opamp to process the waveforms

              Reply
              • Swagatam says

                September 5, 2018 at 2:09 pm

                yes you can, just make sure to use a pull up resistor with the output of the comparator

                Reply
            • Dayo says

              September 6, 2018 at 4:21 pm

              Thanks I tried the comparator, I used the fast frequency on pin 2, the output pwm was good , but when connected to the bjt stage , the inverter didn’t come on. I removed the pwm stage, The inverter came up, I then changed the fast frequency to pin 3 , no output from pwm.no variable resistor was use. Please any advice.

              Reply
              • Swagatam says

                September 6, 2018 at 4:52 pm

                Dayo, I am sorry, It seems I have a made a mistake by choosing NPN for the PWM chopping, please replace the lower BC547s with BC557s.

                Connect the emitters with the bases of the buffer transistors, collectors with the ground line and base with the SPWM inputs.

                Can you please tell me where those diagrams are located, I may have to go and correct each one of them…thank you for alerting me regarding the issue.

                Reply
            • Dayo says

              September 6, 2018 at 5:37 pm

              https://www.homemade-circuits.com/sg3525-pure-sinewave-inverter-circuit/.

              Thanks sir

              Reply
              • Swagatam says

                September 6, 2018 at 5:47 pm

                OK great, I have added the warning message under the particular diagram.

                Reply
            • Dayo says

              September 9, 2018 at 9:38 am

              Thanks for the correction, you said for spwm use bc557, what of pwm, is bc547 OK for that.

              Reply
              • Swagatam says

                September 9, 2018 at 5:35 pm

                for normal pwm NPN/PNP both will work, because the PWMs will be uniform with their dimensions, so no specific polarity is essential.

                Reply
            • Dayo says

              September 9, 2018 at 10:22 pm

              Thanks so much Swagtagam, the normal pwm waveforms design is similar to the imported pure sine inverter at night but poor waveforms(your design) during day(solar system). What could cause this.

              The two imported inverters( highly recommended ones) I tested, their waveforms were not perfect sine as government power supply but fairly close to it. And your design was similar to the imported inverter. Thanks for your input and enlightenment.

              Reply
              • Swagatam says

                September 10, 2018 at 8:53 am

                If it’s working with battery and not with solar panel, then you must investigate the voltage and current specifications of the solar panel, something may not be compatible with the inverter giving rise to the issues.

                Reply
            • Dayo says

              September 11, 2018 at 5:25 pm

              Good day Swagatam, how can I improve the waveform of this inverter, even after using Spwm to be like public utility.

              Reply
              • Swagatam says

                September 11, 2018 at 5:42 pm

                Good day Dayo, can you please show me the waveform results that you are seeing? I’ll try to investigate.

                Reply
  21. Uday says

    April 3, 2018 at 7:40 am

    Thank You Swagatham for the detailed explanation,

    How can we implement the 3 phase(120 degrees apart) SPWM circuit, where we can have the freedom of varying the amplitude of reference 3 waves compared to the carrier wave.

    Thanks in advance
    Uday

    Reply
    • Swagatam says

      April 3, 2018 at 1:56 pm

      You are welcome Uday,
      For implementing 3 phase SPWM we can use 3 separate opamps, feed their non-inverting inputs with 3 phase sine carrier waves derived from the respective 3 phase channels, while the inverting inputs could be supplied through a common high frequency triangle waves. The amplitude of these triangle wave could be varied for changing the PWM response accordingly.

      Reply
      • Uday says

        April 5, 2018 at 9:18 am

        Good idea, But how do we ensure the 120degree phase shift between the 3 individual sine waves?
        Also, what if we want to vary the frequency?

        Thanks in advance
        Uday

        Reply
        • Swagatam says

          April 5, 2018 at 9:45 am

          Hi Uday, I was assuming the 3 phase signals are taken from an existing 3-phase supply input.

          If it needs to be from an electronic source then the idea using IC 4035 3-phase generator could be tried. The clock input frequency could be changed to alter the the output 3 phase frequency.

          and to make the square wave output into sine wave we may have to put an RC integrators across the 3 outputs of the circuit.

          Reply
  22. Sherwin Baptista says

    July 21, 2017 at 11:14 am

    Now i wish to know how to go about getting the SPWM 50Hz and 50% Dutycycle from the output pin6 of 741 Opamp,

    What should be the output parameters of the 555 to feed the 741 opamp since i would have to build two of them and then integrate their outputs appropriately?

    Would a buffer transistor be required by chance in case current is too small at the output of pin6 of 741?
    Thanks

    Reply
    • Swagatam says

      July 22, 2017 at 3:12 am

      If the slow triangle waves are set at 50Hz then the SPWMs will shape-up from narrow to broad and vice versa at the 50Hz rate, but it will not alternate…for getting alternating SPWM you will have configure it with another circuit and apply it at the gates of the mosfets or the associated BJTs.

      Reply
      • Aliyu Babatunde says

        July 17, 2020 at 11:05 pm

        Hello swagatam, I once saw a circuit on spwm consisting of a cd4047, two ne555 and a 741 in one of your tutorials. Unfortunately I have been trying to get this circuit but unable. Could it have been removed from the site.

        Reply
        • Swagatam says

          July 18, 2020 at 6:50 am

          Hello Aliyu, here’s the link that you are looking for:

          https://www.homemade-circuits.com/pure-sine-wave-inverter-circuit-using/

          Reply
          • Aliyu says

            July 18, 2020 at 8:11 pm

            Thanks so much for your prompt reply. However, the circuit I was referring to was spwm based. Ne555 was used as the main oscillator circuit for the inverter, while cd4047 in conjunction with another 555 timer was used to feed an 741 opamp to achieve the spwm output for the for circuit

            Reply
            • Swagatam says

              July 19, 2020 at 4:16 pm

              Sorry, I can’t remember which circuit exactly you are referring to, may be it is still present in the website but tracing it out can be difficult without its exact name

              Reply
      • Emmanuel Offiong says

        December 12, 2021 at 1:43 am

        Hi sir
        Please how can one make the SPWM to alternate so that it can be feed into the gates of a MOSFET?

        Reply
        • Swagatam says

          December 12, 2021 at 10:59 am

          Hi Emmanuel, please refer to the 4) design from the following article, it shows how to feed SPWM alternately to the mosfet channels:

          https://www.homemade-circuits.com/simple-ic-555-inverter-circuit/

          Reply
    • Swagatam says

      July 22, 2017 at 3:13 am

      you can implement it with a single opamp and two IC 555 circuits…I'll try to design it if possible and present it soon.

      Reply
    • Sherwin Baptista says

      July 22, 2017 at 8:32 am

      Dear,
      Yes please, I need an alternating SPWM design for my inverter circuit. I would be greatly thankful for that.
      Regards

      Reply
    • Swagatam says

      July 22, 2017 at 4:15 pm

      Hi Sherwin, I'll try to present it soon as a new article.

      Reply
  23. Sherwin Baptista says

    July 21, 2017 at 11:01 am

    Dear,
    When i connected an LRC circuit at the output of 555, i could get perfect triangles on the oscilloscope. So, the LRC circuit at the output works good for getting triangle waves from 555. I have tried this perfectly.

    Reply
    • Swagatam says

      July 22, 2017 at 3:06 am

      you can do that, but as I said perfect triangle wave is not crucial for generating SPWMs

      Reply
  24. Sherwin Baptista says

    July 21, 2017 at 10:49 am

    Dear Sir,
    I tried this circuit but the 555 is not generating perfect triangle waves, on the oscilloscope the waveform seems a bent triangle with curves on the positive and negative peaks of the waveform.

    If we collect the outputs from pins6,2 and GND we are disturbing the the actual waveform processing of the internal comparator which takes effort to generate the square wave. This in turn doesn't provide an output which is stable and the 555 working gets disturbed.

    I think we are disturbing the efficient astable working circuit of 555 by not collecting the output from pin3 and rather taking from other pins.
    I were stuck at this part.

    Reply
    • Swagatam says

      July 22, 2017 at 3:05 am

      Dear Sherwin, that's not true….the triangle wave from a IC 555 pin6/2 is never a perfect wave due to its sudden discharge, and slow charging rate.

      The opamp inputs have high impedance so that can have no impact on the IC 555 pinouts

      By the way perfect triangle waves is not required for creating SPWMs.

      Reply
  25. bhavin patel says

    January 27, 2017 at 3:14 pm

    sir i'm working on multilevel inverter. is it possible to compare sinewave and triangular wave obtained from controller through op amp..???

    Reply
    • Swagatam says

      January 28, 2017 at 4:06 am

      bhavin, it is possible to compare sine and triangle wave for creating SPWM, but SPWM is not used in multilevel inverter concept as far as I have learned.

      You can refer to this example circuit which shows how to create multilevel waveform using a simple circuit

      https://www.homemade-circuits.com/2015/12/simple-5-level-cascaded-sine-wave.html

      Reply
  26. Ainsworth Lynch says

    December 14, 2016 at 2:41 pm

    I understand what ur saying and I'm aware but you still didn't answer what I asked. Yes pin 3 will have a square wave output and I'll use a capacitor across it and gnd to get my triangle wave which if I test with a multimeter I'll get both ac and DC with a similar value, so I am now asking you if it's necessary to add another capacitor which this time will be electrolytic to block the DC output entirely and just have an ac output.

    Hopefully you understand what I mean

    Reply
    • Swagatam says

      December 15, 2016 at 5:40 am

      there's never an AC in DC circuits…it's only a pulsating DC in the form of either square or triangle wave…so a blocking capacitor will be never be required in these circuits. blocking capacitors are required in audio amplifier circuit only, because an audio signal could be an AC.

      adding a capacitor at pin3 to get a triangle wave is unnecessary when you are already getting the same across the timing capacitor of the IC 555.

      Reply
    • Ainsworth Lynch says

      January 28, 2017 at 3:51 pm

      This might sound strange but just to reply to your comment… In the full electronic field even though the name is pulsating DC all signals are classified under analog and digital electronics, isn't pulsating DC an analog signal, something a transformer can use and something you place your meter on ac to read?

      Reply
  27. Ainsworth Lynch says

    December 14, 2016 at 2:56 am

    ok in that case I could use a 1k for r1 and a 500k pot for R2 and a 0.1uf capacitor that way I should have a 50% duty cycle and be able to adjust frequencies between 15hz to about 300hz at atleast 8v output.

    since triangle wave is a analoge wave form do u think I should use a decoupling capacitor at pin 3 to block the dc output or should I leave it as is?

    Reply
    • Swagatam says

      December 14, 2016 at 5:24 am

      pin3 will always give you square waves….triangle waves will need to picked right across the capacitors pins, or from pin6/2 and ground.

      Reply
  28. Swagatam says

    December 12, 2016 at 11:18 am

    you can use the second software from this article to set the frequency to the desired level along with the frequency

    https://www.homemade-circuits.com/p/ic-555-calculator.html

    Reply
  29. Ainsworth Lynch says

    December 12, 2016 at 4:43 am

    Seems ill have to find a reliable triangle wave circuit I made a squarewave generator the minimum was 76hz I assume I could get it lower with a higher value pot than 100k I didnt have any though but I added an rc netwrok to it with a 1k resistor and a 470nf capacitor I got the triangle wave out but I cant read the frequency, so i just assumed its gone too high where I cant read it.

    Reply
  30. Ainsworth Lynch says

    December 11, 2016 at 11:43 am

    Ok I understand that but the other issue was the voltage level being very low on the circuits I found, I mentioned a transistor method which you didn't say anything about or probably you have another method.

    Reply
    • Swagatam says

      December 12, 2016 at 2:00 am

      triangle wave from a 555 IC astable will never be low….it will be around 3/4th of its supply voltage…so if the supply is 12V you an expect the voltage across the 555 capacitor to be around 8V (peak)

      Reply
  31. Ainsworth Lynch says

    December 11, 2016 at 2:58 am

    I found a sinewave generator circuit using the 555 timer, If I am to use that circuit that would be the one that is at about 50hz and then I could use a triangle wave for the 200hz, also the triangle wave generators I see the output voltage is normally low like about 0.5v so I was thinking I could connect pin 3 to the base of a bc547 and then send then send the 5v to 12v going to the supply of the 555 to the collector of the npn transistor its emmiter would be connected to gnd and I could connect the leg of the opamp in between the emmiter and gnd of the bc547.

    Reply
    • Swagatam says

      December 11, 2016 at 8:35 am

      sinewave generator is not strictly required, triangle wave generator will just enough….

      you will need a 555 IC based 50 Hz astable, and another 200Hz astable, and connect these two with the inputs of the opamp….
      simply connect the inputs of the opamp with the positives of the capacitors of the two astable circuits….but make sure that the 200Hz is connected with the (-) of the opamp and 50Hz with the (+) of the opamp.

      also do not forget to connect the grounds of all the 3 circuits in common with the negative supply.

      Reply
  32. Ainsworth Lynch says

    December 10, 2016 at 2:53 pm

    Just thinking would I have to use a sinewave generator to get a sinewave input to the opamp I dont know any regular chips that produce sinewave.

    Reply
  33. alex says

    July 13, 2015 at 11:13 pm

    Thank u Mr Swagatam for ur explanation . Everytime I read ur commentsd I understand this sine wave concept better sir. Now I know what is SWPWM fully. In ur inverter circuit that uses the high frequency SQUARE wave signal produced by the 555 and compared with the triangle wave at pin 7 of the 555 pwm ic what is this concept called sir. Alex

    Reply
    • Swagatam says

      July 14, 2015 at 3:50 am

      Thanks Alex, in the inverter circuit using 555 IC the square are not compared with the triangle, rather the square are used to create triangle waves and these triangle are compared with potential at pin5 of the same IC….the potential at pin5 preferably should be a slow sine wave or a slow triangle wave.

      Reply
      • Chandru Gopi says

        February 16, 2021 at 10:59 am

        Sir, the output of op-amp is only available for positive half cycle, what should be done to produce output in both half cycles?

        Reply
        • Swagatam says

          February 16, 2021 at 2:03 pm

          Chandru, if you use dual supply for the op amp, then the output will have both the cycles, but why do you need both cycles, it is simply not required for any standard application

          Reply

Need Help? Please Leave a Comment! We value your input—Kindly keep it relevant to the above topic! Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Subscribe to New Circuit Ideas

Categories

  • Arduino Projects (87)
  • Audio and Amplifier Projects (132)
  • Automation Projects (17)
  • Automobile Electronics (101)
  • Battery Charger Circuits (83)
  • Datasheets and Components (104)
  • Electronics Theory (143)
  • Free Energy (37)
  • Games and Sports Projects (11)
  • Grid and 3-Phase (19)
  • Health related Projects (25)
  • Home Electrical Circuits (12)
  • Indicator Circuits (14)
  • Inverter Circuits (87)
  • Lamps and Lights (142)
  • Meters and Testers (69)
  • Mini Projects (46)
  • Motor Controller (64)
  • Oscillator Circuits (27)
  • Pets and Pests (15)
  • Power Supply Circuits (108)
  • Remote Control Circuits (50)
  • Security and Alarm (64)
  • Sensors and Detectors (101)
  • Solar Controller Circuits (59)
  • Temperature Controllers (42)
  • Timer and Delay Relay (49)
  • Transmitter Circuits (29)
  • Voltage Control and Protection (37)
  • Water Controller (36)

Calculators

  • Battery Back up Time Calculator
  • Capacitance Reactance Calculator
  • IC 555 Astable Calculator
  • IC 555 Monostable Calculator
  • Inductance Calculator
  • LC Resonance Calculator
  • LM317, LM338, LM396 Calculator
  • Ohm’s Law Calculator
  • Phase Angle Phase Shift Calculator
  • Power Factor (PF) Calculator
  • Reactance Calculator
  • Transistor Astable Calculator
  • Transistor base Resistor Calculator
  • Voltage Divider Calculator
  • Wire Current Calculator
  • Zener Diode Calculator
  • Filter Capacitor Calculator
  • Buck Converter Calculator
  • Boost Converter Calculator
  • Solar Panel, Inverter, Battery Calculator
  • Wire Current Calculator
  • SMPS Transformer Calculator
  • IC SG3525, SG3524 Calculator
  • Inverter LC Filter Calculator

People Also Search

555 Circuits | 741 Circuits | LM324 Circuits | LM338 Circuits | 4017 Circuits | Ultrasonic Projects | SMPS Projects | Christmas Projects | MOSFETs | Radio Circuits | Laser Circuits | PIR Projects |

Recent Comments

  • Swagatam on EGS002 Datasheet, Circuit Diagram Explained
  • Swagatam on How to Make IC LM339 Circuits
  • Swagatam on How to Make Dog Barking Preventer Circuit using High Frequency Deterrence
  • Swagatam on How to Buy and Use RF Remote Control Modules – Control Any Electrical Gadget Remotely
  • Swagatam on How to Generate PWM Using IC 555 (2 Methods Explored)

Company

  • Privacy Policy
  • Cookie Policy
  • About Me
  • Contact
  • Disclaimer
  • Copyright
  • Videos
  • Sitemap

Social Profiles

  • Twitter
  • YouTube
  • Instagram
  • Pinterest
  • My Facebook-Page
  • Quora
  • Stack Exchange
  • Linkedin
  • © 2025 · Swagatam Innovations