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

Monitor battery charge in hid keyboard example

The hid keyboard example includes the battery service. But how does it work? I would like to monitor the battery charge. After I use the voltage divider, to which AIN pin should I connect? Where will the battery charge be displayed?

Parents
  • Hi,

    Unfortunately, the ble_app_hids_keyboard example does not actually measure the battery voltage. It pass a simulated value to the battery service, see battery_level_update(). The ble_app_proximity example implements actual battery voltage measurement, you can use that as reference. Note that the proximity example use VDD as input. If you use a voltage divider, you should change the input to one of AIN0-AIN7 in parameter to NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE in adc_configure().

    Best regards,
    Jørgen

Reply
  • Hi,

    Unfortunately, the ble_app_hids_keyboard example does not actually measure the battery voltage. It pass a simulated value to the battery service, see battery_level_update(). The ble_app_proximity example implements actual battery voltage measurement, you can use that as reference. Note that the proximity example use VDD as input. If you use a voltage divider, you should change the input to one of AIN0-AIN7 in parameter to NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE in adc_configure().

    Best regards,
    Jørgen

Children
Related