I have a stupid Nubie question that I am hoping someone might be able to answer. I am wiring an ESP32 with a P-MOSFET for a high level switch to get the voltage of the battery that is powering the board. I have the following circuit.
I have both the 5V (6.6V max) and ground attached to the ESP32 from the solar battery, and it appears to be running fine. I have attached the GPIO pins from the ESP32 at 2 points, one to control the gate and the other to read the voltage from the divider. When I toggle the Gate GPIO Pin High and LOW, the P-MOSFET never turns on and off, it is always reporting the V3.5 on the analog GPIO like it is stuck grounded. Everything I have found on the web says this should work, but the IRF954 never closes the gate. I would really appreciate anyone's advice on this.