after burning 1 of my remaining 2 mosfets attempting Allan's circuit, I had to try something more familiar. Similar to my original circuit, I am using a digital out from the arduino to drive a 4n25 opto. The transistor side of the opto provides 12v to the gate. The voltage divider is done as in Allan's circuit. The arduino has a dedicated power supply that is not directly connected to the grounds of the other( there is a common ground when the mosfet is on, as in Allan's circuit).
so right now I am testing a pwm signal from the arduino with a fan as a test load, while reading the voltage.
the whole circuit seems to be functioning exactly as I intended, however, as soon I connect the usb to the computer, I loose my PWM and the mosfet goes fully ON. I have tried changing the cables, and tested the cables, all appears to be fine(i can program the arduino and read/write to a hard drive with the cables in question).
To make things even stranger, the output pin from the ardunio remains @ its PWM voltage...and the same can be said about the transistor side of the opto (ie gate voltage).
also worth noting, disconnecting the dedicated arduino power supply and running from USB only makes the same problems.
also, if I disconnect the ground from the voltage divider -->arduino ground....the PWM comes back, but then the ADC values just float all over the place.
and fyi, I do need the usb for control during normal operation.
please don't ask me to draw the circuit, I can't stand fritzing and that's all I have...I think the verbal description ought to be enough.