Hello,
We have developped a prototype board for a capacitive touch based on MPR12 that communicats with ESP32 microcontroler and I used library developped by Adafruit as a driver for I2C communication. However, during the testing stage, I noticed that sensor detects a lot of noise (a Key was touched without intervention of person).
I tried changing the values of the relevant registers (0x5C, 0x5D), but nothing changes.
Any help please.
MPR121 detecs noise
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- Haythemjls
- Posts: 4
- Joined: Thu Mar 23, 2023 8:42 am
MPR121 detecs noise
- Attachments
-
- IMG_20230323_113530.jpg (133.59 KiB) Viewed 103 times
-
- IMG_20230323_113523.jpg (139.25 KiB) Viewed 103 times
-
- IMG_20230323_113459.jpg (131.91 KiB) Viewed 103 times
- adafruit_support_bill
- Posts: 88154
- Joined: Sat Feb 07, 2009 10:11 am
Re: MPR121 detecs noise
Sensitivity and resistance to noise and spurious triggering is influenced to a great degree by the design of the touchpad itself.
Microchip has an app note with lots of good information about touchpad design:
https://ww1.microchip.com/downloads/en/ ... 2934-B.pdf
[edit]
Freescale has a couple of app-notes on the subject as well:
https://www.nxp.com/docs/en/application-note/AN3863.pdf
https://www.nxp.com/docs/en/application-note/AN3747.pdf
Microchip has an app note with lots of good information about touchpad design:
https://ww1.microchip.com/downloads/en/ ... 2934-B.pdf
[edit]
Freescale has a couple of app-notes on the subject as well:
https://www.nxp.com/docs/en/application-note/AN3863.pdf
https://www.nxp.com/docs/en/application-note/AN3747.pdf
- Haythemjls
- Posts: 4
- Joined: Thu Mar 23, 2023 8:42 am
Re: MPR121 detecs noise
Hi,
According to the MPR121 datasheet, there are no specific recommendation to design PCB, and I have respected all the constraints to design the capacitive keypad. There is no recommendation for a specific size of touchpad for the MPR121 in datasheet and it works well.
However, I wonder about the noise it detects from time to time and if there is any software solution developed by Adafruit (enabling and configuring filter registres) to solve this issue ?
Thank you.
According to the MPR121 datasheet, there are no specific recommendation to design PCB, and I have respected all the constraints to design the capacitive keypad. There is no recommendation for a specific size of touchpad for the MPR121 in datasheet and it works well.
However, I wonder about the noise it detects from time to time and if there is any software solution developed by Adafruit (enabling and configuring filter registres) to solve this issue ?
Thank you.
- adafruit_support_bill
- Posts: 88154
- Joined: Sat Feb 07, 2009 10:11 am
Re: MPR121 detecs noise
As with most devices of this type, the data sheet just covers the internal operation of the chip. Freescale has a library of application notes associated with the chip covering things such as touchpad design, PCB layout, noise filtering and false touch rejection.According to the MPR121 datasheet, there are no specific recommendation to design PCB
https://www.nxp.com/products/no-longer- ... ler:MPR121
- Haythemjls
- Posts: 4
- Joined: Thu Mar 23, 2023 8:42 am
Re: MPR121 detecs noise
I would like to share with you my software proposal to solve the noise problem. there is some improvement and the sensor detects less noise now.
Could you please help me to improve my code ?
Could you please help me to improve my code ?
Code: Select all
currtouched = cap.touched();
for (uint8_t i=0; i<12; i++) {
uint16_t baseValue = cap.baselineData(i); //// Baseline measurement
// it if *is* touched and *wasnt* touched before, alert!
if ((currtouched & _BV(i)) && !(lasttouched & _BV(i)) ) {
Serial.print("Baseline --> ");Serial.print(i);Serial.print(" : ");
Serial.println(baseValue);
uint16_t touchedValue = cap.filteredData(i); // Measure the amount of charge after pressing on the touchpad.
delay(10);
Serial.print("Value after pression");Serial.print(i); Serial.print(" : ");
Serial.println(touchedValue);
uint8_t Threshold = baseValue - touchedValue;
if(Threshold > 40){
Serial.print(i); Serial.println(" touched");}
else if(Threshold <40){
Serial.print("Noise detected"); }
delay(80);
}
}
// reset our state
lasttouched = currtouched;
- adafruit_support_bill
- Posts: 88154
- Joined: Sat Feb 07, 2009 10:11 am
Re: MPR121 detecs noise
These forums are for the support of Adafruit products. We do not provide free engineering support for 3rd party products or custom designs.
Please be positive and constructive with your questions and comments.