Hello so I have a code for my ADS1115
`#include <Wire.h> #include <Adafruit_ADS1X15.h>
Adafruit_ADS1115 ads; // create ADS1115 object
void setup() {
Serial.begin(9600); // initialize serial communication
Wire.begin(); // initialize I2C communication
ads.begin(); // initialize ADS1115
}
void loop() {
int16_t differential1 = ads.readADC_Differential_0_1(); // read differential voltage
float voltage1 = differential1 * 0.0078125; // convert to voltage (assuming default gain of 1)
Serial.print("Differential voltage weerstand: ");
Serial.print(voltage1, 3);
Serial.println("mV");
int16_t differential2 = ads.readADC_Differential_2_3(); // read differential voltage
float voltage2 = differential2 * 0.0078125; // convert to voltage (assuming default gain of 1)
Serial.print("Differential voltage stof: ");
Serial.print(voltage2, 3);
Serial.println("mV");
delay(1000); // wait for 1 second
}`
My question is what is the measured voltage error (absolute error)?
If you don't do any offset or gain calibrations and ignoring any errors do to drift, the worst case error will be around 0.156% of the full scale value (FSR).
So the way an ADS1115 works is it offers a 15 bit resolution based on the Full Scale Range, which is determined by the gain setting.
Your code says "assume default gain of 1". But you are not setting the gain so in fact that will default to gain of 2/3 which corresponds to a FSR of 6.144 volts.
That's not right at all because your default gain will set the FSR to 6144mV. So your code is not right, not only are the calculations incorrect but the comments are incorrect.