ADS111x Ultra-Small, Low-Power, I 2C-Compatible, 860-SPS, 16-Bit ADCs

EDUCATIONARDUINO

9/16/20233 min read

Description

If you are working in the field of embedded system you would have came across word ADC i.e analog to digital converter. Mostly we use ADC available in our microcontroller but when more precision is required we option for external one similar is ADS111X series by Texas Instrument.

ADS111x is Ultra-Small, Low-Power, I 2C-Compatible, 860-SPS, 16-Bit ADCs With Internal Reference, Oscillator, and Programmable Comparator.

Package available

X2QFN (10) 1.50 mm × 2.00 mm

VSSOP (10) 3.00 mm × 3.00 mm

We can use it for :

Portable Instrumentation , Battery Voltage and current sensing , Temperature measurement system , consumer electronics , Factory automation and process Control

Different version of ADS111X

Selecting the Right Address of ADS111X

The ADS111X has one address pin which can be used to get different address as given in the table below by connecting the ADDR pin to GND, VDD, SCL,SDA .

If a VDD supply voltage greater than 4 V is used, the ±6.144 V full-scale range allows input voltages to extend up to the supply. Although in this case (or whenever the supply voltage is less than the full-scale range; for example, VDD = 3.3 V and full-scale range = ±4.096 V), a full-scale ADC output code cannot be obtained. For example, with VDD = 3.3 V and FSR = ±4.096 V, only signals up to VIN = ±3.3 V can be measured. The code range that represents voltages |VIN| > 3.3 V is not used in this case.

ESP32 Code

#include <Adafruit_ADS1X15.h>

Adafruit_ADS1115 ads; /* Use this for the 16-bit version */

//Adafruit_ADS1015 ads; /* Use this for the 12-bit version */

void setup(void){

Serial.begin(9600);

Serial.println("Hello!");

Serial.println("Getting single-ended readings from AIN0..3");

Serial.println("ADC Range: +/- 6.144V (1 bit = 3mV/ADS1015, 0.1875mV/ADS1115)");


// The ADC input range (or gain) can be changed via the following

// functions, but be careful never to exceed VDD +0.3V max, or to

// exceed the upper and lower limits if you adjust the input range!

// Setting these values incorrectly may destroy your ADC!

// ADS1015 ADS1115

// ------- -------

// ads.setGain(GAIN_TWOTHIRDS); // 2/3x gain +/- 6.144V 1 bit = 3mV 0.1875mV (default)

// ads.setGain(GAIN_ONE); // 1x gain +/- 4.096V 1 bit = 2mV 0.125mV

// ads.setGain(GAIN_TWO); // 2x gain +/- 2.048V 1 bit = 1mV 0.0625mV

// ads.setGain(GAIN_FOUR); // 4x gain +/- 1.024V 1 bit = 0.5mV 0.03125mV

// ads.setGain(GAIN_EIGHT); // 8x gain +/- 0.512V 1 bit = 0.25mV 0.015625mV

// ads.setGain(GAIN_SIXTEEN); // 16x gain +/- 0.256V 1 bit = 0.125mV 0.0078125mV


if (!ads.begin()) {

Serial.println("Failed to initialize ADS.");

while (1);

}

}

void loop(void)

{

int16_t adc0, adc1, adc2, adc3;

float volts0, volts1, volts2, volts3;

adc0 = ads.readADC_SingleEnded(0);

adc1 = ads.readADC_SingleEnded(1);

adc2 = ads.readADC_SingleEnded(2);

adc3 = ads.readADC_SingleEnded(3);

volts0 = ads.computeVolts(adc0);

volts1 = ads.computeVolts(adc1);

volts2 = ads.computeVolts(adc2);

volts3 = ads.computeVolts(adc3);


Serial.println("-----------------------------------------------------------");

Serial.print("AIN0: "); Serial.print(adc0); Serial.print(" "); Serial.print(volts0); Serial.println("V");

Serial.print("AIN1: "); Serial.print(adc1); Serial.print(" "); Serial.print(volts1); Serial.println("V");

Serial.print("AIN2: "); Serial.print(adc2); Serial.print(" "); Serial.print(volts2); Serial.println("V");

Serial.print("AIN3: "); Serial.print(adc3); Serial.print(" "); Serial.print(volts3); Serial.println("V");


delay(1000);

}

Related Stories