Send Battery Level notifications to nRF Connect app when battery level reaches certain level

Hello,
I am new to BLE and I need help with Battery Service notifications. I am using nrf52840dk, nrf sdk 17.1.0 and I am using ble_app_proximity example which already uses Battery Service.
I need to send a pop up notification from device to nRF Connect mobile app when battery level reaches 40%. Whenever battery level reaches 40%, a notification should pop up telling us that battery level has reached 40% please charge.

Can anyone please help me with this?

Thanks,
Kanthi Deep.

Parents
  • Hello Kanthi Deep,

    Can anyone please help me with this?

    Absolutely, you've come to the right place! :) 

    I am new to BLE and I need help with Battery Service notifications. I am using nrf52840dk, nrf sdk 17.1.0 and I am using ble_app_proximity example which already uses Battery Service.
    I need to send a pop up notification from device to nRF Connect mobile app when battery level reaches 40%. Whenever battery level reaches 40%, a notification should pop up telling us that battery level has reached 40% please charge.

    In the default ble_app_proximity application the battery notification will be sent as part of the handling for the NRF_DRV_SAADC_EVT_DONE event, through the call to ble_bas_battery_level_update. If you would only like it to update when it is 40% or lower you will need to implement a check or conditional here that verifies that the condition is met before the notification is sent.
    You could probably also reduce the sampling rate to be much more seldom before you are at < 40% for the first time, to conserve power, for instance.

    Best regards,
    Karl

Reply
  • Hello Kanthi Deep,

    Can anyone please help me with this?

    Absolutely, you've come to the right place! :) 

    I am new to BLE and I need help with Battery Service notifications. I am using nrf52840dk, nrf sdk 17.1.0 and I am using ble_app_proximity example which already uses Battery Service.
    I need to send a pop up notification from device to nRF Connect mobile app when battery level reaches 40%. Whenever battery level reaches 40%, a notification should pop up telling us that battery level has reached 40% please charge.

    In the default ble_app_proximity application the battery notification will be sent as part of the handling for the NRF_DRV_SAADC_EVT_DONE event, through the call to ble_bas_battery_level_update. If you would only like it to update when it is 40% or lower you will need to implement a check or conditional here that verifies that the condition is met before the notification is sent.
    You could probably also reduce the sampling rate to be much more seldom before you are at < 40% for the first time, to conserve power, for instance.

    Best regards,
    Karl

Children
Related