I'm trying to make a controller for a heatbed for my 3d printer, using an arduino with pwm output to switch a transistor which turns a mosfet on/off. I've connected everything up like in the picture, however I'm getting negative spikes on the pin to the arduino, around 10V or so. Any idea why this occurs? Should I add a flyback diode across the headbed terminals, or even across the transistor?
On a second thought, perhaps I should use an optocoupler between the arduino and the circuit as well?
The transistor is a 2n2222, and the mosfet is an irf3205 and the heatbed draws about 5A.
If you were getting -10V on the Arduino pin the Arduino would be dead, or at least that pin would be thoroughly
fried. You are probably measuring the wrong thing or picking up magnetic inductance from poorly laid out power
wiring.
How have you laid out the wiring for the high current path?
MarkT:
If you were getting -10V on the Arduino pin the Arduino would be dead, or at least that pin would be thoroughly
fried. You are probably measuring the wrong thing or picking up magnetic inductance from poorly laid out power
wiring.
How have you laid out the wiring for the high current path?
Where is your decoupling on the 12V supply?
I probed with a scope and there were indeed negative spikes.
The circuit is buildt on a stripboard and that's probably not optimal at all.
I'm using an old computer PSU as supply and I don't have any external decoupling. I will add that and try some more.
Could it be problems with the frequency of the modulation? I'm using pin 5 so the frequency is roughly 1kHz, but I could use a far lower frequency on this project.