Heltec Wifi LoRa V2 battery management

Hi there!

I have some doubts regarding battery management in Heltec Wifi LoRa V2. Please, would you answer them?
Here is the question: in electrical specs is clear that Heltec Wifi Lora V2 has battery (LiPo and Li-Ion) support / can work using battery as power source, however I couldn’t find information regarding battery charging. Is there LiPo and/or Li-Ion battery recharging feature in Heltec Wifi LoRa V2? If yes, does battery charges even when Heltec Wifi LoRa V2 is in deep sleep mode?

Thanks in advance.

1 Like

Hi @phfbertoleti
Both of the answers to your problems is yes!

The battery management part already included charge and discharge management, battery full protection, etc. It is a separate part, and this function is done independently by the TP4054 chip, so ESP32 does not affect it when it sleeps.

1 Like

Hi @Supporter. Thank you very much for the answer!

I have one more doubt: when powered by LiPo or Li-ion battery, the module hasn’t 5V on 5V para n, does it? I mean, when powered by LiPo or Li-ion battery the module will only have 3.3V, right?

Thanks in advance

I don’t think so.

Only USB or +5V header as input can charging the battery. As far as I know, most of the lithium battery charging voltage is 4.2V, the full voltage is 3.7V, and then gradually reduced during use.

1 Like

Thanks again @Supporter.

Do you know where I can find a LiPo battery spec to use with this module? I searched around tech specs but I couldn’t find it.

Also, do you know if battery in the following link can be used in this module? https://produto.mercadolivre.com.br/MLB-1166773676-bateria-de-lipo-37v-1100mah-lithium-polimero-recarregavel-_JM?quantity=1#reco_item_pos=0&reco_backend=machinalis-seller-items&reco_backend_type=low_level&reco_client=vip-seller_items-above&reco_id=4098db9d-b2a2-4902-9b99-028516e2d49f

Best Regards,
Pedro Bertoleti

2 Likes

@phfbertoleti

Any battery with 3.7V output / 4.2V charging voltage can be used in this board. Such as the battery in your link, that’s OK.

Thanks @Supporter.

Please, would you confirm the spec of module battery socket? Per my understanding, this is a JST 2P-1.25 (JST connector with 2 pins, separated each other by 1.25mm), however I’m not sure if I’m right.

Thanks in advance.

Yes, you are correct !!!

@Supporter thanks!

This weekend I’ve managed to use a li-ion battery and it worked fine. Thanks for your help!

Now I’m heading to a circuit to measure battery voltage (without wasting a lot of power power, what happens when using a simple voltage divider). Per my understanding, there is no “out-of-the-box” way to do this in this module (nothing inplemented yet). Am I correct? I ask you that because if there’s something like this lready inplemented on the module, it will save me some time.

Best regards,
Pedro Bertoleti

If you use V2 board, it’s have a battery voltage detect circuit. Also you can refer to here:

@Supporter, per my understanding, the forum topic you said suggest a voltage divider using gpio 13 (an ADC channel). It doesn’t have mention to an already implemented circuit on v2 board, right?

That is just my advice. You can see this part on the schematic diagram we provide:

Oh, now I see it! Have you referred to “LiPo electtricity & Vext” part of the schematic, right?

Per my understanding, when GPIO 21 is set to ‘0’ (low logic level), GPIO 13 (ADC 2:4) reads battery voltage. Is this correct?

Also, assuming what I said above is right, when Q3 has no conduction between source and drain (when GPIO 21 is ‘1’ or configured as an input), Vbat (what can be any value from 0 to 4.7V) will be directly wired to GPIO 13 (ADC 2:4). Is this a real risk of burning / destroy ADC2 (as it can support, at its maximum, 3.3V only)?

  • when GPIO 21 is set to ‘0’ (low logic level), GPIO 13 (ADC 2:4) reads battery voltage. Is this correct?
    -Yes

  • Is this a real risk of burning / destroy ADC2 (as it can support, at its maximum, 3.3V only)?
    -Yeah, at this time, you need config the GPIO13 as a normal GPIO.

So, to sum up:

A- When GPIO 21 is set to ‘1’: adc2:4 (gpio 13) will read full vbat value (probaly something greater than 3.3V).
B-When GPIO is set to ‘0’: adc2:4 (gpio 13) will read vbat in voltage divider (certainly lower than 3.3V).

For “A” case, GPIO 13 must be configured as input? Is it tolerant to 4.7V working as input?

image

OPEN_DRAIN

Ok. In my case, I’m using Arduino IDE to program the module. Do you have an example on how I can set this GPIO as open drain in Arduino IDE sketch?

pinMode(13, OPEN_DRAIN);

Hi! I have been uing this method of battery measurement over the last year (since V2 has been out). The results were never quite reliable, and I assume, that teh voltage divider circuit was not very precise. But is was sort of good enough for my application.
Now I got a new batch of modules, and there were some apparent changes to the circuit (unfortunately not documented anywhere, it seems). The bad news: the method of voltage measurement that was in the example files does not work anymore… Is there an improved way of measuring battery voltage? Can I get hold of any documentation what the circuit actually looks like right now? ARe there new example files available?
Thsi is rather crucial for me - I am shipping out about a 100 kits every month, and as long as this has not been resolved, I am actually stopped in my tracks, as the software I am using will be broken… :frowning:
Any help is appreciated!

Hi:
I’m sorry we didn’t explain the new changes, which caused you trouble.
As you expected, this PCB change is to change the battery detection pin from 13 (ADC2) to 37 (ADC1). This is to avoid the limitation in the ESP32 chip: When WIFI is enabled, ADC2 is occupied by WIFI can not work.
If you need to continue to use the battery test, just change the 13 in the original routine to 37.
Sorry for the trouble, and I apologize again.:sob: