Arduino ADS1115 Module Getting Started Tutorial
Arduino ADS1115 Module Getting Started Tutorial
Started Tutorial
Contents [hide]
1 Introducing A Low Cost and Precise Arduino Measurement
2 Getting One
3 Arduino ADS1115 16 Bit DAC Module Pin Outs
4 Arduino ADS1115 16 Bit DAC Module Addressing
5 Understanding the ADS1115 Resolution
o 5.1 Is it 15 or 16 bits?
o 5.2 ADS1115 Full Scale and the Value of Bit
6 ADS1115 Maximum Measurement Range
7 Arduino ADS1115 Analog to Digital Converter Simple Tutorial
o 7.1 Download and Install the Adafruit ADS1X15 Library
o 7.2 Connect the ADS1115 Module to Your Arduino
o 7.3 Copy, Paste and Upload the ADS1115 Arduino Sketch
o 7.4 Verify Your Tutorial Output
See how to make a differential measurement using your ADS1115. This type of measurement
allows you to make negative voltage measurements as well.
Getting One
As depicted in pin-out drawings below, the ADS1115 module comes in a couple common
varieties. They are available from any of the outlets below.
This next module is less common. The address is preset to 0x48. It also does not include the
Alert/Ready signal. In most applications, you will not require this signal.
What this means is that there are 32,768 possible output values, where zero is the first and
32,767 is the last.
Bottom line is that is indeed a 16 bit device, but only 15 of those bits are use to communicate the
magnitude of the measurement.
ADS1115 Full Scale and the Value of Bit
The value of a bit is determined by the Programmable Gain Amplifier (PGA) setting as is this
setting establishes full scale. This differs from the Arduino where full scale is determined by a
reference voltage. (The PGA will be discussed in another article).
In the default mode, the setting is +/-6.144 volts.
Dividing 6.144 volts by 32767 yields a scale factor of 0.1875 mV per bit. This is a significant
improvement over the Arduino ADC which resolution of approximately 5 mV per bit. In fact, its
about 26 times better!
The neat thing about this is that this is worst case. In another PGA setting, you can establish a
full scale of +/- 2.048 volts. That provides us a resolution of 0.0635 mV.
Instead, the maximum measurable voltage is established by the supply voltage to the
chip. Specifically, the maximum measurable voltage is 0.3 volts more than the supply
voltage. In fact, exceeding this voltage at your analog input may damage your chip.
Note the differentiation here between the PGA range and the maximum measurable voltage. The
programmed range determines the value of a bit (or scale factor), while the maximum
measurable range determines what your analog input can safely handle.
In running this tutorial, we’re going to make use of a library distributed by Adafruit.
#include <Wire.h>
#include <Adafruit_ADS1015.h>
Adafruit_ADS1115 ads(0x48);
float Voltage = 0.0;
void setup(void)
{
Serial.begin(9600);
ads.begin();
}
void loop(void)
{
int16_t adc0; // we read from the ADC, we have a sixteen bit integer as a result
adc0 = ads.readADC_SingleEnded(0);
Voltage = (adc0 * 0.1875)/1000;
Serial.print("AIN0: ");
Serial.print(adc0);
Serial.print("\tVoltage: ");
Serial.println(Voltage, 7);
Serial.println();
delay(1000);
}
Notice how rock steady the result is. The difference between readings is less than one millivolt.
Now, what’s hard to determine is if that fluctuation is due to the 3.3 volt output from the
Arduino, the ADS1115 or a combination of the two.
Never-the less, what we clearly have is a measurement that is very repeatable (precise). In fact,
repeat-ability is often a lot more useful in measurements than accuracy. We can quantify the
error in a very repeatable measurement and apply a little math to make it very accurate.
When the measurement is not very precise, we are stuck with a degree of uncertainty that is very
difficult to correct for.