Heltec Lora V3 Battery Read

Hello

When i use esp-idf to read the battery level (12 bit 0db attn) from GPIO1 (adc unit 1 channel 0), and after writing pin 37 low, i get extremely low values for what i believe it a fully charged battery (or 3 - they all show the same). The raw read values don’t seem to rise above 292 out of a range upto 4095.

Now i know there are a couple resistors, which ultimately should mean the level is going to be around 0.87v, and attn 0db works upto 1.1v. So i’d expect with a full battery to get around about 3,238 on a raw read?

Am i correct in that analysis? What raw values are you reading from vbat_read?

Thanks in advance

There is a problem with lora transmission drawing high current while reading the battery values, they gives lower readings - Heltec have still not addressed this issue.

Thanks for the reply. It’s not that though. I’ve put the battery reading code in main before anything else runs, to isolate it, so the radio is not on or anything else for that matter. I actually get a realistic result by not writing 37 low and setting attn to 12 however it’s advised not to do that as the max is 3.9v. I’m led to believe the two resistors should mean attn 0 is correct and 1.1v is enough.

I’m fast coming to the conclusion that 37 needs to be high on my board - then i get values such as 3527 for my battery which translates to around 3.663 volts on a scale of 0 to 4095 where 1.1v is 4095 and the resistors scale to around 0.87v max. Its completely reversed in terms of operation according to all the examples i’ve seen where 37 is supposed to be low

Are you using a V3.2 board? If so, check out the control circuitry in the schematic for that board (note that this is not the scehmatic diagram that will show up if you click on the link provided on the Heltec product documentation link on their website (!), you have to actually dig down into the resources directory to find it—it is indeed completely reversed. There’s an extra transistor in the circuit now, in addition to completely new components in the battery management circuit…

2 Likes

Wow. You are right. Many thanks :slight_smile: I was pulling my hair out. My board does indeed say 3.2 on it. The product docs linked to 3.1 schematics. I guess i just thought a minor revision would not mean something so fundamental had changed.

And, IMHO, you’d be entirely justified in that thinking…

1 Like