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

Why is 270 mV offset added to voltage read by ADC?

In this example code:

nRF5_SDK_13.0.0_04a0bfd/examples/ble_peripheral/ble_app_proximity/main.c

Where the ADC is configured to read the battery voltage:

nrf_saadc_channel_config_t config =
    NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE(NRF_SAADC_INPUT_VDD);

Why is this 270 mV offset added to the voltage read by the ADC?

/**< Typical forward voltage drop of the diode . */
#define DIODE_FWD_VOLT_DROP_MILLIVOLTS  270

batt_lvl_in_milli_volts = ADC_RESULT_IN_MILLI_VOLTS(adc_result) +
                  DIODE_FWD_VOLT_DROP_MILLIVOLTS;

percentage_batt_lvl = battery_level_in_percent(batt_lvl_in_milli_volts);

Is that 270 mV offset only appropriate when running on the nRF52-DK, or also when running the nRF52832 powered from battery?

Thanks.

Related