Building a PSW inverter from scratch
I went down this rabbit hole when my old modified sine wave inverter fried a variable-speed fridge controller. I wanted clean power, so I designed a proper pure sine wave inverter myself instead of buying another off-the-shelf unit that would probably fail in a year anyway. Here is what I learned along the way. At its core, a pure sine wave inverter takes a DC source—typically a battery bank—and converts it to AC at 50 or 60 Hz with a waveform that matches utility power as closely as possible. The difference from modified sine wave inverters isn't just marketing. It matters for any load with inductive components, motor controllers, or switching power supplies that can get warm and inefficient on chopped square waves. The basic topology runs like this: DC bus feeding an H-bridge of MOSFETs or IGBTs, driven by a PWM signal that gets filtered down to a sine wave through an LC filter. A feedback loop measures the output and adjusts the modulation index to keep the voltage stable under varying loads. That's the short version.
Let me jump into the design process first since that's what people actually need.
The Design Process
Start with your load requirements. I sized mine around 1200 watts continuous with a 3000-watt surge capacity for motor startups. That dictated a 12V DC input, which meant roughly 100 amps at full load. You can go 24V or 48V to cut the current, but then your transformer and wiring specs change and you need a different battery setup. Pick one and commit. Next, figure out your switching frequency. This is where most beginners pick a number out of thin air. Higher switching frequency means smaller filter components. At 8 kHz you need a big inductor and a decent capacitor. At 40 kHz you can shrink the magnetics significantly, but your MOSFET switching losses climb and you need a better gate drive design. I settled on 20 kHz for my build because it was a reasonable middle ground—I had the components on hand and the thermal management stayed manageable with a decent heatsink. Now the H-bridge. For a 1200W inverter at 12V input with a 120VAC output, the DC bus needs to be higher than the peak AC voltage. A 12V battery barely gives you 14V when charged. Through a transformer or a boost stage you need to get to at least 170V peak for 120VAC RMS. I used a push-pull topology with a center-tapped transformer primary because it was simpler to drive than a full-bridge at low voltage high current. Each MOSFET in the push-pull sees the full DC bus voltage across it, so I picked devices rated for at least 200V with comfortable margin. IRF3205s worked fine for my power level.
Get the Full Details
The gate drive is critical. You cannot just hook MOSFET gates straight to a microcontroller pin. You need a proper gate driver IC like an IR2110 or TC4420 to swing the gate fast enough and handle the current. Slow gate transitions mean the MOSFET spends more time in its linear region, which means it gets hot. I burned through two MOSFETs on my first build because I was driving them directly from a GPIO pin. The third attempt with a proper driver circuit and a 10 ohm gate resistor sorted that out. The PWM generation. I used a dsPIC33FJ128GP802 microcontroller because it has built-in PWM modules with complementary output and dead time control. Dead time is non-negotiable. Without it, both switches in a half-bridge can conduct simultaneously during the transition, creating a shoot-through condition that destroys your MOSFETs instantly. I set dead time to about 500 nanoseconds, which gave me a safe margin without killing my effective duty cycle. For the sine table, I generated a 1024-point lookup table at 20 kHz switching. That gives me about 50 cycles per waveform, which is plenty of resolution for a smooth output. The MCU reads from this table and outputs the appropriate PWM duty cycle through the CCP modules. A simple sine lookup with some harmonic injection helps keep the total harmonic distortion under 3 percent, which is the typical threshold for what qualifies as pure sine wave by most standards.
The output filter. This is where the real engineering happens. A second-order LC filter after the PWM stage smooths the high-frequency switching components down to the fundamental sine wave. The cutoff frequency should be well above 60 Hz but well below your switching frequency. I aimed for about 2 kHz cutoff. With a 2 kHz cutoff and a 100uF capacitor, the inductor works out to about 63uH. I wound that on a ferrite toroid core—core selection matters more than you might think. EPCOS N87 material handles the frequency range and power levels without saturating at the currents I was dealing with. Voltage sensing and feedback. A resistive divider on the output feeds back to an ADC input on the MCU. The firmware runs a PI controller that compares the measured RMS voltage against the target and adjusts the modulation index in real time. Under heavy load the voltage sags, the controller boosts the modulation index, and the output stays within tolerance. I tuned the PI constants by hand using a trial-and-error approach on an oscilloscope. Start with a low proportional gain and slowly increase it while watching the step response. If it overshoots and rings, back off. If it's sluggish, bump it up. The integral term eliminates steady-state error but too much of it causes windup and oscillation. I ended up with a P gain around 0.15 and an I gain of about 0.002 for my specific component values.
A problem I ran into and how I fixed it
About three weeks into the build, I connected a small microwave oven as a load test. The inverter ran fine at no load and even with lighter loads, but the moment the microwave kicked in at full power, the output voltage started oscillating at around 120 Hz—exactly twice the line frequency. The PID loop was hunting. What was happening is that the microwave's magnetron and transformer present a very nonlinear load that draws current in pulses near the voltage peaks. The feedback loop was overcompensating, going too far in one direction, then correcting too hard in the other, and settling into a sustained oscillation. The fix was two-part. First, I added a feedforward term that compensates for the known DC bus voltage variation. The microwave was pulling so much current that the 12V battery voltage sagged from 13.8V down to about 12.1V under load. The controller saw the output droop and tried to correct for it, but by the time it reacted, the battery had recovered slightly, and the correction was now excessive. Feeding the DC bus voltage into the control loop let the controller anticipate these variations before they showed up on the output side. Second, I added a low-pass filter to the feedback path with a time constant of about 5 milliseconds. This prevented the controller from reacting to the high-frequency ripple caused by the pulsed current draw. The trade-off is slightly slower transient response, but the output stayed stable and the oscillation disappeared. The microwave ran fine afterward with the THD climbing only to about 4.5 percent, which is still well within acceptable range for that kind of load.

Some things people miss
Protection circuitry is not optional. Overcurrent, overvoltage, undervoltage lockout, and overtemperature all need to be handled. My first design had none of these. On the second revision I added a current sense resistor in the low-side path of each MOSFET with a comparator circuit that shuts down the bridge if current exceeds 1.2 times the rated continuous current. The shutdown is latching and requires a manual reset. That saved a $40 MOSFET module when I accidentally shorted the output terminals during debugging. Undervoltage lockout on the input side is equally important. If your battery drops below about 10.5V on a 12V system, the inverter should shut down rather than try to draw more current to maintain output power. Drawing 120 amps from a 10V battery is a recipe for melted cables and a dead battery. I set the UVLO threshold at 10.8V with about 200mV of hysteresis to prevent chatter near the threshold. The transformer choice deserves more attention than most builders give it. A standard laminated iron transformer will work, but the core losses at the frequencies involved and the magnetizing current can eat into your efficiency significantly. An iron powder core or an amorphous metal core can improve efficiency by several percentage points. For my build I used a custom-wound transformer on an E84 ferrite core with Litz wire for the primary to reduce AC resistance at the switching frequency. The result was about 89 percent efficiency at rated load, which is respectable for a homebuilt unit. Off-the-shelf switch-mode inverters claim 93 to 95 percent, but those use expensive components and careful layout that are harder to replicate without experience.
PCB layout matters more than you'd expect at these power levels. High di/dt loops—the path from the DC bus capacitor through the high-side switch, the load, and back through the low-side switch—need to be as small and direct as possible. Long traces in this loop create inductance that causes voltage spikes during switching transitions. I learned this the hard way when my oscilloscope probe showed 60-volt spikes on the drain of each MOSFET during turn-off. Reducing the loop area by redesigning the PCB layout dropped those spikes to about 15 volts, which removed the need for snubber circuits on the MOSFETs entirely.
Efficiency and heat
Let's talk numbers since that's what actually matters in practice. At no load, my inverter draws about 1.2 watts from the battery just for the control circuitry and gate drivers. That's acceptable for standby operation but if you're running this off solar batteries, even that adds up over weeks. The gate drive power scales with switching frequency, so running at 10 kHz instead of 20 kHz would cut that standby draw roughly in half, though you'd need larger filter components. At full 1200W output, total losses break down roughly like this: MOSFET conduction losses about 35W, MOSFET switching losses about 25W, transformer copper losses about 40W, transformer core losses about 15W, and control circuit losses about 5W. Total losses around 120W, giving roughly 91 percent efficiency. The MOSFETs needed a heatsink with about 0.5 degrees C per watt thermal resistance, and the transformer ran warm but not hot to the touch—maybe 55 degrees C at the core surface. Here is the honest part about pure sine wave inverter design: it is not easy to get right on the first try. The control loop tuning alone took me about four evenings of debugging. The first iteration had stability issues at light loads because the PI gains were tuned for full load. At light loads, the same proportional gain made the system too aggressive. I solved this with a gain-scheduling approach where the PI parameters change based on the measured output current. Below 20 percent load, the gains drop by half. It adds a little code complexity but solves the problem cleanly.

Component sourcing
You do not need exotic parts. The MOSFETs, gate drivers, and microcontroller are all available from Digi-Key or Mouser. The transformer is the hardest component to source if you do not wind it yourself. I found a suitable core set on eBay for about $15 and wound the windings myself using enameled copper wire. The primary was 16 AWG in two parallel strands for the push-pull configuration, and the secondary was 24 AWG for the 120VAC output with an interwinding for the center tap. About 200 turns on the secondary side, 7 turns per half on the primary. The turns ratio worked out to approximately 28:1 which is right in the ballpark for stepping 12V up to 120VAC through the PWM switching action. The DC bus capacitors need to handle the ripple current. A single 4700uF electrolytic is not enough. I used four 2200uF capacitors in parallel with low ESR ratings. The ripple current rating of the capacitor bank should exceed the RMS current from the battery, which at full load is over 100 amps. Electrolytic capacitors have limited ripple current ratings, so paralleling several units spreads the current and reduces the temperature rise. I measured about 3 degrees C temperature rise on the capacitor bank at full load, which is well within the rated lifetime.
Testing and validation
Before connecting any real loads, test the inverter with a resistive load first. A bank of power resistors or even a few high-wattage incandescent light bulbs works fine. Measure the output waveform on an oscilloscope and check the THD with a dedicated analyzer or a cheap USB-based one if you have access to one. I used a sound card-based audio analyzer for initial checks, which works surprisingly well for basic THD measurement. For the final validation, a dedicated power analyzer gave me a THD of 2.1 percent at no load and 3.4 percent at full load, both well within the 5 percent threshold for pure sine wave classification. Load transients are the real test. I connected a variable autotransformer with a resistive load and stepped the load from no load to full load in about 50 milliseconds. The output voltage dipped to about 108VAC during the transient before the controller corrected it back to 120VAC within about 20 milliseconds. That recovery time is adequate for most household equipment. Sensitive electronics like medical devices or precision audio gear might need faster transient response, in which case you would need to increase the loop bandwidth or add output capacitance.
When this approach is not the right call
Homebuilding a pure sine wave inverter makes sense if you want to learn the technology, need a specific voltage or frequency that commercial units do not offer, or you have access to components at low cost. It does not make sense if you need 95 percent efficiency, plug-and-play reliability, or certification for grid-tied operation. Commercial units have been optimized over decades and you will not match their efficiency or size without significant investment in components and testing equipment. Also, if you need grid-tied operation with anti-islanding protection, that is a whole separate design space with regulatory requirements that make a homebuilt approach impractical and potentially dangerous. For off-grid battery-powered applications where you just need clean AC power and you have some electronics experience, building your own is totally viable. Budget about $150 to $250 in components for a 1200W unit, plan for two or three evenings of debugging the control loop, and expect to iterate on the PCB and firmware at least once. The final product will work, it will run cool under normal loads, and you will actually understand how it works when something goes wrong three years from now.
