Using a Qwiic PT100 ADS122C04 as a 24-bit ADC

I’m not interested in measuring temperature.

I am interested is using a 24-bit ADC with a Programmable Gain Amplifier of x1 to x128 used in the:

Qwiic PT100 ADS122C04 - SPX-16770

I’m confused on how to use a Qwiic PT100 ADS122C04 simply as an ADC and be able to read the resulting data using SDA/SCL.

Which terminals should be used to connect a sensor - terminals 2 and 3?

Being able to change the ADC gain is also of interest.

To change the gain using an Arduino sketch the SparkFun_ADS122C04_ADC_Arduino_Library on Github contains the example sketch:

Example9_ManualConfig.ino

with the command:

mySensor.setGain(ADS122C04)_GAIN_1; // Set gain to 1

With a sensor hooked up to terminals 2 and 3 on the Qwiic PT100 is the ‘mySensor’ syntax the correct method just change the number after 'GAIN to set the desired gain amplification?

For example, would using one of the following commands in an Arduino sketch be the correct method/syntax to change the gain of the ADS122C04?

mySensor.setGain(ADS122C04)_GAIN_10; // Set gain to 10

mySensor.setGain(ADS122C04)_GAIN_50; // Set gain to 50

mySensor.setGain(ADS122C04)_GAIN_100; // Set gain to 100

mySensor.setGain(ADS122C04)_GAIN_128; // Set gain to 128

In the guide for the Qwiic 12-Bit ADC under the ‘Setup and Settings’ section the command .getGain() returns the gain of the programmable gain amplifier (PGA) inside the ADS1015.

Have I missed a similar command for the ADS122C04?

Thanks.

Hi @sv98229,

To fully understand how the pin multiplexing and programmable gain work on the ADS122C04, you will need to work your way through the datasheet for the ADS122C04 and the schematic for the Qwiic PT100. However, to get you going:

Yes, using terminals 2 and 3 is a good choice. These are connected to AIN1 and AIN0 respectively, via a low pass filter.

This line in Example9 sets the pin multiplexer correctly for you:

mySensor.setInputMultiplexer(ADS122C04_MUX_AIN1_AIN0);

If the low pass filter is a problem for you, then you could switch to using AIN3 and AIN2 instead. Let me know if that’s of interest and I can talk you through it.

Then to change the gain, you would change this line from:

mySensor.setGain(ADS122C04_GAIN_1);

to:

mySensor.setGain(ADS122C04_GAIN_2);

mySensor.setGain(ADS122C04_GAIN_4);

mySensor.setGain(ADS122C04_GAIN_64);

mySensor.setGain(ADS122C04_GAIN_128);

The valid gains are 1/2/4/8/16/32/64/128.

You also need to think about what reference to use. Example9 defaults to using the built-in 2.048V reference:

mySensor.setVoltageReference(ADS122C04_VREF_INTERNAL);

This means you are limited to a maximum voltage difference of +/- 2.048V on the selected ADC pins. If you want to use the full 3.3V range, you can use this line instead:

mySensor.setVoltageReference(ADS122C04_VREF_AVDD);

You can find out what gain is currently selected by calling:

uint8_t gain = mySensor.getGain();

Please note that the value returned is 0-7: 0 represents a gain of 1; 1 represents a gain of 2; 7 represents a gain of 128.

Let me know if this gets you going.

Best wishes,

Paul

Paul,

Thank you. Your information helps a lot.

I hope to get an OpenLog Artemis as part of the upcoming sale (if Sparkfun can get them built in time) and include a Qwiic PT100 - ADS122C04 with the order.

I’m interested in trying to find out how much an ADC’s bit resolution (12-bit, 14-bit, 16-bit, 24-bit) affects the quality of data collected.

Using your information as a starting point it looks like my best approach will be to get my hands on a Qwiic PT100 - ADS122C04 and start working with it.

Thanks again,

Jim