Author Topic: Voltage devider for esp32 to measure 18650 battery voltage  (Read 506 times)

0 Members and 1 Guest are viewing this topic.

Offline MichamTopic starter

  • Newbie
  • Posts: 5
  • Country: pl
Voltage devider for esp32 to measure 18650 battery voltage
« on: October 21, 2024, 02:09:01 am »
Is that schematic correct ?
 

Offline BillyO

  • Super Contributor
  • ***
  • Posts: 1818
  • Country: ca
Re: Voltage devider for esp32 to measure 18650 battery voltage
« Reply #1 on: October 21, 2024, 02:38:20 am »
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?
Bill  (Currently a Siglent fanboy)
--------------------------------------------------
 

Offline MichamTopic starter

  • Newbie
  • Posts: 5
  • Country: pl
Re: Voltage devider for esp32 to measure 18650 battery voltage
« Reply #2 on: October 21, 2024, 02:52:01 am »
Thank you for your reply Im fighting it whole night tonight :/
Its part of power supply for esp32-s3 powered by 18650
 

Offline BillyO

  • Super Contributor
  • ***
  • Posts: 1818
  • Country: ca
Re: Voltage devider for esp32 to measure 18650 battery voltage
« Reply #3 on: October 21, 2024, 03:00:43 am »
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.
Bill  (Currently a Siglent fanboy)
--------------------------------------------------
 

Offline MichamTopic starter

  • Newbie
  • Posts: 5
  • Country: pl
Re: Voltage devider for esp32 to measure 18650 battery voltage
« Reply #4 on: October 21, 2024, 05:12:33 am »
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
 

Online squadchannel

  • Frequent Contributor
  • **
  • Posts: 381
  • Country: jp
  • deepl translate user
Re: Voltage devider for esp32 to measure 18650 battery voltage
« Reply #5 on: October 21, 2024, 05:23:05 am »
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.
 
The following users thanked this post: Micham

Online xvr

  • Frequent Contributor
  • **
  • Posts: 535
  • Country: ie
    • LinkedIn
Re: Voltage devider for esp32 to measure 18650 battery voltage
« Reply #6 on: October 21, 2024, 10:43:35 am »
I thought it would be a good idea to save some power by taking measurements once every 10 minutes or so.
This circuit will not work. S of your MOSFET will be Ven-Vth, for whatever Vbatt.
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2211
  • Country: us
Re: Voltage devider for esp32 to measure 18650 battery voltage
« Reply #7 on: October 21, 2024, 01:49:40 pm »
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.

 
The following users thanked this post: Micham

Offline MichamTopic starter

  • Newbie
  • Posts: 5
  • Country: pl
Re: Voltage devider for esp32 to measure 18650 battery voltage
« Reply #8 on: October 22, 2024, 12:08:36 am »
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 please

Texas Instruments (TI) - BQ, LTC
Maxim Integrated - MAX
Microchip - MCP
Analog Devices - LTC
Dialog Semiconductor (Renesas) - DA
X-Powers (AXP Series) - AXP
STMicroelectronics - ST
NXP Semiconductors - PC
 

Offline MichamTopic starter

  • Newbie
  • Posts: 5
  • Country: pl
Re: Voltage devider for esp32 to measure 18650 battery voltage
« Reply #9 on: October 22, 2024, 12:10:56 am »
Now i see it thank you :-+
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf