Comment on How to improve my battery measurement circuit?
Yonrak@feddit.uk 1 year ago
Could you do similar to diagram 2, but instead of an N-FET use a P-FET between the battery and first resistor in the potential divider? Add a gate pull up to source, have the micro pull the gate down to take a measurement. The micro will see 0V or divided battery voltage.
nilclass@discuss.tchncs.de 1 year ago
That’s a great idea! Unfortunately I don’t have a P-FET lying around, so cannot try it right now.
Not sure I understand this point. Which resistor would you replace with a diode?
Yonrak@feddit.uk 1 year ago
Sorry, I think I was talking nonesense (doing this in my head and just woke up 😅).
Not sure it’ll work with just a P-FET actually. You’ll likely need to control the PFET with a NFET, otherwise you still end up with too high a voltage on your control pin when the FET is off due to the gate pullup (unless you can use a fet with a very high Vgs Threshold).
The above comment about diodes was to protect the microcontroller pin, but you end up not being able to control the FET doing it that way.