~~NOCACHE~~
====== LamaPLC: Texas Instruments ADCs: Delta-sigma multi-channel Analog Converters with SPI communication ======
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, I2C-compatible device, while the ADS12xx series is typically a 24-bit, 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^nterface^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|I²C|4 SE or 2 Diff|Yes|Ye|860|Input MUX for multiple channels|
^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.)|
==== 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|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 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}}