ADS1256 ADC module angled view showing the fitted pin headers

ADS1256 24-Bit 8-Channel ADC Module | ShillehTek Product Manual

ArduinoESP32Raspberry PiPicomanual-product-10645386035487
$19.99 USD In stock · Order by 3pm ET, ships today

Overview

The ADS1256 is a 24-bit delta-sigma analog-to-digital converter from Texas Instruments. It turns analog voltages into very high-resolution digital readings: up to 23 noise-free bits, at rates from 2.5 to 30,000 samples per second. Its eight inputs can be read as eight single-ended channels or as four differential pairs, and a programmable gain amplifier (1× to 64×) brings millivolt signals from load cells, thermocouples and bridge sensors into range.

This module adds what the chip needs to run: a 2.5 V reference, a 7.68 MHz crystal and a 3.3 V regulator for the digital side. It needs a 5 V supply and talks SPI. Its control inputs accept both 3.3 V and 5 V logic and its outputs are 3.3 V signals, so the same wiring idea works for an Arduino Uno, ESP32, Raspberry Pi and Pico. One 8-pin header carries power and SPI, and a 2×8 header carries AIN0 to AIN7, each next to its own ground pin.

Typical uses are precision data logging, weigh scales, temperature front ends, battery and cell monitoring, and any project where a microcontroller's built-in 10 or 12-bit ADC is not enough. This manual covers the pinout, wiring for Arduino, ESP32, Raspberry Pi and Pico, working code for each, and answers on input ranges, differential readings, gain, noise and speed.

At a Glance

Resolution
24-bit delta-sigma
Inputs
8 single-ended or 4 differential
Data Rate
2.5 to 30,000 SPS
Interface
SPI mode 1 + DRDY
Supply
5 V
Reference
2.5 V on board

Specifications

Parameter Value
ADC IC Texas Instruments ADS1256
Resolution 24 bits, up to 23 bits noise-free
Inputs AIN0 – AIN7: 8 single-ended or 4 differential
Data rate 2.5 to 30,000 samples per second
Gain (PGA) 1, 2, 4, 8, 16, 32 or 64
Full-scale range ±5 V differential at gain 1 (±5 V divided by the gain)
Input limits 0 to 5 V on every input (0 to 3 V with the input buffer on)
Reference 2.5 V, on board
Interface SPI mode 1, up to 1.92 MHz, plus DRDY output
Supply voltage 5 V (4.75 – 5.25 V)
Logic levels Inputs accept 3.3 V or 5 V · outputs are 3.3 V
Board size About 60 × 35 mm, four mounting holes

Pinout Diagram

The pin names are printed on the underside of the board, and the diagram shows that side. The 8-pin header carries 5V, GND, SCLK, DIN (data in, MOSI), DOUT (data out, MISO), DRDY, CS and PDWN. DRDY goes low each time a new reading is ready. PDWN is the sync and power-down input and must be held high for the chip to run, so wire it to 3.3 V. On the 2×8 header, the inner column next to the printed names is AIN0 to AIN7 and the outer column at the board edge is ground. Confirm the ground column with a multimeter's continuity test against the GND pin before you connect a sensor. Seen from the component side, the two headers swap left and right.

ADS1256 24-bit 8-channel ADC module pinout diagram showing 5V, GND, SCLK, DIN, DOUT, DRDY, CS and PDWN pins and the AIN0 to AIN7 analog inputs

Wiring Guide

The module needs 5 V power, the four SPI lines, the DRDY output and a steady high level on PDWN. No level converter is needed on any of the four platforms. Keep every analog input between 0 and 5 V: a voltage below ground or above the supply can damage the chip.

Arduino Uno / Nano Wiring

ADS1256 Pin Arduino Pin Notes
5V 5V Power
GND GND Ground
SCLK D13 SPI clock
DIN D11 MOSI
DOUT D12 MISO
DRDY D9 Data ready
CS D10 Chip select
PDWN 3.3V Keep high
5 V friendly: The module's inputs accept 5 V logic, and an Uno or Nano reads its 3.3 V outputs correctly, so the wires connect directly.

ESP32 Wiring

ADS1256 Pin ESP32 Pin Notes
5V 5V or VIN Power
GND GND Ground
SCLK GPIO 18 SPI clock
DIN GPIO 23 MOSI
DOUT GPIO 19 MISO
DRDY GPIO 4 Data ready
CS GPIO 5 Chip select
PDWN 3V3 Keep high
Needs 5 V: The module's analog side runs on 5 V, so power it from the 5V or VIN pin, not from 3V3. The signal lines connect straight to the ESP32.

Raspberry Pi Wiring

ADS1256 Pin Raspberry Pi Pin Notes
5V 5V (Pin 2) Power
GND GND (Pin 6) Ground
SCLK GPIO 11 (Pin 23) SPI clock
DIN GPIO 10 (Pin 19) MOSI
DOUT GPIO 9 (Pin 21) MISO
DRDY GPIO 17 (Pin 11) Data ready
CS GPIO 8 (Pin 24) CE0
PDWN 3.3V (Pin 1) Keep high
Enable SPI: Run sudo raspi-config, open Interface Options, turn on SPI and reboot. If Python reports a missing module, run sudo apt install python3-spidev python3-gpiozero.

Raspberry Pi Pico Wiring

ADS1256 Pin Pico Pin Notes
5V VBUS (Pin 40) USB 5 V
GND GND (Pin 38) Ground
SCLK GP18 (Pin 24) SPI0 clock
DIN GP19 (Pin 25) SPI0 TX
DOUT GP16 (Pin 21) SPI0 RX
DRDY GP20 (Pin 26) Data ready
CS GP17 (Pin 22) Chip select
PDWN 3V3(OUT) (Pin 36) Keep high
VBUS power: VBUS carries 5 V only while the Pico is on USB power. On battery power, give the module its own 5 V supply and join the grounds.

Code Examples

View or download this product's example code on GitHub.

All three examples do the same job: reset the chip, check its ID, select gain 1 and 100 samples per second, run a self-calibration, then print the voltage on AIN0 to AIN7 once a second. Each input is measured against ground. Unconnected inputs float and show random values, so tie unused inputs to GND while you test.

Arduino and ESP32 — Read All Eight Inputs (No Library)

ads1256_read.ino
// ADS1256 24-bit ADC - read all eight inputs as single-ended voltages (no library needed)
// Uno/Nano: SCLK = D13, DIN = D11, DOUT = D12, CS = D10, DRDY = D9
// ESP32:    SCLK = GPIO 18, DIN = GPIO 23, DOUT = GPIO 19, CS = GPIO 5, DRDY = GPIO 4
// Both:     5V pin = 5 V, GND = GND, PDWN = 3.3 V
#include <SPI.h>

#if defined(ESP32)
const int PIN_CS = 5;
const int PIN_DRDY = 4;
#else
const int PIN_CS = 10;
const int PIN_DRDY = 9;
#endif

const float VREF = 2.5;              // on-board reference voltage

const uint8_t CMD_WAKEUP  = 0x00;
const uint8_t CMD_RDATA   = 0x01;
const uint8_t CMD_SDATAC  = 0x0F;
const uint8_t CMD_RREG    = 0x10;
const uint8_t CMD_WREG    = 0x50;
const uint8_t CMD_SELFCAL = 0xF0;
const uint8_t CMD_SYNC    = 0xFC;
const uint8_t CMD_RESET   = 0xFE;

const uint8_t REG_STATUS = 0x00;
const uint8_t REG_MUX    = 0x01;
const uint8_t REG_ADCON  = 0x02;
const uint8_t REG_DRATE  = 0x03;

SPISettings adcSPI(1000000, MSBFIRST, SPI_MODE1);   // the chip allows up to 1.92 MHz

// Waits until DRDY goes low. Returns false after one second without a new reading.
bool waitDRDY() {
  unsigned long start = millis();
  while (digitalRead(PIN_DRDY) == HIGH) {
    if (millis() - start > 1000) return false;
  }
  return true;
}

void sendCommand(uint8_t command) {
  SPI.beginTransaction(adcSPI);
  digitalWrite(PIN_CS, LOW);
  SPI.transfer(command);
  digitalWrite(PIN_CS, HIGH);
  SPI.endTransaction();
}

void writeRegister(uint8_t reg, uint8_t value) {
  SPI.beginTransaction(adcSPI);
  digitalWrite(PIN_CS, LOW);
  SPI.transfer(CMD_WREG | reg);
  SPI.transfer(0x00);                // write one register
  SPI.transfer(value);
  digitalWrite(PIN_CS, HIGH);
  SPI.endTransaction();
}

uint8_t readRegister(uint8_t reg) {
  SPI.beginTransaction(adcSPI);
  digitalWrite(PIN_CS, LOW);
  SPI.transfer(CMD_RREG | reg);
  SPI.transfer(0x00);                // read one register
  delayMicroseconds(10);             // the chip needs 6.5 us before it answers
  uint8_t value = SPI.transfer(0x00);
  digitalWrite(PIN_CS, HIGH);
  SPI.endTransaction();
  return value;
}

// Selects AIN<channel> against ground, restarts the filter and returns the settled voltage
float readVolts(uint8_t channel) {
  writeRegister(REG_MUX, (channel << 4) | 0x08);   // positive = AINx, negative = AINCOM

  SPI.beginTransaction(adcSPI);
  digitalWrite(PIN_CS, LOW);
  SPI.transfer(CMD_SYNC);
  delayMicroseconds(5);
  SPI.transfer(CMD_WAKEUP);
  digitalWrite(PIN_CS, HIGH);
  SPI.endTransaction();

  delay(12);                         // one full conversion at 100 samples per second
  waitDRDY();

  SPI.beginTransaction(adcSPI);
  digitalWrite(PIN_CS, LOW);
  SPI.transfer(CMD_RDATA);
  delayMicroseconds(10);             // the chip needs 6.5 us before it answers
  int32_t code = SPI.transfer(0x00);
  code = (code << 8) | SPI.transfer(0x00);
  code = (code << 8) | SPI.transfer(0x00);
  digitalWrite(PIN_CS, HIGH);
  SPI.endTransaction();

  if (code & 0x800000) code -= 0x1000000;       // 24-bit two's complement to signed
  return code * (2.0 * VREF) / 8388607.0;       // gain 1: full scale = +/-5 V
}

void setup() {
  Serial.begin(115200);
  pinMode(PIN_CS, OUTPUT);
  digitalWrite(PIN_CS, HIGH);
  pinMode(PIN_DRDY, INPUT);
#if defined(ESP32)
  SPI.begin(18, 19, 23);             // SCLK, DOUT (MISO), DIN (MOSI)
#else
  SPI.begin();
#endif
  delay(50);

  sendCommand(CMD_RESET);
  delay(10);
  sendCommand(CMD_SDATAC);
  delay(1);

  uint8_t id = readRegister(REG_STATUS) >> 4;
  if (id != 3) {
    Serial.print("ADS1256 not found (ID ");
    Serial.print(id);
    Serial.println(") - check wiring, 5 V power and PDWN");
    while (true) { delay(1000); }
  }

  writeRegister(REG_ADCON, 0x00);    // gain 1, clock output off
  writeRegister(REG_DRATE, 0x82);    // 100 samples per second
  sendCommand(CMD_SELFCAL);          // calibrate for these settings
  delay(100);
  waitDRDY();
}

void loop() {
  for (uint8_t channel = 0; channel < 8; channel++) {
    Serial.print("AIN");
    Serial.print(channel);
    Serial.print(": ");
    Serial.print(readVolts(channel), 5);
    Serial.println(" V");
  }
  Serial.println();
  delay(1000);
}

Raspberry Pi — Python

ads1256_read.py
#!/usr/bin/env python3
# ADS1256 24-bit ADC on Raspberry Pi - read all eight inputs as single-ended voltages
# Enable SPI first: sudo raspi-config, Interface Options, SPI
# Wiring: 5V = pin 2, GND = pin 6, SCLK = GPIO 11, DIN = GPIO 10, DOUT = GPIO 9,
#         CS = GPIO 8 (CE0), DRDY = GPIO 17, PDWN = 3.3 V (pin 1)
import time
import spidev
from gpiozero import DigitalInputDevice

VREF = 2.5                      # on-board reference voltage

CMD_WAKEUP, CMD_RDATA, CMD_SDATAC = 0x00, 0x01, 0x0F
CMD_RREG, CMD_WREG = 0x10, 0x50
CMD_SELFCAL, CMD_SYNC, CMD_RESET = 0xF0, 0xFC, 0xFE
REG_STATUS, REG_MUX, REG_ADCON, REG_DRATE = 0x00, 0x01, 0x02, 0x03

drdy = DigitalInputDevice(17)
spi = spidev.SpiDev()
spi.open(0, 0)                  # bus 0, chip select CE0
spi.mode = 1
spi.max_speed_hz = 40000        # a slow clock gives the chip its 6.5 us reply delay


def wait_drdy(timeout=1.0):
    """Wait until DRDY goes low. Returns False if nothing happens in time."""
    end = time.monotonic() + timeout
    while drdy.value == 1:
        if time.monotonic() > end:
            return False
    return True


def write_register(reg, value):
    spi.xfer2([CMD_WREG | reg, 0x00, value])


def read_register(reg):
    return spi.xfer2([CMD_RREG | reg, 0x00, 0x00])[2]


def read_volts(channel):
    """Select AIN<channel> against ground and return the settled voltage."""
    write_register(REG_MUX, (channel << 4) | 0x08)     # positive = AINx, negative = AINCOM
    spi.xfer2([CMD_SYNC, CMD_WAKEUP])                  # restart the filter on the new input
    time.sleep(0.012)                                  # one full conversion at 100 samples per second
    wait_drdy()
    reply = spi.xfer2([CMD_RDATA, 0x00, 0x00, 0x00])
    code = (reply[1] << 16) | (reply[2] << 8) | reply[3]
    if code & 0x800000:
        code -= 0x1000000                              # 24-bit two's complement to signed
    return code * (2 * VREF) / 8388607                 # gain 1: full scale = +/-5 V


spi.xfer2([CMD_RESET])
time.sleep(0.01)
spi.xfer2([CMD_SDATAC])
chip_id = read_register(REG_STATUS) >> 4
if chip_id != 3:
    raise SystemExit(f"ADS1256 not found (ID {chip_id}) - check wiring, 5 V power and PDWN")

write_register(REG_ADCON, 0x00)     # gain 1, clock output off
write_register(REG_DRATE, 0x82)     # 100 samples per second
spi.xfer2([CMD_SELFCAL])            # calibrate for these settings
time.sleep(0.1)
wait_drdy()

try:
    while True:
        for channel in range(8):
            print(f"AIN{channel}: {read_volts(channel):9.5f} V")
        print()
        time.sleep(1)
except KeyboardInterrupt:
    spi.close()

Raspberry Pi Pico — MicroPython

ads1256_pico.py
# ADS1256 24-bit ADC on Raspberry Pi Pico (MicroPython) - read all eight inputs
# Wiring: 5V = VBUS, GND = GND, SCLK = GP18, DIN = GP19, DOUT = GP16, CS = GP17,
#         DRDY = GP20, PDWN = 3V3(OUT)
from machine import SPI, Pin
import time

VREF = 2.5                      # on-board reference voltage

CMD_WAKEUP, CMD_RDATA, CMD_SDATAC = 0x00, 0x01, 0x0F
CMD_RREG, CMD_WREG = 0x10, 0x50
CMD_SELFCAL, CMD_SYNC, CMD_RESET = 0xF0, 0xFC, 0xFE
REG_STATUS, REG_MUX, REG_ADCON, REG_DRATE = 0x00, 0x01, 0x02, 0x03

spi = SPI(0, baudrate=1000000, polarity=0, phase=1, sck=Pin(18), mosi=Pin(19), miso=Pin(16))
cs = Pin(17, Pin.OUT, value=1)
drdy = Pin(20, Pin.IN)


def wait_drdy(timeout_ms=1000):
    # Wait until DRDY goes low. Returns False if nothing happens in time.
    start = time.ticks_ms()
    while drdy.value() == 1:
        if time.ticks_diff(time.ticks_ms(), start) > timeout_ms:
            return False
    return True


def command(*data):
    cs.value(0)
    spi.write(bytes(data))
    cs.value(1)


def read_after(data, count):
    # Send a command, give the chip its 6.5 us reply delay, then read count bytes
    cs.value(0)
    spi.write(bytes(data))
    time.sleep_us(10)
    reply = spi.read(count, 0x00)
    cs.value(1)
    return reply


def read_volts(channel):
    # Select AIN<channel> against ground and return the settled voltage
    command(CMD_WREG | REG_MUX, 0x00, (channel << 4) | 0x08)    # positive = AINx, negative = AINCOM
    cs.value(0)
    spi.write(bytes([CMD_SYNC]))
    time.sleep_us(5)
    spi.write(bytes([CMD_WAKEUP]))          # restart the filter on the new input
    cs.value(1)
    time.sleep_ms(12)                       # one full conversion at 100 samples per second
    wait_drdy()
    raw = read_after([CMD_RDATA], 3)
    code = (raw[0] << 16) | (raw[1] << 8) | raw[2]
    if code & 0x800000:
        code -= 0x1000000                   # 24-bit two's complement to signed
    return code * (2 * VREF) / 8388607      # gain 1: full scale = +/-5 V


command(CMD_RESET)
time.sleep_ms(10)
command(CMD_SDATAC)
chip_id = read_after([CMD_RREG | REG_STATUS, 0x00], 1)[0] >> 4
if chip_id != 3:
    raise RuntimeError("ADS1256 not found (ID {}) - check wiring, 5 V power and PDWN".format(chip_id))

command(CMD_WREG | REG_ADCON, 0x00, 0x00)   # gain 1, clock output off
command(CMD_WREG | REG_DRATE, 0x00, 0x82)   # 100 samples per second
command(CMD_SELFCAL)                        # calibrate for these settings
time.sleep_ms(100)
wait_drdy()

while True:
    for channel in range(8):
        print("AIN{}: {:9.5f} V".format(channel, read_volts(channel)))
    print()
    time.sleep(1)

Frequently Asked Questions

What voltages can I measure?
Every input must stay between 0 and 5 V relative to GND. At gain 1 a single-ended reading covers 0 to 5 V, and a differential reading covers -5 to +5 V between two inputs. Some sellers of this module quote a 3 V limit: that applies when the chip's input buffer is switched on. The examples leave the buffer off, which allows the full 0 to 5 V. For higher voltages use a resistor divider, and never apply a negative voltage.
How do I take a differential reading?
Change the value written to the MUX register. Its upper four bits choose the positive input and its lower four bits the negative input. The examples write the channel number shifted left by four plus 0x08, which means that input against the ground reference. For AIN0 minus AIN1 write 0x01, and for AIN2 minus AIN3 write 0x23. A differential pair cancels noise that appears on both wires, which suits bridge sensors and load cells.
How do I measure very small signals?
Raise the gain. The lowest three bits of the ADCON register select it: 0 is gain 1, 1 is gain 2, 2 is gain 4, and so on up to 6 for gain 64. The full-scale range becomes 5 V divided by the gain, about 78 mV at gain 64. Send the self-calibration command again after changing the gain or the data rate, and divide the calculated voltage by the gain.
Why are my readings noisy, or wrong on some inputs?
Unconnected inputs float, so tie unused ones to GND. With the buffer off, the inputs load the source with about 150 kilohms at gain 1, so high-resistance sources such as large dividers read low. Use a lower-resistance source, or turn on the buffer for signals up to 3 V. A slower data rate also cuts noise. If you slow it down, lengthen the 12 ms settling delay to at least one full conversion.
The example says the ADS1256 was not found. What should I check?
Check that the 5V pin really has 5 V and that PDWN is tied to 3.3 V: a low PDWN puts the chip to sleep, and a floating one is unpredictable. Make sure DIN goes to MOSI and DOUT to MISO, that CS and DRDY are on the pins named in the code, and that ground is shared. On a Raspberry Pi, SPI must be enabled. If it still fails, a logic analyzer on the SPI lines shows quickly which signal is missing.
How fast can it sample?
Up to 30,000 samples per second on a single input. Switching inputs costs settling time: at the 100 samples per second used in the examples, each input change takes about 10 ms, so all eight inputs can be scanned roughly ten times a second. At the fastest setting the chip can switch inputs more than 4,000 times a second, at the price of more noise.
Does it work with 3.3 V boards even though it needs 5 V?
Yes. The 5 V supply feeds the analog side of the chip, and a regulator on the board makes 3.3 V for the digital side. DOUT and DRDY are therefore 3.3 V signals, and the SCLK, DIN, CS and PDWN inputs accept either 3.3 V or 5 V. An ESP32, Raspberry Pi or Pico connects directly. Only the power pin has to be 5 V.

Related Tutorials