Overview

The MPR121 is a 12-channel capacitive touch sensing controller manufactured by NXP Semiconductors. Communicating over I2CI^2C, it converts up to 12 individual conductive surfaces (copper pads, conductive paint, fruit, metal foil) into independent touch and proximity inputs.

Featuring an internal state machine that continually measures electrode capacitance, applies hardware digital filtering, and continuously updates baseline reference levels, the MPR121 automatically adjusts to environmental changes (humidity, temperature, dust). Electrodes ELE4 through ELE11 can double as 8 independent LED driver GPIO output pins, making the IC ideal for touch keypads, interactive installations, and musical instruments.

Quick reference

Operating voltage (VCC)3.3 V to 5.0 V DC (breakout module with 3.3V LDO)
IC supply voltage (VDD)1.71 V to 3.6 V DC (3.3 V nominal)
InterfaceI2CI^2C (Fast Mode up to 400 kHz)
Default I2CI^2C address0x5A (ADDR pin to GND)
Configurable I2CI^2C addresses0x5A (GND), 0x5B (3.3V), 0x5C (SDA), 0x5D (SCL)
Touch electrodes12 channels (ELE0 through ELE11)
Low power current29 μA29\ \mu\text{A} at 16 ms sampling interval / 3 μA3\ \mu\text{A} standby
Interrupt lineActive-Low IRQ pin (triggers on touch / release events)

Pinout

Standard breakout board / Raspberry Pi HAT header:

PinNameTypeDescription
1VCC / 3.3VPowerSupply input (+3.3 V to +5.0 V DC)
2GNDPowerGround reference (0 V)
3SCLDigital InputI2CI^2C Serial Clock
4SDADigital Input / OutputI2CI^2C Serial Data
5IRQDigital OutputActive-Low interrupt output (pull-up required)
6ADDRDigital InputI2CI^2C Address select pin
7–18ELE0ELE11Touch InputsCapacitive electrode pads 0 to 11

Specifications

ParameterSymbolMinTypMaxUnitConditions
Supply Voltage (Module)VCCV_{CC}3.33.3 / 5.05.5VPower rail with LDO
Active Supply CurrentIDDI_{DD}2940µA16 ms sampling period
Standby CurrentIsbI_{sb}38µAStop mode
Electrode Capacitance RangeCelecC_{elec}102000pFPer electrode channel
Charge CurrentIchargeI_{charge}11663µAProgrammable constant current source
Charge Timetcharget_{charge}0.5132µsProgrammable charge duration
Operating TemperatureToprT_{opr}-4085°CAmbient

Operating Principle & Baseline Tracking

For each electrode pin (ELE0ELE11), the MPR121 applies a constant current (IchargeI_{charge}) for a fixed duration (tcharget_{charge}) and measures the resulting voltage across the electrode capacitance CC:

V=Icharge×tchargeCV = \frac{I_{charge} \times t_{charge}}{C}

When a finger approaches an electrode, body capacitance increases total capacitance CC, causing the measured voltage VV to drop below the calibrated baseline. If the delta exceeds the programmable Touch Threshold (0x410x57), a touch event is registered.

Wiring

MPR121 PinArduino UnoESP32 / Raspberry PiNotes
VCC3.3V3.3VPower from 3.3V rail
GNDGNDGNDShared system ground
SCLA5GPIO 22 / Pin 5I2CI^2C Clock
SDAA4GPIO 21 / Pin 3I2CI^2C Data
IRQDigital D2GPIO 4 / Pin 11Active-Low interrupt (optional)

Example (Arduino Adafruit_MPR121)

cpp
#include <Wire.h>
#include "Adafruit_MPR121.h"

Adafruit_MPR121 cap = Adafruit_MPR121();

// Keeps track of the last pins touched
uint16_t lasttouched = 0;
uint16_t currtouched = 0;

void setup() {
  Serial.begin(9600);
  while (!Serial);

  Serial.println("Adafruit MPR121 Capacitive Touch sensor test");
  
  // Default address 0x5A
  if (!cap.begin(0x5A)) {
    Serial.println("MPR121 not found, check wiring!");
    while (1);
  }
  Serial.println("MPR121 found!");
}

void loop() {
  currtouched = cap.touched();
  
  for (uint8_t i=0; i<12; i++) {
    // Check if electrode i was just touched
    if ((currtouched & _BV(i)) && !(lasttouched & _BV(i)) ) {
      Serial.print("Electrode "); Serial.print(i); Serial.println(" touched");
    }
    // Check if electrode i was just released
    if (!(currtouched & _BV(i)) && (lasttouched & _BV(i)) ) {
      Serial.print("Electrode "); Serial.print(i); Serial.println(" released");
    }
  }

  lasttouched = currtouched;
  delay(100);
}

Common mistakes

  • Using excessively long unshielded wires to electrodes: Long wire leads add parasitic capacitance (>200 pF>200\text{ pF}), saturating the MPR121 baseline tracker and preventing touch detection. Keep electrode leads under 20 cm20\text{ cm}.
  • Touching electrode leads during power-on calibration: The MPR121 initializes baseline values immediately upon reset. Touching an electrode during power-on sets a false high baseline, making the pin unresponsive until reset.

Notes

  • MPR121 vs TTP229: MPR121 includes dynamic baseline autocalibration; TTP229 uses static threshold comparisons.

Assets & downloads