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.
SCHEMATIC
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=IR1=(3.31V-1.34V)/200=9.85 mA
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=(11.84V-0.06V)/10000=1.17mA
IR2=1.17mA (OK: Designed to be 1.18mA)
Hum, this look like current flow from the Gate of the mosfet...
-Ig=11mA-1.17mA=9.83mA
-Ig=9.83mA came from the gate ??? It's possible ???
In anycase Mosfet is ON, let look at Vgs
VR2=11.84V-0.06V=11.78V
Vgs=-VR2
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.
If=VR1=0V/200=0mA
If=0mA
But there is a small voltage accross the LED
Vf=3.31-2.80=0.51V
Vf=0.51V
Probably not enought to light on the LED ???
When I check the optacoupler transistor
VCE=11.82V
VR2=11.84V-11.82=V0.02V
Vgs=-VR2
Vgs=-0.02V
Vgs=-0.02V is really lower than Vgs(th)=-2.5V
So why my mosfet conduct ? this puzzle me !
VPWR=11.24V
Vsd=11.84V-11.24V=0.6V
Vds=-0.6V
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
I check many time the pinout but perhaps I'm tired... If someone see something strange...
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.
Quick MOSFET pinout inplace correction
Explanation:
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.
This is the part of my wrong full schematic, MOSFET is not connected the right way
CONCLUSION
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.