i'm trying to create a coilgun (see movie) which seems to work ok'ish. it doesnt need to be prefect
the main issue is that i allready broke 2 arduinos. or they still output the sqaure wave but i cant program them anymore. pc doesnt recognize them anymore.
The parts selected for your boost controller are compromising its output abilities.
Where is the 5 volt supply coming from? Please don’t say the Arduino. If you do, there’s your problem. You need supply bypass caps on the input side of the boost inductor and at a minimum, you must do two things before firing the output:
Stop driving the mosfet
Disconnect the capacitors from the boost converter
In this way, you isolate the rather nasty transients from the Arduino supply. You probably need to disconnect the analog input as well although you could do this by moving the measuring circuit upstream such that it is disconnected from the capacitors before firing.
spirit:
for testing everything, the power supply is coming from the Arduino.
but this will be replaced with batteries.
That makes no sense at all and is the likely source of your confusion. The Arduino is not a "power supply". It has no capability whatever to "supply" power.
If you have devices requiring 5 V power, you need to provide a power supply and that power supply can also power the Arduino via the "5V" pin.
You need a substantial decoupling capacitor on the supply to that circuit before the inductor. 1000uF or more electrolytic, probably 10uF ceramic as well for good control of spikes.
You should use a high voltage switching part driven by a proper gate driver, otherwise it will avalanche breakdown and blow up whatever's connected to its gate electrode.
I'd recommend an IGBT for this kind of circuit, with a low-side gate driver chip to drive the gate with
a decent low impedance. My goto chip here is the MIC4422 which is available in DIP and SMT and will
handle enormous back-feed currents from the gate without sweating. Standard IGBTs come in 600V
and 1200V ratings.
The IRF520 is 100V rated, and you say you get to 100V. Presumably its undergoing avalanche breakdown
and may have already destroyed itself.
The choice of inductor is crucial, as is ensuring it never saturates (which really needs current
sensing to do properly).