cyble-222014-01 battery level

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
MaLa_2536816
Level 3
Level 3
First like received

Hi,

I try to use the code example BLE_Battery_Level.

I change the target decice to use CYBLE-222014-01 eval board with the CY8CKIT-042-BLE Pioneer kit.

I connect the jumper from P3[5] to VREF on the Pioneer board

The reading it not good. It's 100% all the time.

How can I fix that?

Regards

Martin

0 Likes
1 Solution
Anonymous
Not applicable

To read the battery voltage on a chip that is powered by the battery you want to measure, then you will need to create your own scale of which voltages correspond to which % charge of the battery.

Otherwise, one method I am using that seems to work well, is to put a large resistor bridge with known resistor values across the battery voltage, and to measure the midpoint voltage with respect to the 1.2 V internal voltage reference on the chip (if available). Using the internal reference is the only good way that I've seen, as the comparisons with the ADC need to have a reference, and any reference to the battery voltage itself will be a tautological measurement

tl;dr; You need to setup your ADC to measure the battery voltage with reference to a fixed voltage level; The 1.2 V internal reference is useful for this and is normally available on Cypress' chips. You will need to scale the voltage value with resistors to be from 0 to 1.2 volts (the reference voltage that is fixed) to get a percentage reading. Some math will need to be used to compensate for the reading from the ADC being a numerical count from 0 to ~0 to be converted to 0% to 100%

View solution in original post

0 Likes
6 Replies
SrikanthD_56
Employee
Employee
25 sign-ins First question asked First comment on blog

Hi,

When you connect positive input of the ADC (Vref pin (P3[5]) in your project ) to VREF pin on the BLE Pioneer Kit you will always see 100% (battery voltage equal to VDD voltage).

Connect pin P3[5] to GND on the BLE Pioneer Kit and that should change the Battery voltage 0%.

Refer to the Project Description section of the project datasheet (BLE_Battery_Level.pdf present in the project folder) for details.

0 Likes

Hi,

So if I connect to VREF I always have 100% or connect GND it's 0%.

How do I get the value ?

Martin

0 Likes

What output are you expecting out of this project? What value are you trying to get?

0 Likes

I want to have the actual battery level

0 Likes

Ok, hope you are not powering the kit with any other sources than coin-cell battery (make sure to disconnect the USB cable after programming).

Also measure the actual battery voltage using a multi-meter. If the measured voltage is ~3V you are likely to see 100%.

0 Likes
Anonymous
Not applicable

To read the battery voltage on a chip that is powered by the battery you want to measure, then you will need to create your own scale of which voltages correspond to which % charge of the battery.

Otherwise, one method I am using that seems to work well, is to put a large resistor bridge with known resistor values across the battery voltage, and to measure the midpoint voltage with respect to the 1.2 V internal voltage reference on the chip (if available). Using the internal reference is the only good way that I've seen, as the comparisons with the ADC need to have a reference, and any reference to the battery voltage itself will be a tautological measurement

tl;dr; You need to setup your ADC to measure the battery voltage with reference to a fixed voltage level; The 1.2 V internal reference is useful for this and is normally available on Cypress' chips. You will need to scale the voltage value with resistors to be from 0 to 1.2 volts (the reference voltage that is fixed) to get a percentage reading. Some math will need to be used to compensate for the reading from the ADC being a numerical count from 0 to ~0 to be converted to 0% to 100%

0 Likes