- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Solved! Go to Solution.
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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%
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
So if I connect to VREF I always have 100% or connect GND it's 0%.
How do I get the value ?
Martin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What output are you expecting out of this project? What value are you trying to get?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I want to have the actual battery level
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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%.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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%