12-channel touch sensor board MPR121 - thresholds

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
freddyk
 
Posts: 26
Joined: Thu Jun 02, 2011 9:15 pm

12-channel touch sensor board MPR121 - thresholds

Post by freddyk »

Hi

I am trying to get a MPR121 to read touches through 3-5mm of plastic. How can I increase the sensitivity? The guide says to use this line of code but I am not sure of the kinds of values I should put here:

setThreshholds(uint8_t touch, uint8_t release)

I also tried the 5 pin breakout board and it worked great through thick acrylic. I thought this other 12 pin board would have similar capabilities to read through plastic.

Does anyone know how to increase the sensitivity on theres 12 pin boards?

Thanks

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: 12-channel touch sensor board MPR121 - thresholds

Post by adafruit_support_bill »

SetThresholds takes values between 0 and 255. The default is 12 for touch and 6 for release. Lower numbers will increase sensitivity.

User avatar
freddyk
 
Posts: 26
Joined: Thu Jun 02, 2011 9:15 pm

Re: 12-channel touch sensor board MPR121 - thresholds

Post by freddyk »

Thanks.

Do you have any idea If I need to change that code in my Arduino script? If so where would I add it? In the setup section? Or do I need to edit it in the library .h file?

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: 12-channel touch sensor board MPR121 - thresholds

Post by adafruit_support_bill »

You can just add the call in your setup().

User avatar
freddyk
 
Posts: 26
Joined: Thu Jun 02, 2011 9:15 pm

Re: 12-channel touch sensor board MPR121 - thresholds

Post by freddyk »

Thanks but I tried that and I just get errors. In the example file I tried both:

Serial.println("MPR121 found!");

setThreshholds(uint8_t 12, uint8_t 6);

And

Serial.println("MPR121 found!");

setThreshholds(12, 6);

Any clues would be greatly appreciated. Thanks.

User avatar
freddyk
 
Posts: 26
Joined: Thu Jun 02, 2011 9:15 pm

Re: 12-channel touch sensor board MPR121 - thresholds

Post by freddyk »

I guess my question is no longer important. So far as soon as I try to extend a touch pad a few feet from the board it just endlessly blinks making it useless. I guess the entire wire is acting like a sensor or something. Total bummer. If there are any touch products that allow the conductive touch pad to be up to 5 feet away from the Arduino please let me know. I am in a bind.

Thanks

User avatar
freddyk
 
Posts: 26
Joined: Thu Jun 02, 2011 9:15 pm

Re: 12-channel touch sensor board MPR121 - thresholds

Post by freddyk »

I think I got it now. I can order a bunch of these momentary breakouts: https://www.adafruit.com/products/1374

If i install them close to the touch point I can connect them to the base Arduino with long wires that are not connected directly to the sensor. I hope it works.

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: 12-channel touch sensor board MPR121 - thresholds

Post by adafruit_support_bill »

Yes. The whole wire is sensitive. If you need the pads to be far from the board, the standalone momentary breakouts are probably your best bet.

User avatar
freddyk
 
Posts: 26
Joined: Thu Jun 02, 2011 9:15 pm

Re: 12-channel touch sensor board MPR121 - thresholds

Post by freddyk »

Thanks for your help. Live and learn. Ordering now. If these work, and save my bacon, I am naming my next pet adafruit :)

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: 12-channel touch sensor board MPR121 - thresholds

Post by adafruit_support_bill »


User avatar
freddyk
 
Posts: 26
Joined: Thu Jun 02, 2011 9:15 pm

Re: 12-channel touch sensor board MPR121 - thresholds

Post by freddyk »

I must have one! It seems so loyal.

User avatar
freddyk
 
Posts: 26
Joined: Thu Jun 02, 2011 9:15 pm

Re: 12-channel touch sensor board MPR121 - thresholds

Post by freddyk »

Victory! OMG touch sensors are so cool. And they saved my life or at least helped me keep my biggest client. I built the electronics and programmed the quiz
Kiosk.JPG
Kiosk.JPG (229.45 KiB) Viewed 5319 times
for this interactive kiosk for Kaiser Permanente. It is a combination of a touch screen quiz and then if the user gets a quiz question wrong they have to take a 'physical challenge' that consists of LED rings that light up indicating a button that needs to be pressed. If the user hits the buttons as they light up fast enough they can move on to the next question. My problem was that the buttons I fabricated (http://www.fredknack.com/jumpwall/) were just to hard to press. And it was live in a major Portland Oregon Mall!

Adafruit's momentary capacitive touch sensors saved the day and they work great! Thank you, Thank you! This has been so stressful but now it works better than ever. Capacitive touch is going to change the way I do everything from this point on. I recommend that every hacker out there give these things a try.

Adafruit rocks!

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: 12-channel touch sensor board MPR121 - thresholds

Post by adafruit_support_bill »

Looks great! Glad they worked out for you.

User avatar
ja450n
 
Posts: 21
Joined: Mon Jun 17, 2013 6:13 pm

Re: 12-channel touch sensor board MPR121 - thresholds

Post by ja450n »

i'm working on tweaking the sensitivity and found this thread, it doesn't look like the question was ever answers, so here's the answer:
Thanks but I tried that and I just get errors. In the example file I tried both:

Serial.println("MPR121 found!");
setThreshholds(uint8_t 12, uint8_t 6);

And

Serial.println("MPR121 found!");
setThreshholds(12, 6);

Any clues would be greatly appreciated. Thanks.
The problem is scope, you need to tell the program where to find the function 'setThreshholds', in the MPR121test sketch you declare an instance of the class Adafruit_MPR121 as 'cap'

Code: Select all

Adafruit_MPR121 cap = Adafruit_MPR121();
so you'd reference the setThreshholds function like so:

Code: Select all

cap.setThreshholds(6, 2);

User avatar
Micheldum
 
Posts: 3
Joined: Wed Mar 18, 2015 1:19 pm

Re: 12-channel touch sensor board MPR121 - thresholds

Post by Micheldum »

Hello there, I am new to linux but found those MPR121 touch sensor boards and can't find any detailed instruction on how to adjust sensitivity when hooked up to a Raspberry pi. I had no issues running the test program and inputs are well read when directly touching the leads to the input pins. I want to use a thin sheet of glass above copper foil in a kiosk panel but cannot find precise instructions on how to adjust the sensitivity.
Where do you find the line "setThreshholds(12, 6)" I understand that I need to lower the touch value until I get detection but where exactly (which directory and filename) is that instruction located in a Raspberry pi installation ?
I basically would like to be walked through the process. I looked at the Adafruit pdf manual but found it not detailed enough for my knowledge level...
Also how to I update new thresholds settings and run a new test?

Thanks loads.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”