文章目录
- 简介
- ADS1220特性参数
- ADS1220模数转换模块原理图
- Arduino UNO与ADS1220接线
- 简单测试
- K型热电偶测试
简介
ADS1220 是一款精密的 24 位模数转换器 (ADC),它提供许多集成功能,可降低测量小传感器信号的应用中的系统成本和元件数量。该器件具有两个差分输入或四个单端输入(通过灵活的输入多路复用器 (MUX)、低噪声可编程增益放大器 (PGA)、两个可编程激励电流源、电压基准、振荡器、低侧开关和精密温度传感器。该器件可以以高达 2000 样本/秒 (SPS) 的数据速率进行转换,并具有单周期稳定功能。在 20 SPS 时,数字滤波器可为嘈杂的工业应用提供同时 50 Hz 和 60 Hz 抑制。内部 PGA 提供高达 128 V/V 的增益。使用 PGA 时,该器件支持伪差分或全差分信号的测量。或者,该器件可以配置为绕过内部 PGA,同时仍提供高输入阻抗和高达 4 VV 的增益,从而实现单端测量。在 PGA 禁用的情况下以占空比模式运行时,功耗低至 120 uA。额定温度范围为 -40C 至 +125C。
ADS1220特性参数
- 模拟电源:AVDD / AVSS (AGND) 时为 2.3 至 5.5 伏。
- 数字电源:DVDD / DGND 时为 2.3 至 5.5 伏。
- 双极电源选项:例如 AVSS 到 DGND = -2.5 伏,AVDD 到 DGND = +2.5 伏。
- 功耗:占空比模式下为 120 微安。
- 通信:通过 SPI。
- 参考电压:
内部:2.048 伏。
外部:VREFPx– VREFNx= 最小 0.75 伏,最大 AVDD。 - 增益:1 – 128(带 PGA = 可编程增益放大器),1 – 4(不带 PGA)。
- 数据速率:5 – 2000 SPS(每秒采样数)
- 转换模式:连续和“单发”模式。
- 电压输入:4 个单端(相对于 AVSS)或 2 个差分输入。
- 在多路复用模式下进行测量。
- 两个可编程 IDAC(电流数模转换器):10 μA 至 1.5 毫安(在数据表中也称为“激励电流源”)。
- 数字滤波器:50 和/或 60 Hz。
- 集成温度传感器。
ADS1220模数转换模块原理图
DRDY | 数据就绪引脚,当数据可用时为低电平 |
---|---|
MISO | 串行数据输出 |
MOSI | 串行数据输入 |
SCLK | 串行时钟输入 |
CS | 片选 |
CLK | 外部时钟(可选) |
DVDD | 数字电压正 |
DGND | 数字电压负 |
AIN0/REFP1 | 模拟输入通道 0,也可以用作附加外部参考电压的输入正 |
AIN1 | 模拟输入通道 1 |
AIN2 | 模拟输入通道 2 |
AIN3/REFN1 | 模拟输入通道 3,也可以用作附加外部参考电压的输入负 |
REFN0 | 外部参考电压负 |
REFP0 | 外部参考电压正 |
AVDD | 模拟电压电源正 |
AVSS | 模拟电压电源负 |
Arduino UNO与ADS1220接线
Arduino UNO | ADS1220 |
---|---|
5V | DVDD,AVDD |
GND | DGND,AVSS |
D6 | DRDY |
D7 | CS |
D11 | MOSI |
D12 | MISO |
D13 | SCLK |
简单测试接线
K型热电偶测试接线
简单测试
AIN0-AIN1:1.2V差分测试,AIN2,AIN3:1.49V单端测:
/***************************************************************************
* Example sketch for the ADS1220_WE library
*
* This sketch shows how to change channels and get data. The sketch uses the
* the default settings, e.g. the internal voltage reference. This limits the
* maximum voltage that can be measured to 2.048 volts.
*
* On my website you find:
* 1) An article about the ADS1220 and the use of this library
* https://wolles-elektronikkiste.de/ads1220-4-kanal-24-bit-a-d-wandler (German)
* https://wolles-elektronikkiste.de/en/4-channel-24-bit-adc-ads1220 (English)
*
* 2) An article how to use the ADS1220 for typical applications, such as thermocouples,
* NTCs, RTDs or Wheatstone bridges:
* https://wolles-elektronikkiste.de/ads1220-teil-2-anwendungen (German)
* https://wolles-elektronikkiste.de/en/ads1220-part-2-applications (English)
*
***************************************************************************/#include <ADS1220_WE.h>
#include <SPI.h>#define ADS1220_CS_PIN 7 // chip select pin
#define ADS1220_DRDY_PIN 6 // data ready pin /* Create your ADS1220 object */
ADS1220_WE ads = ADS1220_WE(ADS1220_CS_PIN, ADS1220_DRDY_PIN);
/* Alternatively you can also pass the SPI object as reference */
// ADS1220_WE ads = ADS1220_WE(&SPI, ADS1220_CS_PIN, ADS1220_DRDY_PIN);void setup(){Serial.begin(9600);if(!ads.init()){Serial.println("ADS1220 is not connected!");while(1);}
/* The voltages to be measured need to be between negative VREF + 0.2 V and positive* VREF -0.2 V if PGA is enabled. For this basic example I disable PGA, to be on the * safe side. */ ads.bypassPGA(true);
}/* * You set the channels to be measured with setCompareChannels(); You* can choose the following parameters:* Parameter Pos. Input Neg. Input Comment* ADS1220_MUX_0_1 AIN0 AIN1* ADS1220_MUX_0_2 AIN0 AIN2* ADS1220_MUX_0_3 AIN0 AIN3* ADS1220_MUX_1_2 AIN1 AIN2* ADS1220_MUX_1_3 AIN1 AIN3* ADS1220_MUX_2_3 AIN2 AIN2* ADS1220_MUX_1_0 AIN1 AIN0* ADS1220_MUX_3_2 AIN3 AIN2* ADS1220_MUX_0_AVSS AIN0 AVSS single-ended* ADS1220_MUX_1_AVSS AIN1 AVSS single-ended * ADS1220_MUX_2_AVSS AIN2 AVSS single-ended* ADS1220_MUX_3_AVSS AIN3 AVSS single-ended* ADS1220_MUX_REFPX_REFNX_4 REFP0/REFP1 REFN0/REFN1 (REFPX-REFNX)/4; PGA bypassed* ADS1220_MUX_AVDD_M_AVSS_4 AVDD AVSS (AVDD-AVSS)/4; PGA bypassed* ADS1220_MUX_AVDD_P_AVSS_2 AVDD AVSS (AVDD+AVSS)/2* * The last three modes use the internal reference (2.048 V) and gain = 1, independent of * your settings.*/void loop(){float result = 0.0;long longResult = 0;ads.setCompareChannels(ADS1220_MUX_0_1);result = ads.getVoltage_mV();longResult = ads.getRawData();Serial.print("AIN0 vs. AIN1 [mV]: ");Serial.println(result);Serial.print("AIN0 vs. AIN1 (raw): "); // raw dataSerial.println(longResult);// ads.setCompareChannels(ADS1220_MUX_0_AVSS);// result = ads.getVoltage_mV();// Serial.print("AIN0 vs. AVSS [mV]: ");// Serial.println(result);// ads.setCompareChannels(ADS1220_MUX_1_AVSS);// result = ads.getVoltage_mV();// Serial.print("AIN1 vs. AVSS [mV]: ");// Serial.println(result);ads.setCompareChannels(ADS1220_MUX_2_AVSS);result = ads.getVoltage_muV(); // request result in microvoltsSerial.print("AIN2 vs. AVSS [µV]: ");Serial.println(result);ads.setCompareChannels(ADS1220_MUX_3_AVSS);result = ads.getVoltage_mV();Serial.print("AIN3 vs. AVSS [mV]: ");Serial.println(result);ads.setCompareChannels(ADS1220_MUX_AVDD_M_AVSS_4); // voltage supply / 4result = ads.getVoltage_mV() * 4.0;Serial.print("Supply Voltage [mV]: ");Serial.println(result);result = ads.getVRef_V(); // get the reference voltageSerial.print("Reference [V]: ");Serial.println(result,3); Serial.print("Temperature [°C]: "); // get the temperatureresult = ads.getTemperature();Serial.println(result);Serial.println();delay(2000);
}
)
K型热电偶测试
温水测试:
#include <ADS1220_WE.h>
#include <SPI.h>#define ADS1220_CS_PIN 7 // chip select pin
#define ADS1220_DRDY_PIN 6 // data ready pin ADS1220_WE ads = ADS1220_WE(ADS1220_CS_PIN, ADS1220_DRDY_PIN);void setup(){Serial.begin(9600);if(!ads.init()){Serial.println("ADS1220 is not connected!");while(1);}ads.setCompareChannels(ADS1220_MUX_0_1);ads.setGain(ADS1220_GAIN_128);
}void loop(){float ambTemp = 0.0;float deltaTemp = 0.0; // thermocouple temperature minus ambient temperaturefloat tCTemp = 0.0; // thermocouple temperaturefloat tCV = 0.0; // thermocouple voltageads.enableTemperatureSensor(true);ambTemp = ads.getTemperature();ads.enableTemperatureSensor(false); Serial.print("Ambient Temperature [°C]: ");Serial.println(ambTemp);tCV = ads.getVoltage_muV(); // get result in millivoltsdeltaTemp = 0.0244821*tCV + 0.106873;Serial.print("Thermocouple T vs. ambient T [°C]: ");Serial.println(deltaTemp);tCTemp = ambTemp + deltaTemp;Serial.print("Thermocouple Temperature [°C]: ");Serial.println(tCTemp);Serial.println();delay(2000);
}