Introduction: Variable Frequency Arduino Generator
Hello everyone, this is project How-ToDo. Since some of you asked to show in detail my variable frequency arduino generator for high voltage power supply, here it is.
Step 1: Circuit
The circuit is very simple, Arduino nano, I2C OLED display 128 to 68 pixels, 3 transistors and three buttons, two of buttons are responsible for frequency adjustment, and the third button turns ON the output signal. It's would be good to add an optical isolation or driver with GDT but I don't have components for that. Primary coil on the transformer contain 5-10 turns with 14 gauge wire, but 20 AWG wire should be enough. Also for this circuit it is necessary to make a gap between the halves of the ferrite core, I simply put a layer of paper tape.
Step 2: Firmware
The frequency is adjustable from 30Hz to 1MHz, and since its based on built-in PWM, the higher the frequency - the greater the steps, at the end it amounts to tens of kHz, but for my purposes in the range of up to 100 kHz it's good enough.
Before uploading Firmware you need to connect these libraries:
I also added power from the battery, it's some sort of power isolation, but it's going to work fine just with LM7805.
Actually there is not much to talk about, hope you like it, see you soon!
Find me on social media:
We have a be nice policy.
Please be positive and constructive.
I only compiled the code for Nano. I get following -
Sketch uses 16320 bytes (53%) of program storage space. Maximum is 30720 bytes.
Global variables use 1607 bytes (78%) of dynamic memory, leaving 441 bytes for local variables. Maximum is 2048 bytes.
Low memory available, stability problems may occur.
Before uploading the code, I would like to know - Will this code have real stability problems?
Sorry, l'm looking forward to make this generator but l'm having problems with the code (Adafruit_SSD1306 library). Could you please Help me somehow?
Height incorrect, please fix Adafruit_SSD1306.h!???
1. uncomment #define SSD1306_128_64
2. comment #define SSD1306_128_32
3. comment #define SSD1306_96_16
In the example ssd1306_128x64_i2c
4. add #define SSD1306_LCDHEIGHT 64
on top of
#if (SSD1306_LCDHEIGHT != 64)
#error("Height incorrect, please fix Adafruit_SSD1306.h!");
the frequency can start from 1Hz???