After reading various articles here and there, I am still facing something I cannot understand although I think I got things correctly (which I must not, though ...).
My goal is to measure lipo battery level with an esp32. To achieve this I use an IRLZ44N driven by a SN74ACHT125 powered by a LM7805. The idea is to open the FET with a Vgs of 5V to get minimal Rds(on).
However, I keep getting inconsistent readings, and, as it turns out, there seems to be a voltage drop of 0.74V-0.15V between D and S (depending on the battery level) which I cannot explain or prevent.
Here is the simplified schematics which helped me characterise this unexpected drop: I got rid of the gate buffer and kept the FET / charger and the regulator (wiring its output directly to the gate) and used DMM.
The simplified exhibits exactly the same problem as it actually shows the voltage drop I'd like to get rid of. Here is the amended version with identifiers.
Would you then please educate me? I am not an electronician and I fail to see what my circuit is missing. It has all the parts, the connections and said parts' specs are pretty commonplace, with maybe the exception of the charger but suffice to say that it delivers 12V and all ground pins are interconnected.
The basic idea in the posted circuit is unworkable.
To measure battery voltage, most people use a high impedance resitive voltage divider, with a capacitor from the ADC input to ground (e.g. 10 nF), in order to lower the source impedance as required.
Ok, I thought that measuring directly at source pin would be correct. Fair enough. Here is an updated schematics which has the same problem. I have 4.2V at the drain pin and would expect something like 3.3V at the DMM and I get 2.444V (and yes, I checked the resistors).
Ah, damn, I now remember reading something about it ... I thought using it as a low side switch but current would have leaked through the ADC pin which is not a good idea. I guess I will have to re-use a combination of N-FET and P-FET I had in an old design: IRF930 as gate driver for an IRF9540.
Many thanks for pointing this out and apologies for my initial post, I did not realise it was not up to the standards.
When using MOSFETs you need to reference the source for the gate turn on voltage. If it is an N-channel the gate needs to be positive. If it is a P-channel the gate needs to be negative. A simple rule is P is for positive and N is for negative switching.
You can use a N-channel MOSFET to switch high side, just remember the gate has to be positive in respect to the source so it will need to be typically driven by about ~5V more then you are switching.