Capacitor discharging total charge calculation

capacitor

I need to estimate the total charge that flowed from the capacitor for a short duration of 2ms. I am using an ATmega128 for this. Can someone advise me if analog sample/hold in front of an ADC is applicable for this? Or some other analog solution perhaps? I am not very familiar with this measurement procedure. Please see this picture:

enter image description here

sch;
enter image description here

Best Answer

Q = CV so the loss of charge is also proportional to the loss of voltage (providing there isn't a recharge path that might be bolstering up the voltage).

If you know the capacitance then the the calculation is very straightforward.

Using a sample and hold (and ADC) that measures initial voltage (converts to digital and stores it) then measures final voltage (2 milli seconds later) and stores it is pretty much a normal sort of setup for analogue to digital converters. Virtually any off-the-shelf successive-approximation ADCs from TI, ADI, Maxim, NXP and Linear tech will fit the bill providing it has enough accuracy but that is delving into another area not covered in your question.