I am using Adafruit ADS1015 (4 channel, 12 bit ADC, I2C…) https://www.adafruit.com/product/1083 in single-ended mode to monitor voltages and currents. This then outputs to Arduino pro-mini and LCD (via 74HC595, “3-wire”…).
The problem is that the least significant bit (LSB) on all 4 channels jitters. And of course, expected.
Now I tried reducing the programmable sample rate to minimum of 128SPS, and added “smoothing” with slight improvement, but still not right.
Relevant part of my sketch :
int chgaV = ads1015.readADC_SingleEnded(0);
int chgaVV = chgaV - 254.00 ; // sensor bias
float chgaVolts = chgaVV * 1.00 / 95.00 ; // ratio
totalC = totalC - readC[indexC] ;
readC[indexC] = analogRead (chgaVolts) ;
totalC = totalC + readC[indexC] ;
indexC = indexC + 1 ;
if (indexC >= numRsa)
indexC = 0 ;
averageC = totalC / numRsa ;
lcd.setCursor(0, 0);
lcd.print ("+ A");
if (chgaVolts < 0.04)
{ chgaVolts = 0.00 ; }
Now my thinking is that a much lower sample rate would be the answer as speed plays no part : a short delay is insignificant. For display purposes 2 to 4 samples/second would be adequate, e.g. 2…4SPS in the “one-shot mode”. This is tricky because the chip’s input caps are so small.
The clue …
and ...The ADS1013/4/5 have two available conversion
modes: single-shot mode and continuous conversion
mode. In single-shot mode, the ADC performs one
conversion of the input signal upon request and
stores the value to an internal result register. The
device then enters a low-power shutdown mode. This
mode is intended to provide significant power savings
in systems that only require periodic conversions or
when there are long idle periods between
conversions. In continuous conversion mode, theADC automatically begins a conversion of the input
signal as soon as the previous conversion is
completed. The rate of continuous conversion is
equal to the programmed data rate. Data can be read
at any time and always reflect the most recent
completed conversion.
The ADS1013/4/5 operate either in continuous
conversion mode or a single-shot mode that
automatically powers down after a conversion and
greatly reduces current consumption during idle
periods.
My idea is to triggers the ADC to run and capture all 4 inputs, latch the values and then “sleep” for 250 … 500mS.
Has anybody achieved results in this way, or another way?
Thanks so much in advance.