I connected an LED with its cathode to the V- of a 5V power supply (with a resistor in between). The anode is connected to the source of an F9540N P-channel MOSFET. The LED glows (not well visible on the image since flash was on, but it does). It stops when I remove either the MOSFET or the power supply. Circuit

Here is a scheme of the circuit: circuit

How does that happen and can it cause damage to any of the devices?


Since some users asked whether I am sure nothing else is connected, I took another photo where I only touch the LED with the source pin of the MOSFET: MOSFET touches LED And this is the voltage source (blue connected to V-; just to proof I am not nuts): Voltage source

As soon as I touch the LED, it starts to glow.

  • \$\begingroup\$ Please add a schematic to your question. There is a schematic editor available when you open the edit window for your question. However, without yet knowing your part numbérs or how they are wired up, I would guess that you have some small current flowing through your transistor. It doesn't take much current to cause an LED to visibly glow. \$\endgroup\$ Oct 6, 2022 at 11:17
  • \$\begingroup\$ You say the cathode isn't connected in the title, but the text says it's connected to a MOSFET. We'd need to understand the rest of the circuit to understand what's happening. \$\endgroup\$
    – Simon B
    Oct 6, 2022 at 11:18
  • \$\begingroup\$ What's on FET gate? Is it floating? The power supply is not earthed and likely has huge common mode voltage swings. Unless you connected the FET source to something else too. What's the exact setup? \$\endgroup\$
    – Justme
    Oct 6, 2022 at 11:18
  • 1
    \$\begingroup\$ Are you sure that the drain of your MOSFET is not connected to anything, as shown in your schematic? Is the heatsink touching anything? \$\endgroup\$ Oct 6, 2022 at 11:24
  • 1
    \$\begingroup\$ When you touch the source pin to the LED, you are holding the heatsink with your fingers. Current is flowing through your body, through the heatsink, through the MOSFET through the source pin into the LED. I bet if you used a battery, rather than a mains powered power supply, the LED would not light \$\endgroup\$ Oct 6, 2022 at 11:39

1 Answer 1


(Edit: I just realized in your first image that you don't have the drain of the MOSFET connected to anything. In which case it isn't the body diode doing this. In that case, the MOSFET body is being coupled to the environment and picking up some small current. See the second part of my answer. I'm going to leave the rest of my answer here because I think it might be useful to you)

Every MOSFET has a body diode. This is a parasitic element and is a result of the way that MOSFETs are created at the silicon level. We can't do anything about them so we have to design around it. In a PMOS, the cathode of this diode is connected to the drain and the anode is connected to the source. So, what this means, is that with your current configuration, current can flow through the body diode at all times since the diode is forward biased. You need to swap the high side of the power supply to be connected to the source, with the led connected to the drain.

Additionally, don't leave MOSFET gates floating. It takes an extremely small amount of charge to turn a MOSFET on and so if it's floating, it can easily turn on due to static charges or being coupled to other things in the environment. You should add a high valued resistor from the gate to the positive side of your power supply.

But this doesn't explain why you can touch the MOSFET to the led and have it turn on or why it turns on with nothing connected to the drain side of the MOSFET. This is most likely an entirely different phenomenon. LEDs are super efficient and can turn on with miniscule current. Try this: Add another jumper wire to your circuit on the negative side of the led. Pinch the other end of the jumper wire pin in your fingers so you are connected to the negative side of the led. Now try touching the MOSFET back to the led. I think this will prevent it from lighting up. Before, AC power from mains voltages was coupling through your body and going to ground through the LED or coupling through the MOSFET body. This isn't dangerous because the current is tiny and it happens all the time, we just don't notice it. The LED is a nice indication of this fact.

And if you've only connected things as described here, then you most likely haven't damaged anything. Body diodes in MOSFETs are not designed to be continuous paths for large amounts of currents, but can typically handle small loads.

  • \$\begingroup\$ Thanks! I tried it with a jumper wire instead of the MOSFET and the LED did also glow. I actually just wanted to find out how the MOSFET works since the official documentation of the Raspberry Pi Pico suggests to add a p-channel MOSFET (without resistor) when powering the Pico from a 5V source while still having the option to savely connect a computer via USB from time to time (datasheets.raspberrypi.com/pico/pico-datasheet.pdf page 20). \$\endgroup\$ Oct 6, 2022 at 11:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.