Using the ADS122C04 breakout with Arduino involves wiring up the breakout to your Arduino-compatible microcontroller with a potentiometer, installing the Adafruit_ADS122C04 library, and running the provided example code.
Wiring
Wire as shown for a 5V board like an Uno. If you are using a 3V board, like an Adafruit Feather, wire the board's 3V pin to the breakout VIN.
Here is an Adafruit Metro wired up to the breakout using the STEMMA QT connector. A potentiometer is connected to input 0 (A0) on the ADC:
-
Board 5V to breakout VIN (red wire)
-
Board GND to breakout GND (black wire)
-
Board SCL to breakout SCL (yellow wire)
- Board SDA to breakout SDA (blue wire)
- Breakout VIN to potentiometer positive (red wire)
- Breakout A0 to potentiometer wiper (green wire)
- Breakout GND to potentiometer negative (black wire)
- Breakout VIN to breakout Ref+ (red wire)
- Breakout GND to breakout Ref- (black wire)
Here is an Adafruit Metro wired up using a solderless breadboard:
-
Board 5V to breakout VIN (red wire)
-
Board GND to breakout GND (black wire)
-
Board SCL to breakout SCL (yellow wire)
- Board SDA to breakout SDA (blue wire)
- Breakout VIN to potentiometer positive (red wire)
- Breakout A0 to potentiometer wiper (green wire)
- Breakout GND to potentiometer negative (black wire)
- Breakout VIN to breakout Ref+ (red wire)
- Breakout GND to breakout Ref- (black wire)
Library Installation
You can install the Adafruit_ADS122C04 library for Arduino using the Library Manager in the Arduino IDE.
Click the Manage Libraries ... menu item, search for Adafruit_ADS122C04, and select the Adafruit ADS122C04 library:
If asked about dependencies, click "Install all".
If the "Dependencies" window does not come up, then you already have the dependencies installed.
If the dependencies are already installed, you must make sure you update them through the Arduino Library Manager before loading the example!
// SPDX-FileCopyrightText: 2026 Liz Clark for Adafruit Industries
//
// SPDX-License-Identifier: MIT
/*
* Simple ADS122C04 example - reads all 4 single-ended analog inputs
* and prints voltages to the Serial Monitor.
*
* If any inputs are floating, will read noise
*/
#include <Adafruit_ADS122C04.h>
Adafruit_ADS122C04 adc;
#ifdef ARDUINO_AVR_METRO
float voltage_ref = 5.0; // 5V from metro
#else
float voltage_ref = 3.3; // else assume 3.3V logic
#endif
// The four single-ended MUX settings (AINx vs AVSS)
const ads122c04_mux_t channels[] = {
ADS122C04_MUX_AIN0,
ADS122C04_MUX_AIN1,
ADS122C04_MUX_AIN2,
ADS122C04_MUX_AIN3
};
void setup() {
Serial.begin(115200);
while (!Serial) delay(10);
Serial.println("ADS122C04 4-Channel Single-Ended Test");
if (!adc.begin()) {
Serial.println("Failed to find ADS122C04 - check wiring!");
while (1) delay(10);
}
Serial.println("ADS122C04 found!");
// Use analog supply (AVDD-AVSS) as reference for full 0-5V range
adc.setVoltageReference(ADS122C04_VREF_SUPPLY);
Serial.print("Setting reference voltage to: ");
Serial.print(voltage_ref);
Serial.println("V");
adc.setReferenceVoltage(voltage_ref);
// Gain 1, PGA bypassed
adc.setGain(ADS122C04_GAIN_1);
adc.enablePGA(false);
// Single-shot mode at 20 SPS
adc.setContinuousMode(false);
adc.setDataRate(ADS122C04_RATE_20SPS);
Serial.println("Config: AVDD ref, gain=1, single-shot 20 SPS");
Serial.println();
}
void loop() {
for (uint8_t ch = 0; ch < 4; ch++) {
// Select the channel
adc.setMux(channels[ch]);
// Trigger a single conversion
adc.startSync();
// Wait for data ready (at 20 SPS, conversion takes ~50ms)
while (!adc.isDataReady()) {
delay(1);
}
// Read raw ADC value, then convert to voltage
int32_t raw = adc.readData();
float voltage = adc.convertToVoltage(raw);
Serial.print("A");
Serial.print(ch);
Serial.print(": ");
if (isnan(voltage)) {
Serial.print("READ ERROR");
} else {
Serial.print("raw=");
Serial.print(raw);
Serial.print(" -> ");
Serial.print(voltage, 6);
Serial.print(" V");
}
Serial.print("\t");
}
Serial.println();
delay(500);
}
Upload the sketch to your board and open up the Serial Monitor (Tools -> Serial Monitor) at 115200 baud. You'll see the ADS122C04 recognized over I2C. The reference voltage is set to 5V for a Metro and 3.3V for other boards. As you turn the potentiometer attached to A0, you'll see the raw value and voltage reading change.
The remaining 3 channels (A1, A2 and A3) are 'floating' - not connected to anything, so you will see varying random values.
Page last edited March 25, 2026
Text editor powered by tinymce.