Getting trouble with MPR121 Touch Sensor [SOLVED]

Hi everyone!
First at all, I shall apologize for my bad English, but it isn´t my mother tongue. :frowning:

I purchased a 12 key capacitive touch sensor based on I2C some days ago, and tried connecting it to my Arduino One. So I realized that I am not able to make it working right.

I looked for lots of info, but I am still lost, and that´s something I don´t like. :confused:
I wired the breakout such as it is shown in the pic you can see clicking on here: http://www.naylampmechatronics.com/modules//smartblog/images/30-single-default.jpg

Besides, I was following the next tutorial: Arduino | Adafruit MPR121 12-Key Capacitive Touch Sensor Breakout Tutorial | Adafruit Learning System

I just loaded to my Arduino microcontroller an example to check up that everything was going well. I attached it below.


/*********************************************************
This is a library for the MPR121 12-channel Capacitive touch sensor

Designed specifically to work with the MPR121 Breakout in the Adafruit shop 
 ----> https://www.adafruit.com/products/

These sensors use I2C communicate, at least 2 pins are required 
to interface

Adafruit invests time and resources providing this open source code, 
please support Adafruit and open-source hardware by purchasing 
products from Adafruit!

Written by Limor Fried/Ladyada for Adafruit Industries.  
BSD license, all text above must be included in any redistribution
**********************************************************/

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

// You can have up to 4 on one i2c bus but one is enough for testing!
Adafruit_MPR121 cap = Adafruit_MPR121();

// Keeps track of the last pins touched
// so we know when buttons are 'released'
uint16_t lasttouched = 0;
uint16_t currtouched = 0;

void setup() {
 while (!Serial);        // needed to keep leonardo/micro from starting too fast!

 Serial.begin(9600);
 Serial.println("Adafruit MPR121 Capacitive Touch sensor test"); 
 
 // Default address is 0x5A, if tied to 3.3V its 0x5B
 // If tied to SDA its 0x5C and if SCL then 0x5D
 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!
 return;
 
 // debugging info, what
 Serial.print("\t\t\t\t\t\t\t\t\t\t\t\t\t 0x"); Serial.println(cap.touched(), HEX);
 Serial.print("Filt: ");
 for (uint8_t i=0; i<12; i++) {
   Serial.print(cap.filteredData(i)); Serial.print("\t");
 }
 Serial.println();
 Serial.print("Base: ");
 for (uint8_t i=0; i<12; i++) {
   Serial.print(cap.baselineData(i)); Serial.print("\t");
 }
 Serial.println();
 
 // put a delay so it isn't overwhelming
 delay(100);
}

My problem lies in the fact that what appears in the Serial Monitor is the text "Adafruit MPR121 Capacitive Touch sensor test", and... Nothing else happens! It is kinda disgusting! >:(

So... What could I do? Any sort of help is welcomed! :slight_smile:
Thanks in advance!


I edit coz' I discovered the error. My MPR121 doesn´t work, when I touch one key, the IRQ pin had to change from 5 volts to 0 volts, but it keeps in 5 volts. So, it´s broken down.

The lesson I learnt is: don´t buy at Aliexpress! Especially when it is cheap!

I just took some pics which focus on my problem, wish they could clarify my issue. :smiley:

That´s the way I wired:

And that´s what appears in the Serial Monitor:

In case this is still relevant and for record.

You would get this output if the SDA/SCL wires are not connected properly.
"begin" will only return "false" if some other device will respond in an unexpected way. In most of the cases it will just hang on "read".

Your photo shows an ok connections. Perhaps your module is defective or was damaged.
I suggest to use a bi-directional logic level conversion on the SDA/SCL pins, as the MPR121 is a 3.3V device.

Good luck.