As an Amazon Associate we earn from qualifying purchases.
A Class M ZVS resonant inverter turns a low DC supply, here 12 V, into a high-frequency AC output of about 55 V. It uses a resonant tank and soft switching, so the transistors turn on when the voltage across them is close to zero. That keeps switching losses low and makes the circuit a good fit for small, efficient power supplies.
This project walks through the whole build: a simulation, the circuit, the microcontroller code that drives the two switches, the measured output waveforms and the hardware prototype.
Video of the project
How a ZVS resonant inverter works
In a normal hard-switched inverter, a transistor turns on or off while it has both voltage across it and current through it. That overlap wastes power as heat, and the loss grows as the switching frequency rises.
A resonant inverter adds an inductor and a capacitor that form a resonant tank. The tank shapes the switch voltage and current so they are not high at the same moment. In zero voltage switching (ZVS), the switch voltage has already fallen to about zero when the transistor turns on.
The main benefits are:
- Lower switching loss, so less heat in the transistors.
- Higher practical switching frequency, which allows smaller inductors and capacitors.
- Less electrical noise, because the edges are softer than in a hard-switched design.
If you want the theory behind these circuits, the article on ZVS and ZCS resonant inverters gives a unified treatment of the whole family.
Simulation
Before building anything, the circuit was simulated. Simulation lets you check that the switches turn on at near-zero voltage and see roughly what output amplitude to expect. It is also much cheaper than replacing a burnt transistor.
The video below shows the simulation running.
Circuit
The circuit takes a 12 V DC input and drives the resonant network with two switches, called s1 and s2 in the code. The resonant network produces the AC output, which the title of this project gives as 55 V AC. The two images below show the circuit diagrams used for the build and the simulation.
When you build a circuit like this, pay attention to these points:
- Tank components: the inductor and capacitor values set the resonant frequency, so use parts with tight tolerances and a suitable voltage rating.
- Switch drive: the switching frequency and duty cycle must match the tank, otherwise ZVS is lost.
- Gate drive: a microcontroller pin alone is rarely enough to drive power MOSFETs properly, so a gate driver stage is usually needed.
- Layout: keep the high-current loops short and use a solid ground connection.
Program (compiler Mikro C)
The two gate signals come from a microcontroller programmed in Mikro C. The code uses a 16 MHz crystal and sets two pins of port E as outputs, one for each switch.
//i have used crystal of 16 MHz
#define s1 LATE.F0
#define s2 LATE.F1
void main()
{
TRISE.F0=0; TRISE.F1=0;
while (1)
{
s2 =0; Delay_us(1);
s1 =1; Delay_us(9);
s1 =0;s2 =1; Delay_us(1);
s2 =1; Delay_us(5);
}}
What the code does
The loop repeats one fixed sequence:
- s2 goes low and the program waits 1 µs. Both switches are now off for a short dead time.
- s1 goes high and stays on for 9 µs.
- s1 goes low and s2 goes high, and s2 stays on for 1 µs plus another 5 µs.
So s1 is on for about 9 µs and s2 for about 6 µs in each cycle, with a 1 µs gap between them. The delays add up to roughly 16 µs, which puts the switching frequency in the tens of kilohertz. Instruction overhead adds a little extra time to each cycle, so check the real frequency on an oscilloscope instead of relying on the delay values.
The second s2 = 1 line is redundant, because s2 is already high at that point. Removing it does not change the logic, only the timing by a fraction of a microsecond.
Software delays are simple and fine for a prototype. If you need accurate or adjustable frequency, a hardware timer or PWM module is a better choice.
Output waveforms
The captures below were taken from the hardware prototype with an oscilloscope. When you check your own build, look at three things:
- whether the switch voltage drops to about zero before the transistor turns on, which confirms ZVS;
- whether the output looks like a clean resonant waveform, not a distorted or clipped one;
- whether the peak amplitude is close to the expected 55 V.
Hardware
The photos below show the working prototype. If you build your own, start with a current-limited 12 V supply and raise the input step by step while watching the waveforms. Resonant circuits can produce much higher voltages than the input, so keep your hands away from the output side while it runs.
Related projects
If you are comparing inverter topologies, a plain H-bridge square wave inverter is the simplest to build, but it switches hard and gives a square output. For a cleaner low-frequency output, see the sine wave inverter using Arduino. If you are interested in soft-switched DC–DC stages, the nonisolated ZVZCS resonant PWM DC–DC converter is a good next read.
Frequently asked questions
What does ZVS mean in a resonant inverter?
ZVS stands for zero voltage switching. The resonant tank brings the voltage across a switch to about zero before the switch turns on, so very little energy is lost in the transition.
Why use a resonant inverter instead of a normal square wave inverter?
A resonant inverter loses less energy in switching and produces less noise at high frequencies. A square wave inverter is simpler, but it switches hard and wastes more power as the frequency goes up.
Can I change the output voltage of this circuit?
The output depends on the input voltage, the tank values and the switching frequency and duty cycle. Changing the timing in the code shifts the operating point, but moving too far from resonance causes the circuit to lose ZVS. Make changes in the simulation first.
Why does the code use microsecond delays?
The delays set the on-time of each switch and the dead time between them. They are easy to write and good enough for a prototype, but a hardware PWM or timer gives more accurate and stable timing.