Voltage devider for esp32 to measure 18650 battery voltage - Page 1
Forum section: electronics / beginners

author: Micham
author_rank: Newbie
timestamp: October 21, 2024, 02:09:01 am
content: Is that schematic correct ?

author: BillyO
author_rank: Super Contributor
timestamp: October 21, 2024, 02:38:20 am
content: Not really.First, it's drawn opposite to convention. V+ is usually on top and Gnd on the bottom.Second, the enable won't work as the diode in the MOSFET will conduct at all times.Do you want it to go low when enabled or high?

author: Micham
author_rank: Newbie
timestamp: October 21, 2024, 02:52:01 am
content: Thank you for your reply Im fighting it whole night tonight :/Its part of power supply for esp32-s3 powered by 18650

author: BillyO
author_rank: Super Contributor
timestamp: October 21, 2024, 03:00:43 am
content: First, I'm not sure why you need an enable to make a measurement here. Just sample the voltage divider when you want to and save an I/O pin by getting rid of the enable.If you really feel you have to enable it, you will need a P-channel MOSFET, not an N-channel and the enable will happen when VEN is low. If you need the enable to happen when VEN is high, you will also need to invert the signal. You may also need a resistor from the gate to V+ depending on the nature of VEN.

author: Micham
author_rank: Newbie
timestamp: October 21, 2024, 05:12:33 am
content: I thought it would be a good idea to save some power by taking measurements once every 10 minutes or so. I made some adjustments and can use different MOSFET transistors; if you have any suggestions, that would be great. Should I use larger resistors, like 4.7 MΩ and 2.2 MΩ, to save even more power?https://oshwlab.com/michal.matuszewski1984/esp32-s3

author: squadchannel
author_rank: Frequent Contributor
timestamp: October 21, 2024, 05:23:05 am
content: Use a gas gauge ic. capacity does not equal voltage.I would use a one-chip IC that combines charger, protection, and gauge in one package.

author: xvr
author_rank: Frequent Contributor
timestamp: October 21, 2024, 10:43:35 am
content: Quote from: Micham on October 21, 2024, 05:12:33 amThis circuit will not work. S of your MOSFET will be Ven-Vth, for whatever Vbatt.

author: Peabody
author_rank: Super Contributor
timestamp: October 21, 2024, 01:49:40 pm
content: To use an N-channel mosfet, the GPIO output to the gate has to be higher than the source voltage by at least the G/S threshold voltage of the mosfet. Otherwise the mosfet won't turn on. Also, I think at least some esp32's require that the ADC input be no higher than 1.1V. So you can pick your resistors to divide 4.2V down to 1.1V, and use the circuit below.Or you can just forget about the mosfet, use high value resistors, and put a capacitor on the analog input.

author: Micham
author_rank: Newbie
timestamp: October 22, 2024, 12:08:36 am
content: There is soo many of them, I dig deeper and found AXP series quiet interested, but its much more capable for my needs, and complexity of my project sky to roof.Can you recommend me nice solution pleaseTexas Instruments (TI) - BQ, LTCMaxim Integrated - MAXMicrochip - MCPAnalog Devices - LTCDialog Semiconductor (Renesas) - DAX-Powers (AXP Series) - AXPSTMicroelectronics - STNXP Semiconductors - PC

author: Micham
author_rank: Newbie
timestamp: October 22, 2024, 12:10:56 am
content: Now i see it thank you