electroniclovers has posted a breakdown on Hackster.io of how an electric fly swatter turns two AA batteries into an 1,800V zap, without a microcontroller or a driver chip.
The first stage is a self-oscillating transistor circuit. A transformer has three windings: an 8-turn primary, a 1,200-turn secondary, and a feedback winding. Current through the primary induces a voltage in the feedback winding, which switches the transistor on and off. That makes the high-frequency AC that a transformer needs, and the secondary puts out about 450V AC peak.
The second stage is a four-stage Cockcroft-Walton multiplier, built from 1N4007 diodes and 0.1 µF high-voltage capacitors. Each half-cycle charges the next capacitor in the ladder on top of the one before it, so the output across the terminals reaches 1,800V DC. That goes to two staggered metal mesh grids. Air insulates the gap until an insect bridges it and the arc jumps.…