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 designed for detecting touch inputs. It is based on the MPR121 IC, which supports up to 12 touch-sensitive electrodes. This module is widely used in interactive projects, touch-based user interfaces, and other applications requiring touch detection. Its compact design and I2C communication interface make it easy to integrate into a variety of electronic systems.

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 and Use Cases

Technical Specifications

The following are the key technical details of the MPR121 Breakout V12:

Parameter Value
Operating Voltage 1.8V to 3.6V (typically powered at 3.3V)
Communication Interface I2C (up to 400kHz)
Number of Touch Inputs 12 electrodes
Maximum Current Consumption 29 µA (typical, in normal operation)
Electrode Sensitivity Configurable via registers
Operating Temperature -40°C to +85°C
Dimensions ~25mm x 25mm

Pin Configuration and Descriptions

The MPR121 Breakout V12 module typically has the following pinout:

Pin Name Description
VCC Power supply input (3.3V recommended)
GND Ground connection
SDA I2C data line (connect to microcontroller's SDA pin)
SCL I2C clock line (connect to microcontroller's SCL pin)
IRQ Interrupt output (active low, indicates a touch event)
ADDR I2C address selection pin (connect to GND for default address 0x5A)
ELE0-ELE11 Electrode connections for touch inputs (up to 12 touch points)

Usage Instructions

How to Use the MPR121 Breakout V12 in a Circuit

  1. Power the Module: Connect the VCC pin to a 3.3V power source and GND to ground.
  2. Connect I2C Lines: Connect the SDA and SCL pins to the corresponding I2C pins on your microcontroller.
  3. Set the I2C Address: By default, the module's I2C address is 0x5A. You can change it by connecting the ADDR pin to different voltage levels (refer to the MPR121 datasheet for address mapping).
  4. Connect Electrodes: Attach conductive materials (e.g., copper tape) to the ELE0-ELE11 pins to act as touch-sensitive electrodes.
  5. Interrupt Pin (Optional): Connect the IRQ pin to a digital input on your microcontroller to detect touch events without polling.

Important Considerations and Best Practices

Example Code for Arduino UNO

Below is an example of how to use the MPR121 Breakout V12 with an Arduino UNO:

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

// Create an MPR121 object
Adafruit_MPR121 cap = Adafruit_MPR121();

// Check if the MPR121 is connected
void setup() {
  Serial.begin(9600);
  Serial.println("MPR121 Touch Sensor Test");

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

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

  for (uint8_t i = 0; i < 12; i++) {
    // Check if electrode i is touched
    if (touched & (1 << i)) {
      Serial.print("Electrode ");
      Serial.print(i);
      Serial.println(" is touched.");
    }
  }
  delay(100); // Small delay to avoid flooding the serial monitor
}

Notes on the Code

Troubleshooting and FAQs

Common Issues and Solutions

  1. MPR121 Not Detected

    • Cause: Incorrect wiring or I2C address mismatch.
    • Solution: Verify the SDA and SCL connections. Ensure the ADDR pin is set correctly for the desired I2C address.
  2. Touch Inputs Not Responding

    • Cause: Poor electrode design or insufficient sensitivity.
    • Solution: Use larger conductive surfaces for electrodes. Adjust sensitivity settings in the MPR121 configuration registers.
  3. Erratic Behavior

    • Cause: Electrical noise or unstable power supply.
    • Solution: Use shorter wires for electrodes and ensure a stable 3.3V power source.
  4. Multiple Electrodes Triggering Simultaneously

    • Cause: Cross-talk between electrodes.
    • Solution: Increase spacing between electrodes and reduce wire length.

FAQs

Q: Can I use the MPR121 with a 5V microcontroller?
A: Yes, but you must use a level shifter for the I2C lines, as the MPR121 operates at 3.3V logic levels.

Q: How do I increase the sensitivity of the touch inputs?
A: Sensitivity can be adjusted by modifying the electrode configuration registers in the MPR121. Refer to the datasheet for details.

Q: Can I use fewer than 12 electrodes?
A: Yes, you can use as many or as few electrodes as needed. Unused electrodes should be left unconnected.

Q: Is the MPR121 suitable for outdoor use?
A: The MPR121 is not weatherproof. If used outdoors, ensure proper protection against moisture and environmental factors.

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