This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

why proximity example shows always 100 battery

Hello,

I am trying to make battery service in my application so i refer the proximity example in SDK 9 and i flashed into my kit it showing always 100percent in the nordic app what needs to be done inorder t monitor the exact battery voltage interms of percentage in nordiac app ? i am new to this field so any sugeestion will be useful for me

Thank you

Parents
  • The problem is actually with the battery_level_in_percent(..) function. The battery level characteristic value is the percent capacity that is left in the battery. 100 percent means fully charged, 0 percent means fully discharged, see here. The function calculates the percent from the non-linear discharge curve of a CR2032 battery:

     *           - Section 1: 3.0V - 2.9V = 100% - 42% (58% drop on 100 mV)
     *           - Section 2: 2.9V - 2.74V = 42% - 18% (24% drop on 160 mV)
     *           - Section 3: 2.74V - 2.44V = 18% - 6% (12% drop on 300 mV)
     *           - Section 4: 2.44V - 2.1V = 6% - 0% (6% drop on 340 mV)
    

    When running from usb power, the voltage is higher than 3V and the function will always show 100 percent. If you run it from a battery, the value will probably be less than 100 percent.

    Note also that the notification must be enabled (enable services in MCP) for the battery measurements to start (battery measurement timer is started in BLE_BAS_EVT_NOTIFICATION_ENABLED event) and that the default measurement period is 120 seconds, so the value will not be updated at once.

Reply
  • The problem is actually with the battery_level_in_percent(..) function. The battery level characteristic value is the percent capacity that is left in the battery. 100 percent means fully charged, 0 percent means fully discharged, see here. The function calculates the percent from the non-linear discharge curve of a CR2032 battery:

     *           - Section 1: 3.0V - 2.9V = 100% - 42% (58% drop on 100 mV)
     *           - Section 2: 2.9V - 2.74V = 42% - 18% (24% drop on 160 mV)
     *           - Section 3: 2.74V - 2.44V = 18% - 6% (12% drop on 300 mV)
     *           - Section 4: 2.44V - 2.1V = 6% - 0% (6% drop on 340 mV)
    

    When running from usb power, the voltage is higher than 3V and the function will always show 100 percent. If you run it from a battery, the value will probably be less than 100 percent.

    Note also that the notification must be enabled (enable services in MCP) for the battery measurements to start (battery measurement timer is started in BLE_BAS_EVT_NOTIFICATION_ENABLED event) and that the default measurement period is 120 seconds, so the value will not be updated at once.

Children
No Data
Related