PUSH PULL SINE PWM BASED INVERTER USING ARDUINO

Photo of author

By Jackson Taylor

Home » Hardware » PUSH PULL SINE PWM BASED INVERTER USING ARDUINO

As an Amazon Associate we earn from qualifying purchases.

A push-pull inverter with sine PWM (SPWM) control turns a low-voltage DC source, such as a 12 V battery, into AC power. An Arduino generates the switching signals, two MOSFETs drive a center-tapped transformer, and the output is shaped to follow a sine wave rather than a square wave. This page explains how the pieces fit together. The project videos and the file download are further down.

Project videos and download

Two videos show the project, and the download link below gives you the project file.

file download

How a push-pull inverter works

The power stage uses a transformer whose primary winding has a center tap. The center tap connects to the positive battery terminal. Each end of the primary connects to its own MOSFET, and both MOSFET sources go to ground.

Hardware Hack

Stop Buying New Batteries for Your Tech

Electronics are expensive, but their power sources don't have to be. Discover the simple engineering trick to recondition dead batteries and bring your gadgets back to 100% capacity.

Watch the Free Video

The two MOSFETs conduct in turn. When the first one is on, current flows through one half of the primary. When the second one is on, current flows through the other half in the opposite direction. This alternating flux in the core induces an AC voltage on the secondary winding. The turns ratio of the transformer sets the output voltage.

Push-pull is popular for low-voltage inverters because it needs only two switches, and both are referenced to ground. That makes gate driving simpler than in a full bridge. The trade-off is that each MOSFET must withstand roughly twice the supply voltage, plus any spikes from transformer leakage inductance.

What sine PWM adds

A basic inverter switches the MOSFETs at the mains frequency, giving a square or modified square wave. Many loads tolerate this poorly, and it adds a lot of harmonics. Sine PWM switches much faster, and the pulse width changes continuously along a sine curve. Pulses are narrow near the zero crossings and wide near the peaks. After filtering, the average output follows a sine wave.

See also
How Do Cell Phone Jammers Work? The Science of Signal Blocking

If you want the theory behind this, our post on Artificial PWM & Sine Wave covers the idea of building a sine wave from pulses. For a related build, see the sine wave inverter using Arduino on this site.

The role of the Arduino

The Arduino does three jobs in this kind of design:

  • Generates the SPWM pattern. A sine lookup table is stored in memory. A timer interrupt steps through the table and updates the PWM duty cycle at each step.
  • Alternates the half-cycles. During the positive half of the output wave, one MOSFET receives the SPWM signal and the other stays off. For the negative half, the roles swap.
  • Sets the output frequency. The speed at which the table is stepped through fixes the output at 50 Hz or 60 Hz, depending on your region.

The carrier (switching) frequency is set by the timer configuration. On an Uno, pins 9 and 10 are tied to Timer1, which is a common choice for two complementary drive signals. If you want to change the carrier frequency, see our guide to 62.5 kHz PWM on Arduino for how timer settings affect PWM speed.

Main components

  • Arduino board (Uno, Nano or similar) to run the SPWM code.
  • Two N-channel power MOSFETs rated well above the battery voltage and the expected current.
  • Gate driver stage or logic-level MOSFETs. A 5 V Arduino pin may not fully turn on a standard MOSFET, which makes it run hot. A driver improves switching speed too.
  • Center-tapped transformer sized for the load power.
  • DC source, usually a lead-acid or similar battery, with a fuse in the supply line.
  • Output filter, typically an inductor and capacitor, to smooth the high-frequency pulses into a sine wave.
  • Snubber or clamp components to limit voltage spikes across the MOSFETs.

Design points that matter

Never turn both MOSFETs on together

If both switches conduct at once, the two halves of the primary oppose each other and the battery sees a near short circuit through the MOSFETs. Make sure the code never drives both gates high at the same time. A short gap between turning one off and the other on is a sensible precaution.

See also
Nonisolated ZVZCS Resonant PWM DC–DC Converter for High Step-Up and High-Power Applications (IEEE) with inverter

Watch for core saturation

If one half-cycle carries more volt-seconds than the other, the transformer core can drift toward saturation. This causes high current spikes and heat. Keeping the two half-cycles symmetrical in software, and using a transformer rated for the switching frequency, helps avoid it.

Handle voltage spikes

Leakage inductance causes spikes each time a MOSFET turns off. A snubber network or clamp across each switch protects the devices. Keep the high-current wiring short and thick.

Consider feedback

An open-loop design produces an output that rises and falls with battery voltage and load. Adding feedback means scaling down the output with a voltage divider (with proper isolation), reading it on an ADC pin, and adjusting the SPWM amplitude to hold the output steady.

Sustainable Tech

Keep Toxic E-Waste Out of Landfills

Don't throw away your failing laptop, phone, or car batteries. Learn how to recondition them at home in just a few hours. It's better for the planet—and your wallet.

Learn How It Works

Safety

The output side of an inverter like this can reach mains-level voltages, and the battery side can deliver very high current. Test first at low voltage and with a small load such as a lamp. Use a fuse on the battery line and insulate all exposed connections. Do not touch the circuit while it is running. If you are not experienced with mains voltage, get a qualified person to review the build.

Where to go next

Once the basic inverter works, you can power it from a renewable source. One option is to add a charger stage for solar panel battery charging so the battery stays topped up. You can also improve waveform quality with a better output filter, or add overcurrent and low-battery protection in the Arduino code.

FAQ

Why use a push-pull topology instead of a full bridge?

Push-pull needs only two switches that share a ground, so gate drive is simpler. It suits low-voltage battery inverters. A full bridge puts less voltage stress on each switch and does not need a center-tapped transformer, but it needs four switches and more complex drive circuits.

Can an Arduino directly drive the MOSFET gates?

Sometimes, if you use logic-level MOSFETs and switch at modest frequencies. For larger MOSFETs and faster switching, a gate driver is the safer choice because it switches the gates quickly and protects the Arduino pins.

See also
SINE WAVE INVERTER USING ARDUINO

What output frequency should I program?

Use the frequency of your local mains supply, 50 Hz or 60 Hz. This is the rate at which the sine table repeats, not the PWM carrier frequency.

Do I need an output filter?

For a clean sine wave, yes. Without a filter, the output is a train of high-frequency pulses. An LC filter removes most of the switching component and leaves the 50 or 60 Hz sine wave.

Revive Your Dead Electronics

Got a drawer full of dead gadgets or a failing car battery? Instead of paying a premium for replacements, use this simple trick to easily recondition them right from home.

See How It Works