cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WLE5CC ADC Battery Measurement doesn't give stable output, voltage is fluctuating.

DBhut.1
Senior

Hello,

I am using STM32WLE5CC MCU with STM32Cube IDE, and used Lorawan as End Node.

I am trying to read battery Voltage from STM32WLE5CC internal ADC Battery Channel, I got fluctuating voltage level from it.

I see 254, 201,220 like values, which is not usable to justify battery actual level.

Please help me to find solution of this issue?

Thank You

4 REPLIES 4
DBhut.1
Senior

Hello ST Community Members and ST employees, Please provide your valuable response regarding this case.

KiptonM
Lead

Let me guess, you have a small size chip that uses the power in as a reference. Make sure you calculate the reference voltage and use that in the calculation of the battery voltage. The voltage will vary as the processor runs different instructions. More capacitance on the power in will help. But make sure you have a 0.1 uF capacitor as close to the processor power and ground pins as physically possible.

Finally there is such a thing as ground bounce, where something switching current on the board changes the level of the ground somewhere else as it ripples. A ground plane helps this or careful routing of the ground net.

It also may be that the battery voltage drops when the device is using more current and rises when it is not.

There is really not a lot to go on based in the information in your question.

DBhut.1
Senior

Thanks for response,

I have 0.1uF near to Vcc of STM32WLE5CC, and PCB has enough GND plane according to PCB Design Guidelines,

I am using default generated library functions GetBatteryLevel()(used in Lorawan), this function uses internal Calibaration values.

I observed that When Data Send Over Lorawan (consumes 140mA), then battery Level reduces sharply.

So, Is there is method I can use to solve this issue, as I need exact battery level.

Thank You

ONadr.1
Senior III

You have exact battery level, but battery voltage is not stable. The best you can do, is an aritmetic mean from several measurements reasonably spread over time.