Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use Adafruit ADS7128 8-Channel ADC and GPIO Expander: Examples, Pinouts, and Specs

Image of Adafruit ADS7128 8-Channel ADC and GPIO Expander
Cirkit Designer LogoDesign with Adafruit ADS7128 8-Channel ADC and GPIO Expander in Cirkit Designer

Introduction

The Adafruit ADS7128 (Part ID: 6494) is a versatile 8-channel analog-to-digital converter (ADC) with GPIO expansion capabilities. This component is designed to measure multiple analog signals with high precision and provides additional GPIO functionality, making it an excellent choice for interfacing with sensors, actuators, and other devices in embedded systems. Its compact design and I²C interface make it easy to integrate into a wide range of projects.

Explore Projects Built with Adafruit ADS7128 8-Channel ADC and GPIO Expander

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Raspberry Pi 4B-Based Current Monitoring System with I2C OLED Display
Image of Virtual Energy Monitoring Circuit: A project utilizing Adafruit ADS7128 8-Channel ADC and GPIO Expander in a practical application
This circuit features a Raspberry Pi 4B as the central processing unit, interfaced with an Adafruit ADS1115 16-bit I2C ADC for analog-to-digital conversion and a 0.96" OLED display for visual output. The ADS1115 is connected to a current sensor for measuring electrical current, with the sensor's output and burden pins connected to the ADC's analog input channels. The Raspberry Pi communicates with both the ADC and the OLED display over the I2C bus, using its GPIO2 and GPIO3 pins for data (SDA) and clock (SCL) lines, respectively.
Cirkit Designer LogoOpen Project in Cirkit Designer
Raspberry Pi 4B with I2C Current Sensing and OLED Display
Image of iot task 2: A project utilizing Adafruit ADS7128 8-Channel ADC and GPIO Expander in a practical application
This circuit features a Raspberry Pi 4B as the central processing unit, interfaced with an Adafruit ADS1115 16-bit I2C ADC for analog-to-digital conversion and a 0.96" OLED display for visual output. The ADC is connected to a current sensor for measuring electrical current, with the sensor's output connected to the ADC's AIN0 pin and the burden resistor connected to AIN1. The Raspberry Pi communicates with both the ADC and the OLED display over the I2C bus, using GPIO2 (SDA) and GPIO3 (SCL) for data exchange.
Cirkit Designer LogoOpen Project in Cirkit Designer
Raspberry Pi 4B with I2C Sensor Data Acquisition and OLED Display
Image of Task02: A project utilizing Adafruit ADS7128 8-Channel ADC and GPIO Expander in a practical application
This circuit features a Raspberry Pi 4B as the central processing unit, interfaced with an Adafruit ADS1115 16-bit ADC for analog-to-digital conversion, a current sensor, and a ZMPT101B voltage sensor for electrical parameter measurement. The Raspberry Pi communicates with the ADC and a 0.96" OLED display via I2C (using GPIO2 and GPIO3 for SDA and SCL lines, respectively), allowing for the monitoring and display of current and voltage readings. The ADC is connected to the current sensor and voltage sensor to digitize the analog signals for processing by the Raspberry Pi.
Cirkit Designer LogoOpen Project in Cirkit Designer
Raspberry Pi 4B-based Current Monitoring System with OLED Display
Image of TASK – 2: A project utilizing Adafruit ADS7128 8-Channel ADC and GPIO Expander in a practical application
This circuit features a Raspberry Pi 4B as the central processing unit, interfaced with an ADS1115 analog-to-digital converter (ADC) and a 0.96" OLED display via I2C communication (using GPIO2 and GPIO3 for SDA and SCL, respectively). The ADS1115 is connected to two current sensors: a generic current sensor and an ACS712, to measure current and report values to the Raspberry Pi, which can display the data on the OLED. Power is distributed from the Raspberry Pi's 5V pin to the other components, and all components share a common ground.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with Adafruit ADS7128 8-Channel ADC and GPIO Expander

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Virtual Energy Monitoring Circuit: A project utilizing Adafruit ADS7128 8-Channel ADC and GPIO Expander in a practical application
Raspberry Pi 4B-Based Current Monitoring System with I2C OLED Display
This circuit features a Raspberry Pi 4B as the central processing unit, interfaced with an Adafruit ADS1115 16-bit I2C ADC for analog-to-digital conversion and a 0.96" OLED display for visual output. The ADS1115 is connected to a current sensor for measuring electrical current, with the sensor's output and burden pins connected to the ADC's analog input channels. The Raspberry Pi communicates with both the ADC and the OLED display over the I2C bus, using its GPIO2 and GPIO3 pins for data (SDA) and clock (SCL) lines, respectively.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of iot task 2: A project utilizing Adafruit ADS7128 8-Channel ADC and GPIO Expander in a practical application
Raspberry Pi 4B with I2C Current Sensing and OLED Display
This circuit features a Raspberry Pi 4B as the central processing unit, interfaced with an Adafruit ADS1115 16-bit I2C ADC for analog-to-digital conversion and a 0.96" OLED display for visual output. The ADC is connected to a current sensor for measuring electrical current, with the sensor's output connected to the ADC's AIN0 pin and the burden resistor connected to AIN1. The Raspberry Pi communicates with both the ADC and the OLED display over the I2C bus, using GPIO2 (SDA) and GPIO3 (SCL) for data exchange.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Task02: A project utilizing Adafruit ADS7128 8-Channel ADC and GPIO Expander in a practical application
Raspberry Pi 4B with I2C Sensor Data Acquisition and OLED Display
This circuit features a Raspberry Pi 4B as the central processing unit, interfaced with an Adafruit ADS1115 16-bit ADC for analog-to-digital conversion, a current sensor, and a ZMPT101B voltage sensor for electrical parameter measurement. The Raspberry Pi communicates with the ADC and a 0.96" OLED display via I2C (using GPIO2 and GPIO3 for SDA and SCL lines, respectively), allowing for the monitoring and display of current and voltage readings. The ADC is connected to the current sensor and voltage sensor to digitize the analog signals for processing by the Raspberry Pi.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of TASK – 2: A project utilizing Adafruit ADS7128 8-Channel ADC and GPIO Expander in a practical application
Raspberry Pi 4B-based Current Monitoring System with OLED Display
This circuit features a Raspberry Pi 4B as the central processing unit, interfaced with an ADS1115 analog-to-digital converter (ADC) and a 0.96" OLED display via I2C communication (using GPIO2 and GPIO3 for SDA and SCL, respectively). The ADS1115 is connected to two current sensors: a generic current sensor and an ACS712, to measure current and report values to the Raspberry Pi, which can display the data on the OLED. Power is distributed from the Raspberry Pi's 5V pin to the other components, and all components share a common ground.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Monitoring multiple analog sensors (e.g., temperature, light, pressure)
  • Expanding GPIO capabilities in microcontroller-based systems
  • Data acquisition systems
  • Industrial automation and control
  • Prototyping and development of IoT devices

Technical Specifications

The Adafruit ADS7128 offers the following key technical features:

Parameter Value
Supply Voltage (VDD) 2.7V to 5.5V
Analog Input Channels 8
ADC Resolution 12-bit
Sampling Rate Up to 188 kSPS
Communication Interface I²C (up to 3.4 MHz)
GPIO Pins 8 (configurable as input or output)
Operating Temperature -40°C to +125°C
Package Type QFN-16

Pin Configuration and Descriptions

The ADS7128 has 16 pins, as described in the table below:

Pin Number Pin Name Description
1 VDD Power supply input (2.7V to 5.5V).
2 GND Ground connection.
3 SDA I²C data line.
4 SCL I²C clock line.
5-12 AIN0-AIN7 Analog input channels (can also be configured as GPIO).
13 ALERT Interrupt output pin (active low).
14 ADDR I²C address selection pin.
15 RESET Active-low reset pin.
16 NC No connection (leave unconnected).

Usage Instructions

How to Use the Component in a Circuit

  1. Power Supply: Connect the VDD pin to a 3.3V or 5V power source and the GND pin to ground.
  2. I²C Communication: Connect the SDA and SCL pins to the corresponding I²C pins on your microcontroller. Use pull-up resistors (typically 4.7kΩ) on both lines if not already present.
  3. Analog Inputs: Connect your analog signals to the AIN0-AIN7 pins. Ensure the input voltage does not exceed the supply voltage (VDD).
  4. GPIO Configuration: If using the pins as GPIO, configure them as input or output via I²C commands.
  5. Interrupts: Use the ALERT pin to monitor events such as threshold crossings or configuration errors.
  6. Address Selection: Set the I²C address by connecting the ADDR pin to GND, VDD, or leaving it floating (refer to the datasheet for address mapping).

Important Considerations and Best Practices

  • Input Voltage Range: Ensure that the analog input voltage remains within the range of 0V to VDD to avoid damage.
  • Bypass Capacitor: Place a 0.1µF ceramic capacitor close to the VDD pin for power supply decoupling.
  • I²C Pull-Up Resistors: Verify that pull-up resistors are present on the SDA and SCL lines to ensure proper I²C communication.
  • GPIO Current Limit: Do not exceed the maximum current rating for GPIO pins (refer to the datasheet for details).
  • Reset Pin: Use the RESET pin to reset the device if needed, or leave it unconnected if not used.

Example Code for Arduino UNO

Below is an example of how to read analog values from the ADS7128 using an Arduino UNO:

#include <Wire.h>

// Define the I²C address of the ADS7128 (default: 0x48)
#define ADS7128_I2C_ADDRESS 0x48

void setup() {
  Wire.begin(); // Initialize I²C communication
  Serial.begin(9600); // Initialize serial communication for debugging

  // Configure the ADS7128 (example: set AIN0 as an analog input)
  Wire.beginTransmission(ADS7128_I2C_ADDRESS);
  Wire.write(0x01); // Write to configuration register
  Wire.write(0x80); // Enable AIN0 as analog input
  Wire.endTransmission();

  Serial.println("ADS7128 initialized.");
}

void loop() {
  // Request a single-ended analog reading from AIN0
  Wire.beginTransmission(ADS7128_I2C_ADDRESS);
  Wire.write(0x10); // Command to read AIN0
  Wire.endTransmission();

  Wire.requestFrom(ADS7128_I2C_ADDRESS, 2); // Request 2 bytes of data
  if (Wire.available() == 2) {
    uint16_t analogValue = Wire.read() << 8 | Wire.read(); // Combine MSB and LSB
    Serial.print("AIN0 Value: ");
    Serial.println(analogValue);
  }

  delay(1000); // Wait 1 second before the next reading
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. No I²C Communication:

    • Ensure the SDA and SCL lines are connected correctly.
    • Verify that pull-up resistors are present on the I²C lines.
    • Check the I²C address and ensure it matches the configuration of the ADDR pin.
  2. Incorrect Analog Readings:

    • Confirm that the input voltage is within the range of 0V to VDD.
    • Check for noise or interference on the analog input lines.
    • Verify the configuration of the input channels via I²C commands.
  3. Device Not Responding:

    • Ensure the VDD and GND connections are secure.
    • Check the RESET pin and ensure it is not held low.
    • Verify the power supply voltage is within the specified range.

FAQs

Q: Can I use the ADS7128 with a 5V microcontroller?
A: Yes, the ADS7128 supports a supply voltage range of 2.7V to 5.5V, making it compatible with both 3.3V and 5V systems.

Q: How do I configure the GPIO pins?
A: The GPIO pins can be configured as input or output via I²C commands. Refer to the datasheet for detailed register settings.

Q: What is the maximum sampling rate of the ADS7128?
A: The ADS7128 supports a maximum sampling rate of 188 kSPS.

Q: Can I use all 8 channels as GPIO?
A: Yes, all 8 channels (AIN0-AIN7) can be configured as GPIO if needed.

Q: Do I need external components to use the ADS7128?
A: You may need pull-up resistors for the I²C lines and a bypass capacitor for the VDD pin. Additional components depend on your specific application.