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

ADC to measure battery voltage

setup, I have a 3.3 V battery divided down to the bandgap range using a 56k and 10k resistors, so the voltage at the ADC input is 3.3 * (10/66) = 0.5 V,but the fact is 0.498V

I've configured the ADC to convert at 8 bits, to use no prescaler, and to use the internal VBG as reference.

The result i get is 0x6A, or 106, which translates to a measured battery voltage of: (106/256) * 1.2 = 0.497V

I've configured the ADC to convert at 9 bits, to use no prescaler, and to use the internal VBG as reference. The result i get is 0xD3, or 211, which translates to a measured battery voltage of: (211/512) * 1.2 = 0.495V

I've configured the ADC to convert at 10 bits, to use no prescaler, and to use the internal VBG as reference. The result i get is 0xA7, or 167, which translates to a measured battery voltage of: (167/1024) * 1.2 = 0.196V

The experimental results showed that the higher the digits of the ADC, the lower the accuracy,who can tell me why?

Thanks in advance. image descriptionimage description(/attachment/812a68ec1416b4b3bbb18257b6025536) image descriptionimage description(http://)

Parents
  • Maybe you're loosing MSB somehow? Take your value of 0xA7, add the (possibly) lost MSB, thus 0x1A7 = 423 and you'll get 0.496V, pretty in line with your expected result.

    Anyway, even 0.495 can't really be considered "less precise", as at 8bits, your LSB step is almost 5mV. The fact that you "measured" 0.498 is just a coincidence, it could as well easily be 0.493 or 0.503, both far within the ADC specification (read on quantization noise and all the documented nonlinearities of the ADC).

    Also, I would suggest going with much higher resistances (with a capacitor for better sampling) in the divider, this one is adding 50uA to your power consumption, something you can't really afford for a battery powered device.

Reply
  • Maybe you're loosing MSB somehow? Take your value of 0xA7, add the (possibly) lost MSB, thus 0x1A7 = 423 and you'll get 0.496V, pretty in line with your expected result.

    Anyway, even 0.495 can't really be considered "less precise", as at 8bits, your LSB step is almost 5mV. The fact that you "measured" 0.498 is just a coincidence, it could as well easily be 0.493 or 0.503, both far within the ADC specification (read on quantization noise and all the documented nonlinearities of the ADC).

    Also, I would suggest going with much higher resistances (with a capacitor for better sampling) in the divider, this one is adding 50uA to your power consumption, something you can't really afford for a battery powered device.

Children
  • thanks.i use 10K and 56K,capacitor is 100nF.it add 45ua to my power consumption.How to reduce power dissipation in this respect?

  • You'd go with higher resistances and lower capacitor - higher resistance to reduce the power consumption, but you may need to reduce the capacity to get reasonable response time - the divider, together with the capacitor forms an RC filter element. If you use 10x the resistance, you'd have to reduce the capacity 10-fold to keep the same time constant. You can safely go as low as 1nF, below that, you'd start loosing the other important property of the filter - supplying the ADC input during the sample phase.

  • Hello Zcmm could you please tell me how you measure the voltage present on the analog pin 6 i also followed the procedure exactly similar to you but when i measured the voltage available on PIN0.06 by using mulitmeter it is showing 0volt only so i am bit confussed how to monitor the voltage availble on the ADC PIN because am trying to measure to battery voltage and send over the bluetooth to notify the peripheral about the battery percentage

Related