Mini Inverter - 12 V DC to 240 V AC
A small push-pull inverter I create from scratch in KiCad - schematic, printed circuit board (PCB)
layout, a custom 3D model written in Python, and a full manufacturing file set.
This is a design exercise. The PCB was never sent out to be fabricated; everything here lives in
CAD.

What it does
A 12 V supply is switched back and forth through two MOSFETs into a transformer, which steps the
voltage up to roughly 240 V AC. An IR2153 driver IC generates the switching on its own, with a
trimmer to adjust how fast it runs.
| |
|---|
| Input | 12 V DC |
| Output | ~240 V AC square wave |
| PCB | 62 mm × 35 mm, 2 layers, all through-hole parts |
| Tool | KiCad 10.0.5 |
How I built it
1. Drawing the schematic
I started with the circuit on paper before touching the layout, because the schematic is what
everything downstream is generated from - the parts list, the connections, the board itself.
The design splits into four sections, and I drew them as separate blocks on the sheet rather than one
tangled mess:
- Power in. D1 protects against connecting the battery backwards. C1 (470 µF) is a reservoir that
smooths out the supply, C2 (0.01 µF) handles fast noise. R1 and an LED make a power-on indicator.
- The oscillator. U1, the IR2153, is the only IC on the board, and it generates the switching
signal by itself - no microcontroller.
R2, the RV1 trimmer, and C4 set how fast it runs, and I used a trimmer instead of a fixed resistor
so the frequency could be tuned after assembly.
- The gate drive. R4 and R5 (22 Ω) sit between the driver IC and the MOSFETs to slow the switching
edges slightly, which reduces ringing. R3 and R6 (1 kΩ) hold the MOSFETs off when nothing is
actively driving them.
- The power stage and transformer. Q1 and Q2 each pull one half of the transformer to ground in
turn. That alternating pull is what the transformer converts into AC on the other side.

I filled in the title block properly - project name, date, revision - because a schematic that can't
be identified on its own is a schematic you'll be guessing about later.
2. Choosing footprints
| Part | Footprint |
|---|
| BT1, D2 | 2-pin screw terminal, 2.54 mm |
| T1 | 5-pin screw terminal, 2.54 mm |
| C1, C3 | Radial electrolytic, 6.3 mm and 5.0 mm |
| C2, C4 | Disc ceramic, 3.0 mm |
| D1 | Axial diode, DO-41 |
| D3 | 5 mm LED |
| Q1, Q2 | TO-220, vertical |
| R1-R6 | Axial resistor, 5.08 mm pitch |
| RV1 | ACP CA6 horizontal trimmer |
| U1 | DIP-8 |

3. Building a 3D model that didn't exist
The ACP CA6 trimmer had a footprint in KiCad but no 3D model. My options were to leave a blank space
in the 3D view, substitute a part that looked roughly similar, or build it.
I built it, in CadQuery - a Python library where you describe
a 3D shape in code rather than drawing it. Then I attached it to the footprint and adjusted the
alignment (-5.0 mm on Y, -1.5 mm on Z) until it sat correctly on the board surface instead of
floating above or sinking into it.
This matters more than it sounds. A 3D view with a missing or wrong part is decoration. One where
every part is the real shape and the real size is something you can actually use to check that
components don't collide, that the tall capacitors clear the MOSFETs, and that the terminal blocks
are reachable with a screwdriver.
The terminal block models came from a community CAD library. I'm noting that because a downloaded
model isn't guaranteed to match the part you'd actually buy.



4. Placing the components
Placement is the part that decides how hard the routing will be, so it's worth slowing down for.
What drove my layout:
- Keep signal flow left to right. Power in on the left, oscillator in the middle, power stage and
transformer output on the right. It follows the schematic, which makes the board readable.
- Decoupling capacitors go next to what they're decoupling. C3 sits right beside U1, because a
smoothing capacitor placed far from the IC it serves isn't doing its job properly.
- The two MOSFETs are side by side at the bottom, close to the transformer terminal, since those
connections carry the most current and should be short.
- Connectors face the board edges so wiring goes outward and not across the middle of everything.
- The trimmer stays reachable rather than buried behind taller components, because it's meant to
be adjusted after the board is built.

5. Routing the PCB
87 traces across two layers. I used the front layer for most of it and dropped to the back only where
a connection would otherwise have to cross another one.
There are no vias on this board - the through-hole component pads pass through both layers, so they
double as layer changes. That works for a design this simple, though a denser board would want proper
stitching vias.

6. Copper pours and labeling
I added a ground pour on both layers. Instead of routing every ground connection as an individual
trace, the pour fills the empty space with copper connected to ground, so any ground pin just
attaches to the sheet around it. Fewer traces, less clutter, better return paths.
Then the silkscreen: what the board is, what voltage goes in and comes out, my name, and labels on
the output terminals.

7. Checking it in 3D and exporting
I reviewed the board in the 3D viewer - this is where the CadQuery model earned its keep, since every
component was the correct shape and I could see how the finished thing would actually look.
Then Gerbers and drill files, which are the format PCB fabrication houses actually accept.
Checking my own work
Before calling it finished I ran both of KiCad's built-in checks. The electrical rules check came back clean, and the design rule check reported zero violations and zero unconnected items. As far as the software was concerned, the design was done. Because both checks passing seemed like a thin basis for confidence on a first board, I had Claude review the project files as a second pass. It read the netlist straight out of the .kicad_pcb file - the list of which component pins actually share which connection - rather than looking at the schematic drawing. That turned up two problems neither checker was ever going to catch.
The battery negative wasn't connected to ground. It sat on its own separate connection along with C1 and C2, with only the indicator LED between it and the real ground, pointing the wrong way. Electricity needs a complete loop and there wasn't one, so the board wouldn't have powered up at all. The cause was in the schematic: the lower rail ended at the junction between R1 and the LED instead of carrying on to the ground symbol. On screen it looked connected.
Two resistors were wired to each other instead of to ground. R3 and R6 are supposed to hold the MOSFETs off when nothing is driving them. Wired together with the shared point floating, they weren't holding anything - which matters most at power-up, before the driver IC starts, when both MOSFETs could switch on at once and short the battery. Both were single-wire fixes in the schematic. Pushing the corrections to the board reassigned the affected pins correctly, and DRC then immediately flagged leftover copper still attached to two pins that had moved onto a different connection - six errors from three stale traces. Deleted, refilled the pours, clean.
What I took from it. A clean design rule check means the copper matches the schematic; it doesn't mean the schematic is right. ERC is similar - it checks that pin types are compatible, and both mistakes were resistors joined to diodes, which is legal wherever it happens. DRC caught the leftover copper instantly because that is geometry, which is exactly what it's built for. Neither tool is weak; they just answer narrower questions than I assumed. Reading the netlist rather than trusting the drawing is the check that actually found these, and it's the step I'd add before calling a board finished.


The complete 3D view of the finished PCB is at the top of this README.
⚠ Safety
240 V on exposed terminals with very little spacing around them. Don't build this version with the
transformer connected. The danger is the voltage, not the wattage. If you take it further, fix the
spacing further, fuse the input, and test the low-voltage side with the transformer disconnected.