Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use MPR121 Breakout V12 - Touch sensor: Examples, Pinouts, and Specs

Image of MPR121 Breakout V12 - Touch sensorDesign with MPR121 Breakout V12 - Touch sensor in Cirkit Designer

Introduction

The MPR121 Breakout V12 is a capacitive touch sensor module based on the MPR121 IC, manufactured by various Chinese manufacturers. This breakout board enables touch detection on up to 12 electrodes, making it ideal for creating interactive touch-based interfaces. It is widely used in applications such as touch-sensitive control panels, musical instruments, and interactive art installations. The MPR121 communicates via the I²C protocol, making it easy to integrate with microcontrollers like Arduino, Raspberry Pi, and others.

Explore Projects Built with MPR121 Breakout V12 - Touch sensor

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 Adafruit Feather 32u4 Bluefruit with MPR121 Capacitive Touch Sensor Interface: A project utilizing MPR121 Breakout V12 - Touch sensor 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.

Open Project in Cirkit Designer
Image of Capacitive Touch and Ultrasonic Sensor Interface with Adafruit Feather nRF52840 Sense: A project utilizing MPR121 Breakout V12 - Touch sensor in a practical application
Capacitive Touch and Ultrasonic Sensor Interface with Adafruit Feather nRF52840 Sense

This circuit features an Adafruit Feather nRF52840 Sense microcontroller connected to an ultrasonic sensor for distance measurement and an Adafruit AT42QT1010 capacitive touch sensor for touch input. The ultrasonic sensor's Trigger and Echo pins are interfaced with the microcontroller's digital pins D6 and D9, respectively, to send and receive ultrasonic signals. Additionally, a pressure-sensitive conductive sheet (Velostat) is connected in series with a 10k Ohm resistor to the microcontroller's analog pin A0, likely forming a pressure sensor.

Open Project in Cirkit Designer

Common Applications


Technical Specifications

Key Technical Details

Parameter Value
Operating Voltage 1.8V to 3.6V
Recommended Voltage 3.3V
Communication Protocol I²C (up to 400kHz)
Number of Touch Inputs 12
Maximum Electrodes 13 (when using proximity mode)
Current Consumption 29 µA (typical in normal mode)
Operating Temperature -40°C to +85°C
Dimensions ~25mm x 25mm (varies by board)

Pin Configuration and Descriptions

The MPR121 Breakout V12 typically has the following pin layout:

Pin Name Pin Type Description
VCC Power Input Connect to 3.3V power supply.
GND Ground Connect to the ground of the circuit.
SDA Data Line I²C data line. Connect to the SDA pin of the microcontroller.
SCL Clock Line I²C clock line. Connect to the SCL pin of the microcontroller.
IRQ Interrupt Active-low interrupt pin. Indicates a touch event.
ADDR Address Select Sets the I²C address. Connect to GND for 0x5A, or to VCC for other options.
ELE0-ELE11 Touch Inputs Electrodes for touch detection. Connect to conductive materials or pads.

Usage Instructions

How to Use the MPR121 in a Circuit

  1. Power the Module: Connect the VCC pin to a 3.3V 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Ω) if not already present on the breakout board.
  3. Set the I²C Address: Use the ADDR pin to configure the I²C address. For most applications, connect it to GND for the default address (0x5A).
  4. Connect Electrodes: Attach conductive materials (e.g., copper tape, wires, or conductive ink) to the ELE0 to ELE11 pins for touch detection.
  5. Interrupt Pin (Optional): Connect the IRQ pin to a digital input on your microcontroller to detect touch events without continuous polling.

Arduino Example Code

Below is an example of how to use the MPR121 with an Arduino UNO. This code uses the Adafruit MPR121 library, which simplifies communication with the sensor.

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

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

// Variable to store the last touched state
uint16_t lastTouched = 0;

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

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

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

void loop() {
  // Get the current touch state
  uint16_t touched = cap.touched();

  // Check for changes in touch state
  for (uint8_t i = 0; i < 12; i++) {
    // Check if the current electrode was just touched
    if ((touched & (1 << i)) && !(lastTouched & (1 << i))) {
      Serial.print("Electrode ");
      Serial.print(i);
      Serial.println(" was just touched.");
    }
    // Check if the current electrode was just released
    if (!(touched & (1 << i)) && (lastTouched & (1 << i))) {
      Serial.print("Electrode ");
      Serial.print(i);
      Serial.println(" was just released.");
    }
  }

  // Update the last touched state
  lastTouched = touched;

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

Important Considerations


Troubleshooting and FAQs

Common Issues

  1. MPR121 Not Detected

    • Cause: Incorrect I²C wiring or address configuration.
    • Solution: Double-check the SDA and SCL connections. Ensure the ADDR pin is set correctly.
  2. Touch Events Not Detected

    • Cause: Poor electrode connection or insufficient conductive material.
    • Solution: Verify the connections to the ELE pins and use larger conductive surfaces.
  3. Erratic or False Touch Events

    • Cause: Electrical noise or long electrode wires.
    • Solution: Shorten electrode wires and ensure proper grounding.
  4. IRQ Pin Not Working

    • Cause: Interrupt pin not connected or configured.
    • Solution: Ensure the IRQ pin is connected to a digital input and properly configured in the code.

FAQs


This concludes the documentation for the MPR121 Breakout V12 - Touch Sensor.