~~NOCACHE~~
====== LamaPLC: Texas Instruments ADCs: Standard multi-channel Analog Converters using I²C or SPI interfaces ======
Texas Instruments' ADCs are all delta-sigma converters that primarily differ in resolution, interface type, sample rate, and integrated features such as input channels and programmable gain amplifiers (PGAs).
The **ADS111x** series is a 16-bit, [[com:basic_i2c|I²C]]-compatible device, while the **ADS12xx** series is typically a 24-bit, [[com:basic_spi|SPI]]-compatible device with more advanced features for high-precision applications such as weighing scales and industrial process control.
===== ADS111x Series (16-bit, I²C) =====
{{ :sensor:ads1118.png?150|ADS1118}}
The Texas Instruments ADS111x series is a set of 16-bit-precision ADCs designed for low-power, space-constrained sensor measurement tasks. Key features include a broad supply-voltage range (2.0V to 5.5V), low current consumption (about 150µA in continuous operation), and built-in components such as a low-drift voltage reference and an oscillator.
**ADS111x General Specifications**
* **Resolution:** 16 bits
* **Supply Voltage Range:** 2.0 V to 5.5 V
* **Low Current Consumption:** Typically 150 µA in continuous-conversion mode
* **Internal Components:** All devices include a low-drift voltage reference and an internal oscillator.
* **Operating Temperature Range:** -40°C to +125°C
^Model^Interface^Channels (SE/Diff)^PGA^Comparator^Max Data Rate (SPS)^Unique Features|
^ADS1110|I²C|1 Diff|Yes (Gains up to 8)|No|240|Continuously self-calibrating|
^ADS1112|I²C|1 SE or Diff|Yes|No|240|(Similar to ADS1113/4/5 in core, but specific variant details are sparse)|
^ADS1113|I²C|1 SE or Diff|No|No|86|Basic model, minimal features|
^ADS1114|I²C|1 SE or Diff|Yes|Yes|860|Includes PGA and comparator|
^[[#ads1115|ADS1115]]|I²C|4 SE or 2 Diff|Yes|Ye|860|Input MUX for multiple channels|
^[[#ads1118|ADS1118]]|SPI|4 SE or 2 Diff|Yes|No|860|Integrated temperature sensor|
^ADS1119|I²C|4 SE or 2 Diff|Yes (Gains 1 or 4)|No|1000|Single-cycle settling filter at 20 SPS (for 50/60Hz rej.)|
==== ADS1115 ====
The ADS1115 is a compact, low-power 16-bit ADC made by Texas Instruments. It includes an onboard reference, oscillator, and a programmable gain amplifier (PGA), all accessible via an [[com:basic_i2c|I²C]] interface. This design makes it a popular choice for microcontrollers such as Arduino, Raspberry Pi, and ESP32.
**Key Features**
* **16-Bit Resolution:** Offers precise voltage measurements across fine scales.
* **Flexible Input MUX:** Operates as 4 single-ended or 2 differential inputs.
* **I²C Interface:** Supports four pin-selectable I²C addresses for multi-device setups.
* **Programmable Gain Amplifier (PGA):** Measures input ranges from ±256 mV to ±6.144 V.
* **Data Rates:** Supports programmable conversion speeds from 8 to 860 samples per second (SPS).
* **Comparator Mode:** Includes an onboard digital comparator for threshold-based interrupt alerts.
**Electrical Specifications**
* **Operating Voltage:** 2.0 V to 5.5 V.Ultra-Low Current Consumption: Consumes only 150 µA in continuous conversion mode.
* **Power-Down Mode:** Draws just 0.5 µA by automatically sleeping after a single conversion.
* **Packages:** Housed in ultra-small X2QFN-10 or VSSOP-10 layouts.
=== ADS1115 Pinout ===
{{ :sensor:ads1115_2.png?150|ADS1115 Pinout}}
^Pin Number^Pin Name^Pin Type^Description|
^1|ADDR|Digital Input|I²C slave address select pin.|
^2|ALERT/RDY|Digital Output|Comparator output or conversion ready indicator.|
^3|GND|Power|Ground connection.|
^4|AIN0|Analog Input|Analog input channel 0.|
^5|AIN1|Analog Input|Analog input channel 1.|
^6|AIN2|Analog Input|Analog input channel 2.|
^7|AIN3|Analog Input|Analog input channel 3.|
^8|VDD|Power|Power supply (2.0 V to 5.5 V).|
^9|SDA|Digital I/O|I²C serial data line.|
^10|SCL|Digital Input|I²C serial clock line.|
**I²C Address Selection (ADDR Pin)**
The ADDR pin allows you to choose between 4 unique I²C addresses by connecting it to different pins on your board:
* **GND:** 0x48 (Default address)
* **VDD:** 0x49
* **SDA:** 0x4A
* **SCL:** 0x4B
==== ADS1118 ====
The ADS1118, developed by Texas Instruments, is a precision, low-power 16-bit ADC that combines a programmable gain amplifier (PGA), a voltage reference, an oscillator, and a high-accuracy temperature sensor in a compact package.
**Key Features**
* **16-Bit Resolution:** Delivers high-precision measurements for small sensor signals.
* **Flexible Input MUX:** Configurable as 4 single-ended or 2 differential inputs.
* **Integrated Temperature Sensor:** Provides system-level monitoring or cold-junction compensation for thermocouples with a maximum 0.5°C error (0°C to 70°C).
* **Programmable Gain Amplifier (PGA):** Supports input ranges from ±256 mV to ±6.144 V.
* **SPI Interface:** Uses a serial peripheral interface (SPI) for high-speed microcontroller communication.
* **Data Rates:** Supports programmable conversion rates up to 860 samples per second (SPS).
**Electrical Specifications**
* **Operating Voltage:** 2 V to 5.5 V.
* **Low Power Consumption:** Designed specifically for energy-sensitive configurations.
* **Packages:** Available in ultra-small, leadless X2QFN-10 or standard VSSOP-10 formats.
=== ADS1118 Pinout ===
{{ :sensor:ads1118_2.png?180|ADS1118 Pinout}}
^Pin^Name^Type^Description|
^1|SCLK|Digital Input|SPI serial clock|
^2|CS|Digital Input|Chip select; active low|
^3|GND|Supply|Ground|
^4|AIN0|Analog Input|Analog input channel 0|
^5|AIN1|Analog Input|Analog input channel 1|
^6|AIN2|Analog Input|Analog input channel 2|
^7|AIN3|Analog Input|Analog input channel 3|
^8|VDD|Supply|Power supply (2V to 5.5V)|
^9|DIN|Digital Input|SPI serial data input (MOSI)|
^10|DOUT/DRDY|Digital Output|SPI serial data output / Data-ready (MISO)|
**Key Pin Notes**
* **DOUT/DRDY:** This pin serves a dual purpose. It provides serial data output and serves as a data-ready indicator, pulling low when a new conversion result is ready. An internal pull-up resistor can be enabled on this pin via software.
* **Analog Inputs (AIN0-AIN3):** These pins can be configured as four single-ended inputs (measured against GND) or two differential pairs (AIN0-AIN1 and AIN2-AIN3).
* **Input Limits:** Voltages on any analog input pin must remain between GND - 0.3V and VDD + 0.3V to prevent damage to the internal ESD diodes.
=== Arduino & ADS1118 ===
To interface the ADS1118 16-bit ADC with an Arduino, the most common approach is to use the **ADS1118 library** by denkitronik.
**Wiring Diagram**
The ADS1118 communicates via SPI. Connect it to your Arduino as follows:
^ADS1118 Pin^Arduino Pin (Uno/Nano)|
^VCC|3.3V or 5V|
^GND|GND|
^DIN (MOSI)|Pin 11|
^DOUT (MISO)|Pin 12|
^SCLK|Pin 13|
^CS|Pin 10 (or any digital pin)|
**Example Arduino Code**
This basic example initializes the ADC and reads the voltage from input AIN0 and the internal temperature sensor.
#include
#include
// Define the Chip Select (CS) pin
#define CS_PIN 10
ADS1118 ads1118(CS_PIN);
void setup() {
Serial.begin(115200);
// Initialize ADS1118 with default settings
ads1118.begin();
// Optional: Set sampling rate (e.g., 128 SPS)
ads1118.setSamplingRate(ads1118.RATE_128SPS);
}
void loop() {
// Read voltage from Single-Ended Input 0 (AIN0)
// Returns value in millivolts (double)
double voltage = ads1118.getMilliVolts(ads1118.AIN_0);
// Read internal chip temperature
double temp = ads1118.getTemperature();
Serial.print("Voltage AIN0: ");
Serial.print(voltage);
Serial.print(" mV | ");
Serial.print("Internal Temp: ");
Serial.print(temp);
Serial.println(" C");
delay(1000);
}
**Key Library Methods**
* //ads1118.begin():// Initializes the SPI communication.
* //getMilliVolts(input):// Takes the ADC reading and converts it directly to mV. Inputs can be single-ended (AIN_0 to AIN_3) or differential (DIFF_0_1, DIFF_2_3, etc.).
* //getTemperature():// Retrieves the temperature from the ADS1118's internal sensor.
* //setSamplingRate():// Adjusts speed from 8 SPS up to 860 SPS.
{{page>:tarhal}}
===== ADS12xx Series (Generally 24-bit, SPI) =====
The Texas Instruments **ADS12xx series** includes high-resolution, 24-bit delta-sigma ADCs designed mainly for precise measurement tasks such as weigh scales, strain gauges, and industrial process control. They come with built-in features such as onboard PGAs, internal references, and temperature sensors.
**ADS12xx Series Specifications**
^Model^Resolution (bits)^Interface^Max Data Rate (SPS)^Channels (SE/Diff)^PGA^Key Applications/Features|
^[[#ads1220|ADS1220]]|24|SPI|2k|4 SE or 2 Diff|Yes (up to G=128)|RTDs, thermocouples, integrated temp sensor, IDACs|
^ADS1232|24|Pin-driven Serial|80|2 Diff|Yes (up to G=128)|Weigh scales, strain gauges, simple control (no registers)|
^ADS1234|24|Pin-driven Serial|80|4 Diff|Yes (up to G=128)|Weigh scales, strain gauges, simple control (no registers)|
^ADS1256|24 (23 noise-free)|SPI|30k|8 SE or 4 Diff|Yes (up to G=64)|High speed, chopper-stabilized buffer, self/system calibration|
^ADS1261|24|SPI|38.4k|Multiple|Yes (up to G=32)|Low-noise, low-drift, IDACs for sensor excitation|
^ADS1263|24|SPI|38.4k|Multiple|Yes (up to G=32)|Same as ADS1261, but with an auxiliary 24-bit ADC|
**Key Takeaways**
* **The ADS1232 and ADS1234** are unique in that they are controlled via simple pin-driven commands, eliminating the need for complex register programming. They are specifically designed as a complete front-end solution for bridge sensors, such as weigh scales.
* **The ADS1256** offers a significantly higher maximum data rate of 30 kSPS compared to the 80 SPS of the ADS123x family, making it suitable for faster data acquisition while still maintaining high resolution.
* **The ADS1220, ADS1261, and ADS1263** include highly integrated features such as internal temperature sensors and programmable current sources (IDACs), simplifying designs for applications such as RTD measurements.
* **The ADS1263** is the most feature-rich, integrating a main 24-bit ADC and an additional auxiliary 24-bit ADC channel for background measurements.
==== ADS1220 ====
The ADS1220 is a compact 24-bit ADC developed by Texas Instruments. It includes two programmable current sources, a low-noise programmable gain amplifier (PGA), a voltage reference, and an internal temperature sensor, making it well-suited for precise sensor measurements.
**Key Features**
* **24-Bit Resolution:** Offers high accuracy for measuring microscopic voltage variations.
* **Flexible Input MUX:** Configurable as 4 single-ended or 2 differential inputs.
* **Low-Noise PGA:** Provides selectable gains from 1 to 128, optimizing small signal amplification.
* **Dual Programmable IDACs:** Integrated current sources (10 µA to 1.5 mA) for exciting RTDs and thermistors.
* **High Data Rates:** Supports data conversion speeds up to 2000 samples per second (SPS).
* **SPI Interface:** Uses a serial peripheral interface for simple, high-speed data transmission.
**Electrical Specifications**
* **Operating Voltage:** 2.3 V to 5.5 V (analog) and 2.7 V to 5.5 V (digital).
* **Low Power Consumption:** Only 120 µA in normal operating mode.
=== ADS1220 Pinout ===
{{ :sensor:ads_1220.png?220|ADS1220 Pinout}}
The ADS1220 is a 24-bit precision ADC. It uses an SPI-compatible interface and includes specific pins for dual-matched current sources (IDACs) and a low-side power switch.
**Key pins include:**
* **SPI interface pins** such as SCLK, CS (active low), DOUT/DRDY, and DIN.
* **Analog inputs** like AIN0 through AIN3.
* **Reference inputs** REFP0, REFN0, and the dual-function pins AIN0/REFP1 and AIN3/REFN1.
* **Supply pins** DVDD, DGND, AVDD, and AVSS.
* **The DRDY pin** indicates when new data is available.
* An **external clock input CLK** is also available.
For a detailed pinout, please refer to the [[https://www.olimex.com/Products/Breadboarding/BB-ADS1220/resources/ads1220.pdf|Olimex ADS1220 datasheet]].
**Critical hardware notes include**
* AIN0 and AIN3 serve as the external reference inputs REFP1/REFN1.
* The DRDY pin or DOUT can signal data readiness.
* The AIN3/REFN1 pin connects to an internal low-side switch.
* Decoupling capacitors are advised between AVDD/AVSS and DVDD/DGND
=== Arduino & ADS1220 ===
To use the ADS1220 with an Arduino, the **ADS1220_WE** library by Wollewald or the **Protocentral ADS1220** library is the most common option. Both are available via the Arduino Library Manager.
**Wiring Diagram (Typical)**
The ADS1220 uses the SPI protocol. Connect it to your Arduino (e.g., Uno) as follows:
^ADS1220 Pin^Arduino Uno Pin^Description|
^VDD|5V or 3.3V|Power Supply|
^GND|GND|Ground|
^SCLK|D13|Serial Clock|
^DOUT/DRDY|D12|MISO (Data Out)|
^DIN|D11|MOSI (Data In)|
^CS|D7 (selectable)|Chip Select|
^DRDY|D6 (selectable)|Data Ready Indicator|
**Basic Example Code**
This example uses the **ADS1220_WE** library to perform a simple differential measurement between AIN0 and AIN1.
#include
#include
#define ADS1220_CS_PIN 7
#define ADS1220_DRDY_PIN 6
ADS1220_WE ads = ADS1220_WE(ADS1220_CS_PIN, ADS1220_DRDY_PIN);
void setup() {
Serial.begin(9600);
if (!ads.init()) {
Serial.println("ADS1220 not connected!");
while (1);
}
// Set to differential mode: AIN0 vs AIN1
ads.setCompareChannels(ADS1220_MUX_0_1);
// Set Gain (1, 2, 4, 8, 16, 32, 64, 128)
ads.setGain(ADS1220_GAIN_1);
// Optional: Set Data Rate (e.g., 20, 45, 90, 175, 330, 600, 1000 SPS)
ads.setDataRate(ADS1220_DR_LVL_0); // 20 SPS (normal mode)
}
void loop() {
// Read voltage in millivolts
float voltage = ads.getVoltage_mV();
Serial.print("Voltage AIN0-AIN1 (mV): ");
Serial.println(voltage, 4);
// Read internal temperature sensor
float temp = ads.getTemperature();
Serial.print("Internal Temp (°C): ");
Serial.println(temp);
delay(1000);
}
**Advanced Usage Notes**
* **Temperature Compensation:** For thermocouples, you can use //ads.enableTemperatureSensor(true)// to read the ambient temperature for cold-junction compensation.
* **Data Ready:** The library handles the DRDY pin internally to ensure the ADC has finished its conversion before the Arduino attempts to read data.
* **High Resolution:** For raw 24-bit data (useful for weigh scales), use //ads.getRawData()// instead of voltage methods.
===== I²C topics on lamaPLC =====
{{topic>i2c}}
\\
{{tag>ADS111x ADS12xx Delta-sigma Converter Texas_Instruments ADC SPI communication sensor arduino code ADS1110 ADS1112 ADS1113 ADS1114 ADS1115 ADS1118 ADS1119 ADS1220 ADS1232 ADS1234 ADS1256 ADS1261 ADS1263 multi_channel}}
This page has been accessed for: Today: {{counter|today}}, Until now: {{counter|total}}