Electronic – How to implement a simple and efficient voltage divider for battery level readings for a ESP32 board

batteriescapacitorresistorsvoltage divider

I'm trying to design a simple device based on ESP32 board, which will control stepper motors from a battery pack (26650 series).

I'm struggling with the battery level control part (red/blue colour on the diagram) and I'm not sure if I designed it correctly.

The 100uf capacitor marked on the diagram is a Aluminium Organic Polymer Capacitors 25V 100uF 20% ESR=40mOhms

Battery level resistors: Vishay

I'm aware that I should use a capacitor for the stepper drivers, but I'm not sure whether or not to use an additional capacitor for battery level readings?

enter image description here

Best Answer

If you really needed to save on power and you put the microprocessor to sleep, using a circuit with a p-ch mosfet could save power and not drain the battery while the microprocessor is sleeping. Otherwise a high impedance resistor divider would be appropriate.

enter image description here

Source: Low current battery monitoring

The ADC looks linear as shown below. I could not find any information on the impedance of the ADC an any of Expressif's documentation, so I'd assume that the impedance is low (100k worst case) and design around that.

enter image description here
Source: https://docs.espressif.com/projects/esp-idf/en/latest/hw-reference/index.html

Make sure you follow the ADC guidelines:

2.1.6 ADC It is recommended that users add a 0.1 uF filter capacitor to a pad when using the ADC function.
• Pins SENSOR_VP or SENSOR_VN will trigger an input glitch lasting for 80 ns once SARADC1, or SARADC2, or Hall sensor is initialized.
2. Schematic Checklist and PCB Layout Design
• Pins SENSOR_VP or SENSOR_VN is recommended for use as ADC.
• If SENSOR_VP and SENSOR_VN are used as GPIOs, while ADC is supported by other pins in the circuit design, users need to do settings in software to avoid the input glitch.
Source: https://espressif.com/sites/default/files/documentation/esp32_hardware_design_guidelines_en.pdf

Related Topic