# Iipo checker for up to 6S

**URL:** <https://discourse.nodered.org/t/iipo-checker-for-up-to-6s/78427>\
**Category:** Hardware\
**Created:** [15 May 2023 07:34 UTC](https://discourse.nodered.org/t/iipo-checker-for-up-to-6s/78427 "2023-05-15T07:34:17Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![madmax](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@madmax](https://discourse.nodered.org/u/madmax)\
**Post date:** [15 May 2023 07:34 UTC](https://discourse.nodered.org/t/iipo-checker-for-up-to-6s/78427/1 "2023-05-15T07:34:17Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [15 May 2023 10:04 UTC](https://discourse.nodered.org/t/iipo-checker-for-up-to-6s/78427/2 "2023-05-15T10:04:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![madmax](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@madmax](https://discourse.nodered.org/u/madmax)\
**Post date:** [15 May 2023 10:51 UTC](https://discourse.nodered.org/t/iipo-checker-for-up-to-6s/78427/3 "2023-05-15T10:51:47Z")

</div>

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  
.....

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [15 May 2023 12:23 UTC](https://discourse.nodered.org/t/iipo-checker-for-up-to-6s/78427/4 "2023-05-15T12:23:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [15 May 2023 12:31 UTC](https://discourse.nodered.org/t/iipo-checker-for-up-to-6s/78427/5 "2023-05-15T12:31:43Z")

</div>

The truth is out there ...

[How to use ADC of ESP32 - Measuring voltage example (microcontrollerslab.com)](https://microcontrollerslab.com/adc-esp32-measuring-voltage-example/)

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.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [15 May 2023 12:33 UTC](https://discourse.nodered.org/t/iipo-checker-for-up-to-6s/78427/6 "2023-05-15T12:33:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [15 May 2023 15:24 UTC](https://discourse.nodered.org/t/iipo-checker-for-up-to-6s/78427/7 "2023-05-15T15:24:48Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [15 May 2023 16:12 UTC](https://discourse.nodered.org/t/iipo-checker-for-up-to-6s/78427/8 "2023-05-15T16:12:02Z")

</div>

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

Wasn't meant as a working solution.

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [15 May 2023 16:59 UTC](https://discourse.nodered.org/t/iipo-checker-for-up-to-6s/78427/9 "2023-05-15T16:59:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [15 May 2023 17:04 UTC](https://discourse.nodered.org/t/iipo-checker-for-up-to-6s/78427/10 "2023-05-15T17:04:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [15 May 2023 18:25 UTC](https://discourse.nodered.org/t/iipo-checker-for-up-to-6s/78427/11 "2023-05-15T18:25:20Z")

</div>

I believe so.

---

<div class="post-metadata">

**Author:** ![madmax](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@madmax](https://discourse.nodered.org/u/madmax)\
**Post date:** [15 May 2023 19:17 UTC](https://discourse.nodered.org/t/iipo-checker-for-up-to-6s/78427/12 "2023-05-15T19:17:42Z")

</div>

Hello!

Thanks a lot for all the answers.

What is the best thing to do now?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [15 May 2023 20:13 UTC](https://discourse.nodered.org/t/iipo-checker-for-up-to-6s/78427/13 "2023-05-15T20:13:18Z")

</div>

> [@madmax](#):
>
> What is the best thing to do now?

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

---

<div class="post-metadata">

**Author:** ![meeki007](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/meeki007/32/12499_2.png) [@meeki007](https://discourse.nodered.org/u/meeki007)\
**Post date:** [17 May 2023 14:23 UTC](https://discourse.nodered.org/t/iipo-checker-for-up-to-6s/78427/14 "2023-05-17T14:23:58Z")

</div>

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](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](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](https://www.amazon.com/dp/B0B291LZ99?psc=1&ref=ppx_yo2ov_dt_b_product_details)

Good luck. hope yours work

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [17 May 2023 15:56 UTC](https://discourse.nodered.org/t/iipo-checker-for-up-to-6s/78427/15 "2023-05-17T15:56:57Z")

</div>

> [@meeki007](#):
>
> Pay more and get the newest units with the wemos.cc logo.

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.

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [17 May 2023 16:25 UTC](https://discourse.nodered.org/t/iipo-checker-for-up-to-6s/78427/16 "2023-05-17T16:25:56Z")

</div>

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](https://www.aliexpress.com/item/1005004438665554.html)

---

<div class="post-metadata">

**Author:** ![meeki007](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/meeki007/32/12499_2.png) [@meeki007](https://discourse.nodered.org/u/meeki007)\
**Post date:** [17 May 2023 17:03 UTC](https://discourse.nodered.org/t/iipo-checker-for-up-to-6s/78427/17 "2023-05-17T17:03:38Z")

</div>

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

> [@Colin](#):
>
> 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

 ![good](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/1/b13c6bb862bea402c8f5f8ed46778fcf35568337.jpeg)

BAD  
 ![bad](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/c/6cda56d1db16a4f2ea9fc3ab6cab78ea27efb679.jpeg)

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

```auto
# 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

```

---

<div class="post-metadata">

**Author:** ![PeteKnight](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/peteknight/32/18345_2.png) [@PeteKnight](https://discourse.nodered.org/u/PeteKnight)\
**Post date:** [18 May 2023 17:11 UTC](https://discourse.nodered.org/t/iipo-checker-for-up-to-6s/78427/18 "2023-05-18T17:11:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [17 July 2023 17:12 UTC](https://discourse.nodered.org/t/iipo-checker-for-up-to-6s/78427/19 "2023-07-17T17:12:19Z")

</div>

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