sku: SEN-09695
Description: This is a breakout board for Freescale's MPR121QR2. The MPR121 is a capacitive touch sensor controller driven by an I2C interface. The chip can control up to twelve individual electrodes, as well as a simulated thirteenth electrode. The MPR121 also features eight LED driving pins. When these pins are not configured as electrodes, they may be used to drive LEDs.
There a four jumpers on the bottom of the board, all of which are set (closed) by default. An address jumper ties the ADD pin to ground, meaning the default I2C address of the chip will be 0x5A. If you need to change the address of the chip (by shorting ADD to a different pin), make sure you open the jumper first. Jumpers also connect SDA, SCL and the interrupt pin to 10k pull-up resistors. If you don't require the pull-up resistors you can open the jumpers by cutting the trace connecting them.
There is no regulation on the board, so the voltage supplied should be between 2.5 and 3.6VDC. The VREG pin is connected through a 0.1uF capacitor to ground, which means, unless you modify the board, you can't operate the MPR121 in low-supply voltage mode (1.71-2.75VDC).
Documents:
RTL-10774
Touch Sense Shield (Retail)SEN-10250
MPR121 Capacitive Touch KeypadLCD-08977
Nintendo DS Touch ScreenCOM-09903
LinkM - USB to I2C
Comments 32 comments
Whenever I read the register addresses 0x00 and 0x01, the OCVF bit is set to 1. In the documentation, it says that a value of 1 for the OCVF means an incorrect Rext resistor value. This resistor should be 75k ohms and I double-checked to make sure it is, but I still get this error flag. Any thoughts? Maybe something not even to worry about?
Actually, what I’m seeing is not the OCVF bit set but when I read from registers 0x00 and 0x01 I acquire the same data for both. I’ll have to dig in deeper.
It would be awesome to see a tutorial on how to use this with an Arduino and some homemade buttons. I’d like to use this to make a beer pong table like this one, http://www.youtube.com/watch?v=j4-ZTZNe2eM. Does anyone think this would work through some epoxy?
This should help http://www.eetimes.com/design/analog-design/4009622/The-art-of-capacitive-touch-sensing
i believe someone adapted the AVR example to function on an arduino.
ah here it is:
http://www.prize-pony.com/blog/electronics/using-a-mpr121-with-arduino/
its only an adaptation but it works for me.
i got mine today and im currently optimizing the code for the arduino. for instance im adding support for the arduino interupt. i might try to create a library for this later on
regarding the Epoxy Question:
im not certain. i have had that electrodes work as capacitive sensors. il check a bit
The Wire library for the Arduino is not so great, and I would recommend directly using the AVR example.
As far as the epoxy is concerned, it’s fine. It has a dielectric constant of approximately 4, but your biggest issue will be air bubbles trapped inside the epoxy. If you can get those out you’ll have fairly uniform results. For proximity sensing, your best bet will be to have a large electrode, the largest charge current (63 uA) and the largest charge time (128 ms) of this sensor. If you have big enough electrodes, you need not use the proximity sensing mode of this sensor, which essentially ties all electrodes together to act as a proximity sensor.
For a beer pong table, if you expect to detect the ping pong ball when it lands inside the cup, forget it. The change in capacitance would be so small that you wouldn’t be able to separate it from the noise. A full cup verses an empty cup, however, is doable. The calibration is the hardest part in working with these sensors.
Is it possible to use several of these connected to one microprocessor?
Yes, but you’ll need to very carefully cut one of the traces on the back of the board. On the bottom of page 3 of the datasheet they specify what’s required to change the address. Just connect the address pin to VSS, VDD, SCA or SCL to change it.
I checked out the spec sheet and it is still not super clear how to daisy chain them. I need about 30 touch sensors for my project, can you help me?! is there code for this anywhere?
With some I2C devices there are more addresses available, but this chip has only has three. So, you’re limited to three per I2C line. It’s possible you could use an arrangement such as two 8 channel multiplexers, one for the data line and one for the clock line, and have 3 devices on each channel of the multiplexer.
For what reason do you need so many sensors?
This is awesome! (starts thinking about a DIY Percussion controller…)
(creates public wishlist)
what does the IRQ pin do?
Quotes from datasheet:
* “ Active Low Open-drain Interrupt Output
* ”[It] is triggered any time a touch or
release of a button is detected".
Then, without a microprocessor, standalone, the IRQ pin acts like a switch? A low level output until untouch one of the 12 buttons??
It only outputs a pulse when any button is pressed and a pulse when any button is released. It does not output a constant pulse from the time the button is pressed to the time the button is released. The pin’s primary purpose is to tell the microcontroller when there is a state change of the buttons so the microcontroller can get the data from the MPR121.
Thank you!!! I really wanted a constant pulse without a microcontroller.
I’m going to make a board for this IC with just a microcontroller and the capacitive touch IC on it. That way, the microcontroller can be programmed to output constant pulses for each button.
That would be great. I am going to interface it with a schmitt trigger, maybe in that way I can avoid the use of a microcontroller.
You could also look elsewhere as there are touch controllers that output directly to pure digital values when pressed rather than using i2c
I have an inkling that my sda pin on my arduino is not working. I used to be able to get the mpr121 up and running with ease on my arduino, but it no longer sends any data when I press the electrodes. I have tested the voltage and ground pins, however not the irq so that is still a possibility. But when I ran a program to set each analog input as an input for a push button, the push button only got a response on a5 and A0, leading me to believe a4, the sda pin, is no longer working. How can I verify this/fix this?
If you have access to an oscilloscope you could look at the signal coming off SDA. Otherwise, I would suggest trying to write a value to a register on the sensor and then read it back. If it’s coming back as 0x00 or something other than what you wrote to that register, then you can definitively make the statement that something is amiss.
Yes.., but where are the actual sensors that I can connect to it??
You make your own. They’re typically pads on a pcb, or a matrix of Indium Tin Oxide (or Aluminum Zinc Oxide) traces that are deposited on the inside of the glass covering a display screen, as in the case iPads, iPhones, smart phones, etc.
All you really need is a wire connecting to a conductive material. I’m currently using thin copper sheeting. Some people use aluminum foil with an alligator clip connecting the foil and the wire. It all depends upon your application.
The board detects the touch, but the interrupt pulled low permanently and does not come back to high. Can anyone tell what is the problem or where could be the problem?
Is there a schematic available for this board?
There is now! Link.
Thanks!
I’m looking at the datasheet and it says it only tolerates Vdd+0.3V on SCL and SDA pins (so basically a maximum of 3.6V). However interfacing directly with an arduino means the arduino pulls those pins at 5V.
Question is, is this stable in production? Is there any circuitry recommended to couple this board to an arduino?
The Arduino Wire library does a lot of things right, and one thing wrong. The right things are that it implements a correct I2C interface that grounds the lines for 0, and sets them to high-Z inputs for 1, so it will work correctly for 3.3V I2C parts. The wrong thing is that the library turns on the weak pull-up (WPU) resistors by default, which connects the I2C lines via 20K resistors to 5V. There’s a fair amount of controversy over this, and the library will likely change at some point in the future to at least make this non-default behavior. It’s also possible to modify the library yourself to turn the WPU resistors off.
But in practice, the WPU resistors are so small that they can’t transfer much current back to the device (in fact they’re so weak that they don’t really make very good I2C bus pullup resistors). And, if other I2C bus pullup resistors to 3.3V are present, as they are on this board, those will overpower the WPU resistors. For example, this board has 10K pullups to 3.3V. If you parallel those with the WPUs to 5V, no more than 3.8V will appear on the I2C lines. This is above the recommended maximum, but not as bad as putting 5V straight onto those lines. I’ve personally never had a problem running 3.3V I2C parts on a 5V Arduino when using outboard I2C pullup resistors to 3.3V, but of course your mileage may vary.
Is this as good as the CapSense from Cypress? I want to make a slider (or two), and the SmartSense feature on the CapSense sounds promising, but the hardware/software assembly is easier with this.
I created a touch volume control slider wheel following the Bildr tutorial and using a digital potentiometer. Here is a video of it in action.
http://www.youtube.com/watch?v=9ZmCSceEOb0&feature=share&list=UUWsBOpI7xEaGsXV33ONulSw