I formerly asked about a LED circuit a long time ago.

The circuit I want to make is 'reverse-voltage notifier'. If the input is reversed, then a LED(below, D2) will lit. Of course, if the input is forward voltage, then another LED(below, D1) will be bright.

Also, I want to use these LEDs only if it is at bright place. In other words, in some occasions, I want to turn off them.

Using a Logic MOSFET is very good choice in my thought. However there's a problem.


simulate this circuit – Schematic created using CircuitLab

I thought this is right, however I don't want to make any smoke and I hadn't confirmed this. V1 could be +12V ~ -12V. Is it right? If it isn't, how could I work on this to work in any conditions(even if the V1 is reverse voltage)?

D1 is for forward-voltage, and D2 is for reverse-voltage. In reverse voltage MCU will not turn on, so I didn't used any MOSFET in D2 circuit. Of course, the reverse voltage will not excced above 12V. The maximum reverse voltage of the LEDs is 5V.

** Edit : The MCU is STM32F411RE which is I'm using. However I think this will not take an important part in. You could regard the MCU input as just the 0V / 5V logic source. **

You can see the BSS138 datasheet at here: https://www.onsemi.com/pub/Collateral/BSS138-D.PDF

Thank you.

  • 1
    \$\begingroup\$ Are you sure your ground connection is correct? Why did you change the circuit? What makes you think that LED D1 cathode not connected to the ground in the circuit before? See Q&A about maximum reverse voltage LED in here \$\endgroup\$
    – Unknown123
    Mar 30, 2019 at 9:14
  • \$\begingroup\$ @Unknown123 My apologies. I saw the GND connection is wrong right after some modifications. Two LEDs are just connected parallel, and they have opposite directions. In simulation, this circuit failed. I think that the MOSFET doesn't work properly if the input is reverse-voltage, but I cannot think a proper solution for this. \$\endgroup\$ Mar 30, 2019 at 9:18
  • \$\begingroup\$ whether the supply given to LED circuit and micro controller are same ?? \$\endgroup\$
    – Vignesh C
    Mar 11, 2020 at 7:19

2 Answers 2


Use TWO MOSFETS in a "back to back" configuration to form an effective single FET with no body diode.

Connect source to source, gate to gate.
Name one drain DU = Drain upper.
Name other Drain DL = Drain Lower.
Consider DL = source of the MOSFET pair.
Consider DU to be drain of MOSFET pair.

In this diagram note that M2 drain and source are swapped compared to "normal" usage.


simulate this circuit – Schematic created using CircuitLab

Place LEDs in MOSFET Drain circuit (between DU & R1)
Connect DL to ground.
Drive two-gates (joined) as input.
(MAYBE a say 1 megohm from joined sources to ground - try without it first).

Report back.

This works (we hope :-) ) because a MOSFET is a 2 quadrant device.
As long as Vgs is positive then the MOSFET will conduct in either direction.

Simulation MAY not want to turn the pair on without the 1 megohm mentioned above.
Real life usually will.

  • 1
    \$\begingroup\$ @Unknown123 The two FETs EFFECTIVELY form a single super-FET which has the characteristics of functioning like a single NCHannel MOSFER with NO BODY DIODE in an on/off application. Both gates are joined to make new gate. Both sources are joined AND FLOAT or grounded via a 1 megOhm. One drain is the "new drain". One drain is the "new" source. The two drains are interchangeable as the device is two quadrant. \$\endgroup\$
    – Russell McMahon
    Mar 30, 2019 at 11:30
  • 1
    \$\begingroup\$ Ah I understand what you mean is back-to-back MOSFET configuration. You could just say in your answer look up back-to-back MOSFET configuration in google for more information, I would definitely understand right away. But, anyway thanks for explaining. \$\endgroup\$
    – Unknown123
    Mar 30, 2019 at 11:39
  • 1
    \$\begingroup\$ @Unknown123 I've added a diagram AND edited to include "back to back" in the explanation :-). \$\endgroup\$
    – Russell McMahon
    Mar 30, 2019 at 11:41
  • 1
    \$\begingroup\$ @ChanhoJeon When you say things like " ... when the voltage ..." it is not at all clear what you mean. And if "the input voltage" === Vin on my diagram then it will NEVER be at -12V as the MCU output is at 0 or MCU-Vdd = +3V3 or +5. So it is not clear what you mean at all. The circuit should work for ANY voltage in the range -12 to +12 on the nominal +12V line and 0 or MCU_Vdd on the Vin line. \$\endgroup\$
    – Russell McMahon
    Mar 30, 2019 at 23:16
  • 2
    \$\begingroup\$ @ChanhoJeon As Unknown23 says- -ve gate voltage is ALLOWED up to the data sheet specified maximum BUT 1. It is not what you asked about initially - so if negative voltage was used in an attempt to turrn on that would be "New Question" - not "Didn't work". 2. As I said above - using an mcu the control voltage will be zero or +ve wrt an mcu with ground referenced Vdd.||| Experimenting & Learning is good! :-) - trying other arrangements mentally or in simulation or in practive teaches you much more than just "using the supplied answer". \$\endgroup\$
    – Russell McMahon
    Mar 31, 2019 at 4:18

enter image description here

choose any LED , N-MOSFET and respective value resistor. whatever the polarity of the supply is the circuit will work as follows

body diode of one N-MOSFET -> Resistor -> LED that's it,

either any one of the LED will glow with respect to polarity of supply.

if you don't want any of the LED to glow, give valid gate voltage to both the N-MOSFET with the MCU. now the working flow will be as follows

body diode of one N-MOSFET -> Resistor -> N-channel of another N-MOSFET


Your Answer

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

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