Electronic – Help learning from a mistake connecting an oscilloscope

measurementmosfetoscilloscopepwm

I have built this circuit to dim a lamp with a PWM signal. It had an issue where the MOSFET was getting really hot. So I wanted to know what was happening on the gate of the MOSFET.

I turned the PWM signal off and with my multimeter I measured \$V_{GS}\$ as 12V. Now confident that I can look at the waveform with my little USB-oscilloscope (rated to 20V) I connected it. Bammm, the lights go out and I'm left with a bricked oscilloscope and PC that was connected to it.

I'm quite sad about breaking my PC. However I have to know what went wrong so I'm here.


About the problem with the hot MOSFET: It turns out there was a bug in the code making the PWM frequency very high. Making sure it was 200Hz fixed the overheating and the dimmer appears to be working as intended now.


edit:

MOSFET: IXTQ40N50L2

Opto-coupler: ILQ2

Best Answer

The circuit shown is AC mains connected without any kind of isolation. Measuring Vgs using a multimeter is safe because the multimeter is 'floating' with respect to the mains supply.

But a PC is not floating. The PC is normally has the grounded case, meaning the metallic shield on the USB connector is also grounded to the mains power point through the PC case.

As such, connecting the USB oscilloscope to the mains connected circuit is inevitably disastrous. When this is done, mains voltage will push current into the PC case (or into the USB data lines, depends which probe is linked) to be returned to the ground.

All mains linked circuit must be instrumented by floating equipment. You might be at safe side if you used a laptop instead of PC, but its not so safe either unless you really insulated everything around the laptop and ensured your laptop is really floating with respect to the ground.