# mata avispas

Flyback high voltage generator (≈12 kV output) controlled by an ESP32‑C3.

Features
- ESP32‑C3 runs as a Wi‑Fi Access Point (AP) so you can connect directly to it.
- A simple web server lets you adjust the PWM frequency/duty cycle that drives the XY‑MOS driver.
- PWM output is generated on a GPIO using the LEDC hardware (high‑resolution, glitch‑free).
- Safety: the PWM can be disabled via the web page.

Hardware notes
- XY‑MOS driver expects a PWM signal (typically 5 V logic) on its INPUT pin.
- Connect ESP32‑C3 GPIO to XY‑MOS INPUT through a level‑shifter if needed (ESP32‑C3 is 3.3 V tolerant, most XY‑MOS accept 3.3 V).
- Flyback transformer secondary should be properly insulated and terminated with a high‑voltage diode/Cockcroft‑Walton multiplier if you need DC.
- Always use proper shielding, grounding, and never touch the output while powered.

How to build
1. Install the ESP32 Arduino core (Boards Manager → esp32 by Espressif Systems).
2. Select "ESP32C3 Dev Module" (or your specific board).
3. Copy this folder to your Arduino sketchbook or open with PlatformIO/VSCode.
4. Compile and upload.
5. After upload, the ESP32‑C3 will start an AP named `MataAvispas_AP` (password `avispas123`).
6. Connect your phone/laptop to that AP, open a browser to `http://192.168.4.1` and adjust PWM.

License: MIT – feel free to adapt.