I want to switch on/off a sensor which runs at 3.7V using a logic level P-Channel Mosfet. Unfortunately, the microcontroller which drives the P-Channel Gate is powered with a higher voltage (5V) compared to the PMOS Source voltage.
Please check the below circuit diagram. Let's assume, the diode is not in place. I assume current would "leak" from the higher potential (MCU PGIO Pin, when high) to the 3.7V voltage rail. I added the diode to fix current flowing to the 3.7V rail but I'm unsure, if this is a good practice.
My questions are: Is the diode enough or are there better practice how to control the PMOS with higher Gate voltage than the source voltage?
Thank you very much!