Iipo checker for up to 6S

Hello!

I would like to build a lipo checker for up to 6S.

What do I need before that?

Unfortunately I don't know exactly which sensor module is best suited.

I hope someone has a tip for me.

What exactly do you mean by lipo tester?
What are you trying to measure?

Hello!

I have Lipo batteries with 7.4V to 22.2V and I just want to measure the voltage of the individual cells.

eg.
Cell 1 = 3.70V
Cell 2 = 3.69V
.....

Do you need to measure the separate cells individually without moving connections about? If so then either you need a number of ADCs, one for each connection, or you need to multiplex a single ADC round the cells. I don't know what hardware you would use for that.

The truth is out there ...

How to use ADC of ESP32 - Measuring voltage example (microcontrollerslab.com)

Use a microcontroller with ADC's as Colin says and send the data direct to MQTT. Node-RED can then listen for and process the data as needed.

I did not realise the ESP32 had a built in multiplexor. That is good to know.

@madmax @Colin Make sure to check the device for the pins.

As I read the pinouts and understand them, they are different depending on the ESP32:
on the ESP32 DEVKIT V1 - DOIT gpio26 can be used as an ADC but
on the ESP32-S2 Mini gpio36 only supports SPI and UART

That was only an example pulled at "random" from the top of my search listing :slight_smile:

Wasn't meant as a working solution.

1 Like

I read on the "web" that the ADC pins on the ESP32-S2 Mini work best with an external 100nF capacitor and at voltages below +2.45V. That means you need to rig-up a voltage divider network (a couple of resistors in series) to reduce the external voltage to a level that won't destroy the microcontroller.

1 Like

I assume that the capacitor is to reduce jitter on the reading?

I believe so.

Hello!

Thanks a lot for all the answers.

What is the best thing to do now?

Jump onto Aliexpress and order an ESP32? Then start playing.

NOTICE!
I just finished dealing with multiple bad units in a order of ESP32's S2 mini's. There is a known bad run of them on the market. Pay more and get the newest units with the wemos.cc logo.

link to info about bad wifi cap issues ---> https://esp32.com/viewtopic.php?t=28506&start=10#p100518

I just finished testing units I ordered from this seller and all 20 of them are good.
https://www.aliexpress.us/item/3256804158044498.html?spm=a2g0o.order_list.order_list_main.26.21ef1802APlwdF&gatewayAdapt=glo2usa

whats funny is that I was driven to aliexpress because I received bad units from amazon
BAD units I got on amazon ---> https://www.amazon.com/dp/B0B291LZ99?psc=1&ref=ppx_yo2ov_dt_b_product_details

Good luck. hope yours work

2 Likes

If it says
V1.0.0
WEMOS.CC
does that mean it should be ok? I did not see that mentioned in the post you linked to.

I've bought two sets of 5-off ESP32-S2 Minis from Win-Win shop on AliExpress - they have all worked fine.

https://www.aliexpress.com/item/1005004438665554.html

I have not had a bad unit that was stamped with WEMOS.CC

yes all the boards that have WEMOS.CC have been good. But many sellers have not updated their images. So the seller i used was using the old image with the non wemos silk screen on the board the boards that showed up had it. Again its why i sad "good luck"

GOOD

BAD
bad

Total off topic side note. This is my python function I wrote to get the battery voltage using the ADC

# Battery - Pin used to supply gpio (+) voltage to voltage divider resister 1.1kohms
Constant_batt_gpio_pos_volts_supply_pin = const(6)



# Battery (Volts, Remaining%)
def batt():
    # supply voltage gpio pin for voltage divider
    gpio_pos_volts_supply = machine.Pin(Constant_batt_gpio_pos_volts_supply_pin, machine.Pin.OUT)

    # set gpio_pos_volts_supply high/(+)
    gpio_pos_volts_supply.value(1)
    # give time for voltage to settle
    time.sleep_ms(50)

    # analog voltage gpio pin
    adc_gpio_read_batt_voltage = machine.Pin(Constant_adc_gpio_read_batt_voltage_pin)
    # Create an ADC object out of our pin object
    adc_object = machine.ADC(adc_gpio_read_batt_voltage)

    # 11 dB attenuation means full 0.15 - 2.45V range
    adc_object.atten(adc_object.ATTN_11DB)

    # read voltage
    microvolts_after_divider = adc_object.read_uv()

    # turn off voltage pin used to supply gpio (+)
    gpio_pos_volts_supply.value(0)

    # Calculate voltage from microvolts to volts
    volts_after_divider = microvolts_after_divider / 1000000
    # convert to original voltage before voltage divider
    volts = volts_after_divider * 1.523809524  # Voltage In = Voltage Out * (R1+R2/R2) R1=1.1Kohms R2=2.1Kohms

    # Calculate estimated battery percentage remaining, also keep from going past 100% or under 0%
    remaining_percent = int(100 * (volts - Constant_battery_min_voltage) / (Constant_battery_max_voltage - Constant_battery_min_voltage))  # 100 * (adc_volts - BATTERY_MIN_ADC) / (BATTERY_MAX_ADC - BATTERY_MIN_ADC)
    if remaining_percent > 100:
        remaining_percent = 100
    elif remaining_percent < 0:
        remaining_percent = 0
    return volts, remaining_percent

One important think to remember about the original ESP32 is that is has two Analog to Digital Converters. These are known as ADC1 and ADC2.

Because of the limitations of the original ESP32 architecture, ADC2 cannot be used at the same time as WIFI, so if you’re using WiFi to send data via MQTT then you can only use the GPIO pins that are attached to ADC1.

The ESP32 S2 has 20 GPIOs that are attached to GPIOs, as opposed to 18 for the original ESP32, but suffers from the same limitation that ADC2 cannot reliably be used at the same time as WiFi.

For the original ESP32 the pins connected to ADCs are…

  • ADC1_CH0 (GPIO 36)
  • ADC1_CH1 (GPIO 37)
  • ADC1_CH2 (GPIO 38)
  • ADC1_CH3 (GPIO 39)
  • ADC1_CH4 (GPIO 32)
  • ADC1_CH5 (GPIO 33)
  • ADC1_CH6 (GPIO 34)
  • ADC1_CH7 (GPIO 35)
  • ADC2_CH0 (GPIO 4)
  • ADC2_CH1 (GPIO 0)
  • ADC2_CH2 (GPIO 2)
  • ADC2_CH3 (GPIO 15)
  • ADC2_CH4 (GPIO 13)
  • ADC2_CH5 (GPIO 12)
  • ADC2_CH6 (GPIO 14)
  • ADC2_CH7 (GPIO 27)
  • ADC2_CH8 (GPIO 25)
  • ADC2_CH9 (GPIO 26)

For the ESP32 S2 the numbering is a bit simpler and easier to remember…

ADC1:

  • 10 channels: GPIO1 - GPIO10

ADC2:

  • 10 channels: GPIO11 - GPIO20

Note than not all dev boards will break-out all of these GPIOs to useable pins.

Hope this helps avoiding some potential banana skins for people taking analog readings with the ESP32 family of boards.

Pete.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.