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

Why Vsupply measurement is inaccurate in nRF51?

Hello all, to optimize the BOM and size of our device(Tag based on nRF51822), the external divider was replaced by software configuration to measure the battery voltage. In our design the CR2032 cell was used and connected to nRF51 directly. We have chosen a free AIN pin and configured it with next:

- SupplyOneThirdPrescaling  ADC_CONFIG_INPSEL_SupplyOneThirdPrescaling 

- ADC_CONFIG_RES_10bit

- ADC_CONFIG_REFSEL_VBG

Edited: To be more precise

	NRF_ADC->CONFIG     = (ADC_CONFIG_RES_10bit<< ADC_CONFIG_RES_Pos)|(ADC_CONFIG_INPSEL_SupplyOneThirdPrescaling << ADC_CONFIG_INPSEL_Pos)|(ADC_CONFIG_REFSEL_VBG << ADC_CONFIG_REFSEL_Pos)|(ADC_CONFIG_PSEL_Disabled<<ADC_CONFIG_PSEL_Pos)|(ADC_CONFIG_EXTREFSEL_None<< ADC_CONFIG_EXTREFSEL_Pos);

So than I calculate supply voltage as

   Vin = (ADCres*1.2V/1024)*3

If I power my device from Dev.board (2.95V) the conversion results correctly and device show 2.95V measured. However, if I power the device with cr2032 cell (not new) the voltage measured on inserted in device's slot is 2.86V but ADC conversion results with value 2,73V. So I have a few questions:

  1. How stable is value of VBG?

  2. Is there any circuit between the Vcc pin and divider "SupplyOneThirdPrescaling" inside of the chip?

  3. What is SupplyOneThirdPrescaling divider accuracy?

Please help.

P.S. The average current consumption of device is about 200uA. The Vcc pin was measured with osciloscope, the voltage ripples are about 1-3mV.

Best regards,

Added: CR2032 powered tag. Voltage kink at ADC measurement I measured battery voltage at igher time resolution and noticed a voltage kink with same period as the ADC measurement occured. It explains the measurement results (bottom part of voltage kink has the same value as measured by ADC). However, that to do next is unclear. To add huge uF cap? The PS says: "I ADC - Current drawn by ADC during conversion. - 260 μA" and it doesnt seem to be so high to make such voltage lowering.

Added: I also measured the current. Each time when ADC measurement occured the 4mA current pulse noticed. Could internal 1/3 divider cause such current flow?

  • Next time reviewed my code and have some result. For device powered from CR2032 the ADC measurement depend on what clock used when ADC conversion occured. Here I read that ADC conversion accuracy is as in specification only when HF clock used. I tried this and ADC result was worse (delta 0.3V compated to multimeter) than at LF clock. At LF clock delta is about 0.1-0.18V compated to multimeter. I took all batteries on the table and compared them all. ( Plot). The liniar dependence noticed (VMM- multimeter voltage, VADC- voltage measured by ADC of nRF51). To make voltage be equal to the multimeter (Agilent U1253A) I use formula Vbat= Vadc*1000/988 and it's work. The pin+ of battery connected directly to Vcc pin.

  • Hello Valeur, could you please describe me the steps how did you manage o find the voltage present on the ADC pin because am also facing similar kind of situation providing2.89volt to he DK and trying to find out how much voltage present on the adc pin any suggesion or ideas would be helpful for me

  • Hi, this thread is about measuring Vsupply not on pin but inside of chip using "SupplyOneThirdPrescaling setting". You should start from example. My problem is that ADC measurement provides voltage drop on the battery, so measured value is lowered. Could you describe your problem into more details?

  • i would like to measure the battery voltage and advertise it and i can be visible in the MCP Control panel as i have checked my vdd pin it shows 2.89v but i wanted to measure that batttery voltage value via ADC configuration in order to make sure whatever battery percentage visible in MCP are true value so i need your help in order to measure the ADC VALUE to determine the Battery percent

Related