I want to switch power of 12V laser sensor from 3V3 STM32H753VI GPIO. I will power on or off for long time (It's not PWM here) I am not comfortable with Mosfet and Optocoupler so I need help to be sure I can route this to my board. I want to go high side because the sensor laser set 12V to output when I cut the ground. I need to be isolated because of isolated power supply.


SCH Laser power is connected to CN1 and draw about 100mA and can work between 10V to 14V.
The STM32H753VI work at 3V3 and GPIO will be set as open drain.
I want to use EL3H7-G (C) Optocoupler and STR2P3LLH6 Mosfet because of small footprint.


When GPIO is shorted to ground current flow to EL3H7-G led, I get forward voltage from sheet (page 3) and curve (page 4)

Forward Voltage Forward voltage curve

GPIO could not handle more than 20mA to the GPIO so I will set If=10mA

I will go with R1=200ohms


I want to When I look into EL3H7-G datasheet (page 3) I can see optocoupler transistor can be saturated with If=10mA and Ic=1ma so Vce(sat) will be at 0.2V max . (On the curve I can see I can go to 6ma into saturated region)

VCEsat VCE curve

I will go with R2=10kOhms


Vgs is -R2 voltage

From STR2P3LLH6 datasheet (page 3) I can see Vgs(th)=-2.5V


Vgs (-11.8V) is more lower than Vgs(th) (-2.5V) so Mosfet will turn On.

Vgs max

I can see on STR2P3LLH6 datasheet (page 2) Vgs max is +/-20V
so I will probably not destroy the gate with -11.8V


On STR2P3LLH6 datasheet (page 5) I can see the Rdson is about 48mOhms for 100mA




I can now compute Mosfet dissipated power


P (480µW) is really lower than Ptot (0.35W)


  • Do you think Mosfet will fully On or Off as I want ?
  • Do you think I will destroy the Mosfet, Optocoupler or STM32 ?
  • Do you think optocoupler and Mosfet are about a good choice ?
  • Do you think It's good to add small value R3 between collector and gate ?


Thanks in advance for your help

Edit 2021-06-24
I implement this design but got an Always On Problem here

Edit 2022-02-04
My problem Always On Problem came from my PCB and not from schematic and method here, you can use it without problem, as soon as you respect you MOSFET footprint :)


3 Answers 3


This design has a very high margin with good choices for On/Off margin.

With 10:1 CTR on the design or 10% output and is well exceeded by guaranteed CTR.

  • Keep in mind Vce loses gain when saturated and rises above 0.5V quickly to 1V at which point the worst-case FET leakage is guaranteed to be Id=-250 nA max where it is possible that 2mA LED drive "could" work to turn on.

  • The Ron is 56 mohm max at Vgs= - 10 and a little bit less at -12V. Your load is equivalent to 12V/0.1A = 120 Ohms so a switch resistance ratio of 1% max is desirable so 0.056/120 or overkill but fine.

  • Rg is redundant with Rce equivalent resistance Vce(sat)/Ic = 0.2V/1.18mA = 169 ohm approx.

Good job.

  • \$\begingroup\$ Big THANKS to take time for your response, and lot of tips about switching resistance. I will take look of leakage because I don't take it into account. \$\endgroup\$
    – rom1nux
    Commented May 27, 2021 at 7:16
  1. Yes.

  2. No. And, you could reduce the optocoupler LED current to 5 mA for even more operating margin.

  3. Yes.

  4. Not needed in any way, but won't hurt anything or affect the circuit's overall performance.

A resistor is placed in series with the gate to dampen unwanted oscillations that occur when large power MOSFETs (with a very large gate capacitance) are driven with a very fast risetime signal, which is common in switching power supplies. The gate capacitance and wiring inductance form a tank circuit that can ring at many times the switching frequency, causing a ton of compliance headaches. None of that applies here.

  1. O.U.T.S.T.A.N.D.I.N.G question presentation.
  • \$\begingroup\$ Many thanks to take time to help me., thanks for tips about R3 and gate capacitance \$\endgroup\$
    – rom1nux
    Commented May 27, 2021 at 7:14

As an alternative, you may want to consider changing the optoisolator for another type of galvanic isolation technique such as capacitive or inductive which uses less power.

Texas Instruments has a great series of videos on the subject of galvanic isolation which discusses inductive, capacitive and optical isolation techniques.

For example, here's the data sheet for the Silicon Labs Si823Hx which is an isolated gate driver in one chip.

It could look something like this:

Si823H9 Isolated Gate Driver

  • \$\begingroup\$ Thank you for this information, this king of chip seam to be the Holy Grail I search without success before going to optocoupler/mosfet chain. For the next project I think I will consider more deeply this kind of solution but for now I'm in hurry I need to route by board befire the deadline but this seem to be THE modern solution. \$\endgroup\$
    – rom1nux
    Commented May 27, 2021 at 11:25
  • \$\begingroup\$ And I forgot to say thank for the really interesting video, I need to review more time thoses explained concepts \$\endgroup\$
    – rom1nux
    Commented May 27, 2021 at 11:27
  • \$\begingroup\$ Just an aside: These types of isolators are great, but the big drawback is usually that they cost 10X what a simple optocoupler costs in volume. So it's technically a great solution, but if cost is an issue it might not be an economically great solution. \$\endgroup\$
    – John D
    Commented May 27, 2021 at 15:28
  • \$\begingroup\$ @JohnD thank you for pointing this, effectively this is the order of magnitude, for example EL3H7(C)(TA)-VG is 0.45€ and SI823H9AD-IS4 is 2.95€ \$\endgroup\$
    – rom1nux
    Commented May 27, 2021 at 19:34
  • \$\begingroup\$ If you ever need reliable multichannel (8 channels or connect them together for higher current capability) high side switching, check ISO8200B from ST. They have build-in protection for all cases (ESD, over-current, over-temperature, short circuit, over-voltage, loss of ground...) and they will survive everything! They may cost more (~5 Euro for 8 Channels), but I can sleep at night knowing my outputs will be the last thing that fails, no matter what. \$\endgroup\$
    – Pan Vi
    Commented May 29, 2021 at 14:30

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.