VCC_uC_LCD is at 3.3V always.
The Label BL is directly connected to GPIO 26 of the ESP. (BL stands for Backlight)
The drain is connected to the Backlight pin of a 1.8 inch TFT display.
I am using a CJ3400 N MOSFET
My goal is to use the BL signal to switch on and switch off the Backlight of the display.
Problem:
The backlight is always on, irrespective of the state of GPIO26. When I remove the mosfet ,Backlight of the display is off. I see a voltage of 0.8 V on the GPIO26. Why is the GPIO output 0.8V? Have I damaged the GPIO?
Also, is my circuit correct? Any recommendations/ Corrections are welcome.
Your circuit is wrong. N-type mosfet can be used to connect/disconnect anything to GND rather than to POWER source.
To switch upper side (VCC to device) you need a P-type mocfet
thank you for the reply. Can you elaborate how i can use a pmos here? thanks
Also it would help if you can shed light on to why esp low output is 0.8 V?
Did you measured it with the mosfet connected? Id so - try to disconnect your circuit and measure again.
i measured it without mosfet. it was 0.5 v the second time i measured
You need a circuit like this:

Thanks for the help.
I would need a pmos and a BC547C. Is there no solution with only one transistor or mosfet?
Yes
Are you are absolutely sure that Vcc_uC_LCD will never go over 3.3V?
yes, it is the output of a LDO. So unless the LDO burns out, the Output would never go over 3.3v.
It could be a solution if your backlight has a separate GND line. In that case you can switch BL ON and OFF by breaking its GND connection.
no it does not have a separate GND line.
This will work but we still need to find the right PMOS
Can you buy from Digi-Key or Mouser?

what i understood is, BL remains high when i want the output low or VCC and out disconnected. and when BL goes low, the gate of the PMOS is at a lower voltage than VCC due to drop across r7 and thus PMOS switches on i.e. VCC and OUT gets connected by a low imepdance path.
The purpose of R7 is to make sure that the PMOS is OFF when the ESP is booting up and the output pins are in the high impedance state.
The PMOS is OFF (OUT = 0V) when BL is about the same voltage as Vcc_LCD
The PMOS is ON (OUT = Vcc_LCD) when BL is close to 0V
For the PMOS:
I recommend the PMV48XP,215 from Digi-Key
i found a similar one which is available locally CJ3401. link: Microsoft Word - CJ3401_SOT-23_.doc (evelta.com)
Can you take a look? Thanks very much for all the help
Perfect!
Have fun!
Thanks !!!
I need to make another such switch but in this case the control voltage signal is 3.3 and the controlled voltage is 5V. I want to learn to make these mos based switches myself as well. Any guide?
Post #6 has an example of such a switching circuit using a lower voltage trigger. Search for "high side switch circuit" for more examples and some explanation.
