I design a High side mosfet 12V switch from isolated 3V3 GPIO on previous post, based on EL3H7-G (C) Optocoupler and STR2P3LLH6 Mosfet but it's alway ON... I don't understand why.
I check the voltage in both state, when GPIO (Open drain) is logical "1" (Green) and logical "0" (Red).
All voltages are measured referenced to DGND for left side voltages and referenced to AGND for right side voltages
GPIO = 1 (GREEN MEASUREMENT)
In this case, PWREN = 0.16V so current can flow through optocoupler LED.
Vf=1.34V-0.16V=1.18V (OK: Designed to be 1.2V)
If=9.85mA (OK: Designed to be 10mA)
The optocoupler transistor seem to be saturated
Vce=0.06V (Designed to be 0.2V)
So Ic seem to be 11mA on EL3H7-G (C) datasheet (Figure 7) for Vcesat = 0.6V
IR2=1.17mA (OK: Designed to be 1.18mA)
Hum, this look like current flow from the Gate of the mosfet...
-Ig=9.83mA came from the gate ??? It's possible ???
In anycase Mosfet is ON, let look at Vgs
Vgs=-11.78V (OK: Designed to be 11.8V)
Vgs=-11.8V is upper than Vgs(th)=-2.5V
GPIO = 0 (RED MEASUREMENT)
Is this case, Optocoupler LED seem to not be on.
But there is a small voltage accross the LED
Probably not enought to light on the LED ???
When I check the optacoupler transistor
Vgs=-0.02V is really lower than Vgs(th)=-2.5V
So why my mosfet conduct ? this puzzle me !
Can someone help me to unsertand what happen, what is my mistake and how I can correct this ?
Thanks in advance for your help
EDIT 1 : PINOUT
Here is extracted from the STR2P3LLH6 datasheet
EDIT 1 : PCB
Here is the top, with optocoupler (R3 on PCB is R1 on schematic)
Here is the bottom, with MOSFET (R4 on PCB is R2 on schematic)
(I replace MOSFET and remove C20 and C21 as suggested by @John Birckhead)
EDIT 2 : WRONG PINOUT "IT WORK"
Many thank you very much to @Charlie and @Louis to point out the wrong pinout of my STR2P3LLH6 PCB footprint. The schematic is good but Drain and Source are swap on my PCB. I flip the Mosfet and rotate it to 45° and now it work very well.
On my full schematic I do mistake on MOSFET connection, but I don't do the mistake on the simplified schematic here on stack exchange that why I take time to understand what append and no one here see the problem at first look on schematic. An other thank you to @Charlie and @Louis to take look on the PCB trace to point out this.
You can use the schematic and the method on top of this post without problem as soon as you respect your MOSFET pinout :). The Schematic is good, my PCB is wrong.