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

How to Use MPR121 Capacitive Touch Sensor Breakout Board: Examples, Pinouts, and Specs

Image of MPR121 Capacitive Touch Sensor Breakout BoardDesign with MPR121 Capacitive Touch Sensor Breakout Board in Cirkit Designer

Introduction

The MPR121 Capacitive Touch Sensor Breakout Board is a sophisticated electronic component designed to add touch sensing capabilities to your projects. Utilizing the MPR121 chip, this breakout board can detect the touch or proximity of human fingers and provides a digital output signal for each of its 12 electrodes. Common applications include touch interfaces, interactive installations, and replacement of traditional buttons.

Explore Projects Built with MPR121 Capacitive Touch Sensor Breakout Board

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 Capacitive Touch Sensor Breakout Board 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 Capacitive Touch Sensor Breakout Board 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

Technical Specifications

Key Technical Details

Pin Configuration and Descriptions

Pin Number Pin Name Description
1 IRQ Interrupt output to microcontroller
2 ADDR I2C address select pin
3 SDA I2C data line
4 SCL I2C clock line
5 VDD Power supply (2.5V to 3.6V)
6 GND Ground
7-18 ELE0-ELE11 Electrode connections for touch inputs

Usage Instructions

Integration with a Circuit

  1. Powering the Board: Connect VDD to a 2.5V to 3.6V power source and GND to the ground.
  2. I2C Communication: Connect SDA and SCL to your microcontroller's I2C data and clock lines respectively.
  3. Address Selection: The ADDR pin can be connected to VDD, GND, or left floating to select between I2C addresses.
  4. Electrode Connections: Connect conductive material or objects to the ELE0-ELE11 pins for touch sensing.
  5. Interrupts: The IRQ pin can be connected to an interrupt-capable pin on your microcontroller to detect touch events.

Best Practices

Example Code for Arduino UNO

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

// You can have up to 4 on one i2c bus (connecting ADDR to 3.3V, GND or leaving it floating)
// but you can only have one sensor per unique i2c address.
Adafruit_MPR121 cap = Adafruit_MPR121();

void setup() {
  Serial.begin(9600);
  while (!Serial) { // needed to keep leonardo/micro from starting too fast!
    delay(10);
  }
  
  if (!cap.begin(0x5A)) {
    Serial.println("MPR121 not found, check wiring?");
    while (1);
  }
  Serial.println("MPR121 found!");
}

void loop() {
  // Get the currently touched pads
  currtouched = cap.touched();
  
  for (uint8_t i=0; i<12; i++) {
    // it if *is* touched and *wasnt* touched before, alert!
    if ((currtouched & _BV(i)) && !(lasttouched & _BV(i)) ) {
      Serial.print(i); Serial.println(" touched");
    }
    // if it *was* touched and now *isnt*, alert!
    if (!(currtouched & _BV(i)) && (lasttouched & _BV(i)) ) {
      Serial.print(i); Serial.println(" released");
    }
  }

  // reset our state
  lasttouched = currtouched;
  
  // comment out this line for detailed data from the sensor!
  delay(100);
}

Troubleshooting and FAQs

Common Issues

FAQs

Q: Can the MPR121 operate at 5V? A: No, the MPR121 is designed to operate between 2.5V and 3.6V. Using a higher voltage can damage the chip.

Q: How can I change the sensitivity of the touch detection? A: Sensitivity can be adjusted through the MPR121's internal registers. Refer to the datasheet for detailed register settings.

Q: Can I use the MPR121 with a microcontroller other than an Arduino? A: Yes, as long as the microcontroller supports I2C communication, you can interface with the MPR121.

Q: How do I clean the electrodes? A: Use a soft, dry cloth to gently wipe the electrodes. Avoid using any liquids or abrasive materials that could damage the board.

For further assistance, consult the MPR121 datasheet and ensure that your setup matches the recommended configurations.