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

How to Use Adafruit MPR121: Examples, Pinouts, and Specs

Image of Adafruit MPR121
Cirkit Designer LogoDesign with Adafruit MPR121 in Cirkit Designer

Introduction

The Adafruit MPR121 (Part ID: 1982) is a capacitive touch sensor controller capable of detecting up to 12 touch inputs. This versatile component is ideal for creating touch-sensitive interfaces in a wide range of projects, from interactive art installations to custom control panels. It communicates via the I2C protocol, making it easy to integrate with microcontrollers like Arduino and Raspberry Pi.

Explore Projects Built with Adafruit MPR121

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Touch-Sensitive Interface with Adafruit MPR121 and Feather 32u4 Bluefruit
Image of MPR121: A project utilizing Adafruit MPR121 in a practical application
This circuit integrates an Adafruit MPR121 capacitive touch sensor with an Adafruit Feather 32u4 Bluefruit microcontroller. The MPR121 is powered by the Feather and communicates via I2C (SCL and SDA) to detect touch inputs, which can be processed or transmitted wirelessly by the Feather.
Cirkit Designer LogoOpen Project in Cirkit Designer
Adafruit Feather 32u4 Bluefruit with MPR121 Capacitive Touch Sensor Interface
Image of ALi WTSE: A project utilizing Adafruit MPR121 in a practical application
This circuit integrates an Adafruit MPR121 capacitive touch sensor with an Adafruit Feather 32u4 Bluefruit microcontroller. The MPR121 is powered by the 3.3V supply from the Feather and communicates with the microcontroller via I2C, with SCL connected to pin 3 and SDA connected to pin 2 of the Feather. This setup allows the Feather to detect touch inputs from the MPR121 for further processing or wireless communication.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO-Based Sensor Data Acquisition System with Bluetooth and Wi-Fi Connectivity
Image of smrpe: A project utilizing Adafruit MPR121 in a practical application
This circuit is a multi-sensor data acquisition system with wireless communication capabilities. It utilizes an Arduino UNO to interface with an MPU-6050 gyroscope, an Adafruit ADXL345 accelerometer, an Adafruit MPR121 capacitive touch sensor, and a SparkFun Electret Microphone for audio input. The system can transmit sensor data via an HC-05 Bluetooth module and an ESP8266 WiFi module, and it includes a bi-directional logic level converter for voltage level matching between devices. The circuit is powered by a 9V battery connected to the Arduino's Vin pin.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO R4 WiFi Capacitive Touch MIDI Controller with Visual Feedback and Sound Playback
Image of 自适应乐器: A project utilizing Adafruit MPR121 in a practical application
This circuit is an interactive touch-based MIDI controller and audio player. It uses an Arduino UNO R4 WiFi to interface with an MPR121 capacitive touch sensor for input, a MAX7219 8-digit 7-segment display for visual feedback, and a DFPlayer MINI for audio output through a loudspeaker. The system detects touch inputs, plays corresponding sounds, and sends MIDI notes.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with Adafruit MPR121

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 MPR121: A project utilizing Adafruit MPR121 in a practical application
Touch-Sensitive Interface with Adafruit MPR121 and Feather 32u4 Bluefruit
This circuit integrates an Adafruit MPR121 capacitive touch sensor with an Adafruit Feather 32u4 Bluefruit microcontroller. The MPR121 is powered by the Feather and communicates via I2C (SCL and SDA) to detect touch inputs, which can be processed or transmitted wirelessly by the Feather.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of ALi WTSE: A project utilizing Adafruit MPR121 in a practical application
Adafruit Feather 32u4 Bluefruit with MPR121 Capacitive Touch Sensor Interface
This circuit integrates an Adafruit MPR121 capacitive touch sensor with an Adafruit Feather 32u4 Bluefruit microcontroller. The MPR121 is powered by the 3.3V supply from the Feather and communicates with the microcontroller via I2C, with SCL connected to pin 3 and SDA connected to pin 2 of the Feather. This setup allows the Feather to detect touch inputs from the MPR121 for further processing or wireless communication.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of smrpe: A project utilizing Adafruit MPR121 in a practical application
Arduino UNO-Based Sensor Data Acquisition System with Bluetooth and Wi-Fi Connectivity
This circuit is a multi-sensor data acquisition system with wireless communication capabilities. It utilizes an Arduino UNO to interface with an MPU-6050 gyroscope, an Adafruit ADXL345 accelerometer, an Adafruit MPR121 capacitive touch sensor, and a SparkFun Electret Microphone for audio input. The system can transmit sensor data via an HC-05 Bluetooth module and an ESP8266 WiFi module, and it includes a bi-directional logic level converter for voltage level matching between devices. The circuit is powered by a 9V battery connected to the Arduino's Vin pin.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of 自适应乐器: A project utilizing Adafruit MPR121 in a practical application
Arduino UNO R4 WiFi Capacitive Touch MIDI Controller with Visual Feedback and Sound Playback
This circuit is an interactive touch-based MIDI controller and audio player. It uses an Arduino UNO R4 WiFi to interface with an MPR121 capacitive touch sensor for input, a MAX7219 8-digit 7-segment display for visual feedback, and a DFPlayer MINI for audio output through a loudspeaker. The system detects touch inputs, plays corresponding sounds, and sends MIDI notes.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Touch-sensitive buttons and sliders
  • Interactive art and installations
  • Custom user interfaces
  • Proximity sensing
  • Wearable electronics

Technical Specifications

The Adafruit MPR121 is based on the MPR121 IC from NXP Semiconductors and comes on a breakout board for easy integration. Below are the key technical details:

Specification Details
Operating Voltage 3.3V to 5V
Communication Protocol I2C
I2C Address (Default) 0x5A (configurable to 0x5B, 0x5C, 0x5D)
Number of Touch Inputs 12
Maximum Current Consumption ~1 mA
Operating Temperature Range -40°C to +85°C
Dimensions 25mm x 18mm x 2mm

Pin Configuration and Descriptions

The Adafruit MPR121 breakout board has the following pin layout:

Pin Name Description
VIN Power input (3.3V to 5V). Connect to the microcontroller's power supply.
GND Ground. Connect to the microcontroller's ground.
SDA I2C data line. Connect to the SDA pin of the microcontroller.
SCL I2C clock line. Connect to the SCL pin of the microcontroller.
IRQ Interrupt pin. Outputs a signal when a touch event is detected. Optional use.
ADDR I2C address selection pin. Leave unconnected for default address (0x5A).
RST Reset pin. Pull low to reset the MPR121.

Usage Instructions

How to Use the Component in a Circuit

  1. Power the MPR121: Connect the VIN pin to a 3.3V or 5V power source and the GND pin to ground.
  2. Connect I2C Lines: Connect the SDA and SCL pins to the corresponding I2C pins on your microcontroller.
  3. Optional Connections:
    • Connect the IRQ pin to a digital input pin on your microcontroller if you want to use interrupts.
    • Use the ADDR pin to change the I2C address if multiple MPR121 devices are used on the same bus.
  4. Attach Electrodes: Connect conductive materials (e.g., copper tape, wires) to the touch input pins (labeled 0–11) to act as touch sensors.

Important Considerations and Best Practices

  • Pull-Up Resistors: Ensure that the I2C lines (SDA and SCL) have pull-up resistors (typically 4.7kΩ). Many microcontroller boards, like the Arduino UNO, already include these.
  • Electrode Design: For optimal performance, use conductive materials with sufficient surface area for touch detection.
  • Noise Reduction: Keep the sensor and electrodes away from high-frequency noise sources to avoid false triggers.
  • Resetting the MPR121: If the sensor becomes unresponsive, toggle the RST pin or power cycle the device.

Example Code for Arduino UNO

Below is an example of how to use the Adafruit MPR121 with an Arduino UNO. This code requires the Adafruit_MPR121 library, which can be installed via the Arduino Library Manager.

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

// Create an instance of the MPR121 class
Adafruit_MPR121 cap = Adafruit_MPR121();

void setup() {
  Serial.begin(9600);
  while (!Serial) {
    // Wait for the serial monitor to open (for boards like Leonardo)
    delay(10);
  }

  Serial.println("Adafruit MPR121 Capacitive Touch Sensor Test");

  // Initialize the MPR121
  if (!cap.begin(0x5A)) {
    Serial.println("MPR121 not found. Check wiring or I2C address!");
    while (1);
  }
  Serial.println("MPR121 found!");
}

void loop() {
  // Read touch status
  uint16_t touched = cap.touched();

  // Print which electrodes are being touched
  for (uint8_t i = 0; i < 12; i++) {
    if (touched & (1 << i)) {
      Serial.print("Electrode ");
      Serial.print(i);
      Serial.println(" is being touched.");
    }
  }

  delay(100); // Small delay to avoid flooding the serial monitor
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. MPR121 Not Detected:

    • Ensure the I2C address is correct (default is 0x5A).
    • Check the wiring, especially the SDA and SCL connections.
    • Verify that pull-up resistors are present on the I2C lines.
  2. False Touch Events:

    • Reduce electrical noise by keeping the sensor away from high-frequency sources.
    • Ensure proper grounding of the circuit.
    • Use shielded cables for long electrode connections.
  3. No Touch Events Detected:

    • Verify that the electrodes are properly connected to the touch input pins.
    • Check the power supply voltage (3.3V to 5V).
    • Reset the MPR121 by toggling the RST pin.

FAQs

Q: Can I use more than one MPR121 on the same I2C bus?
A: Yes, you can use up to four MPR121 devices by configuring the ADDR pin to set unique I2C addresses (0x5A, 0x5B, 0x5C, 0x5D).

Q: What materials can I use for the touch electrodes?
A: You can use any conductive material, such as copper tape, aluminum foil, or conductive fabric.

Q: Can the MPR121 detect proximity without physical touch?
A: Yes, the MPR121 can detect proximity if the electrode is large enough and the sensitivity settings are adjusted.

Q: Is the MPR121 compatible with 3.3V microcontrollers?
A: Yes, the MPR121 works with both 3.3V and 5V logic levels, making it compatible with a wide range of microcontrollers.