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?

  • Hi Ole, I edited the question a little. We are using dev. board only as power supply (3V) and for programming our devices (tags with nrf chip and a few external parts). Now I measured the VDD, AVDD pins and the battery holder they shown the same voltage. The problem is that ADC measurement shows correct values when the board is powered with external supply (3V from dev board pca10000). After I power the board with the battery the adc values become significantly lower than ones measured by the multimeter on VDD pins. The battery and external supply nonnected in the same point of the board and VDD has capacitors connected as described in PS. The lower battery voltage is the bigger differentce in measurements onserved. For example: Mulimeter - 2.95V -> ADC 2.86 (delta = 90mV), Mulimeter - 2.77V -> ADC 2.32 (delta = 450mV!!). Currently I have no idea what to try next(

  • Good you found the cause, I was running out of options. Your battery is old, and coin cell batteries will have higher internal resistance at end of life, but this would mean a resistance of almost 1K which is very high. A capacitor will work, do a search for "coin cell internal resistance" on google. However using a new battery should be adequate, if the battery voltage is too low you should change the battery anyhow.

  • Yes, but 4mA for single ADC conversion (measured with new cr2032) is quite strange for me. Is my ADC configuration wrong?

  • The CPU is probably running (forgot about that), this requires additionally 4.1 mA + HFCLK current (800-900uA). The ADC requires only HFCLK and 1V2 to run which will result in 260uA+880uA=1140uA. You can trigger the ADC to start from a timer using PPI and then only wake up the CPU after the sample to read the data.

  • Could you post an answer with the added stuff, and accept and close it, so that other people can see what the solution was?

Related