# Analog to digital conversion with variable VCC

I would like to build a circuit of a microcontroller reading an analog accelerometer, without the use of a voltage regulator. The problem would be that the battery's voltage will gradually decrease with time changing the VCC of the accelerometer and microcontroller.

In this case, the obvious problem when finding the step for the analog to digital conversion:

$$step = \frac{VCC}{1023}$$

Is that the step is dependent of VCC and will change with it.

Is it possible to do analog to digital conversion with variable VCC?

• If the accelerometer has a proportional to VCC output (like many strain gauges etc) then converting with respect to VCC is what you need to do. Otherwise, many microcontrollers have an option to reference the ADC to a fixed reference, and most will be able to reference to an external reference. Mar 25, 2016 at 12:23
• In other words, provide a link to the accelerometer. Mar 25, 2016 at 12:25
• @Neil_UK but VCC will keep changing. How do I keep reading the VCC? Mar 25, 2016 at 12:39
• You don't need to read Vcc, the accelerometer outputs a proportional voltage, the ADC reads a proportional voltage, VCC cancels automagically! Mar 25, 2016 at 12:51
• @Neil_UK I see. I basically convert directly from binary to gravity instead of binary to voltage. I don't need to know VCC. Mar 25, 2016 at 13:01