This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nrf52832 ble battery display

Hi, i'm developing BLE nrf52832.

Is there any way to display the remaining battery capacity on that window 10 when connecting to Bluetooth like that picture?

The remaining battery capacity was implemented through the SAADC function, but development has stopped because there is no way to display the remaining battery capacity.

Parents
  • Hi,

    Last time I checked if you used for instance the HID mouse or HID keyboard example from the nRF5 SDK you can see that the battery level changes in Windows 10. Note however in that case the battery level is emulated for demonstration, so it doesn't read the SAADC in specific, but you can see that the battery level changes. Have you tried that example for comparison? 

    Kenneth

  • Hi,kenneth

    The development was focused on Bluetooth, so SAADC example code was attached to the HID keyboard example.Does the example of the HID keyboard contain a function that can measure battery levels? Can you show us an example?

  • I don't have any ready made example for you.

    Looking at implementation ble hids mouse I can find that the battery measurement is emulated, you can find that the battery level changes between 81% and 100% in main.c:

    sensor_simulator_init() - init the simulator

    battery_level_update() - update the battery values

    The ble_bas_battery_level_update() set the actual battery to 'battery_level' in battery_level_update(). You need to replace 'battery_level' from an actual SAADC measurement.

    So, in your case you need to measure the battery level, and the battery level needs to be 0-100% depending on the state of the battery. I can find this case:

    https://devzone.nordicsemi.com/f/nordic-q-a/50141/how-to-measure-a-state-of-a-battery-by-using-saadc-example-with-nrf52832

    Where I can find that someone made an example that converted the measured SAADC value to a battery percentage level between 0-100%.

    Best regards,
    Kenneth

Reply
  • I don't have any ready made example for you.

    Looking at implementation ble hids mouse I can find that the battery measurement is emulated, you can find that the battery level changes between 81% and 100% in main.c:

    sensor_simulator_init() - init the simulator

    battery_level_update() - update the battery values

    The ble_bas_battery_level_update() set the actual battery to 'battery_level' in battery_level_update(). You need to replace 'battery_level' from an actual SAADC measurement.

    So, in your case you need to measure the battery level, and the battery level needs to be 0-100% depending on the state of the battery. I can find this case:

    https://devzone.nordicsemi.com/f/nordic-q-a/50141/how-to-measure-a-state-of-a-battery-by-using-saadc-example-with-nrf52832

    Where I can find that someone made an example that converted the measured SAADC value to a battery percentage level between 0-100%.

    Best regards,
    Kenneth

Children
No Data
Related