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

Testing the Battery Service

Dear Sir,

I am using SDK15 and sodtdevice S132. I am testing on the kit BMD300.

I am using nRFConnect App in andoird  to connect to the device and check the services.

How can I test the battery service to check whether it is giving the correct status or not?.. 

Should I put a battery and check it? Or is there any other options to verify the working of the battery service?

Thanking you in advance

with regards,

Geetha

Parents
  • Hi,


    There are 2 ways to test the battery service.


    1) ADC: Use the ADC to do real battery measurements. You can test this with the ble_app_proximity exampleThe example uses the ADC peripheral to measure the battery level every 2 minutes. If there is a change in the battery level, the application sends the current level as notification. You should test this with a CR2032 battery.


    2) Simulator: Use a simulator to provide the battery measurements. You can test this with the ble_app_hts example.

  • Hi Sigurd, I was using the Battery service in "\nRF5_SDK_15.0.0_a53641a\examples\ble_peripheral\ble_app_bps".

    I think the battery service implemented here is not using adc.. Is this work correctly?.Do we need any external module/connection for this?...

    After  connecting to the device , each time I press the 'down arrow' in battery service, it is giving different values?

    Please  let me know if I went wrong somewhere?

  • I think the battery service implemented here is not using adc.. Is this work correctly?

    That is correct. In ble_app_bps we are using the simulator.

    Do we need any external module/connection for this?

    The ADC can measure VDD directly. So if you are powering the chip directly from battery, you don't need any external module.

    After  connecting to the device , each time I press the 'down arrow' in battery service, it is giving different values?

    The simulator values will vary between MIN_BATTERY_LEVEL and MAX_BATTERY_LEVEL. So if you are testing ble_app_bps, this is the expected behavior.

  • Hi, Thank you for the reply.

    So if I want to build a BLE device on my own and if I want to use the battery service to get battery status, am I supposed to use the service which works with adc?

    Or both ways(one with adc as well as the one with simulator) will give the correct answer?

    Because in both cases I am getting different values?(I was expecting both of them to display the same value for battery status)

    I am confused which one to use in my code base..

    Please shed some light on this.

    Thanking you.

Reply
  • Hi, Thank you for the reply.

    So if I want to build a BLE device on my own and if I want to use the battery service to get battery status, am I supposed to use the service which works with adc?

    Or both ways(one with adc as well as the one with simulator) will give the correct answer?

    Because in both cases I am getting different values?(I was expecting both of them to display the same value for battery status)

    I am confused which one to use in my code base..

    Please shed some light on this.

    Thanking you.

Children
Related