mpr121 proximity nodes callibration

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
ghenk
 
Posts: 4
Joined: Fri Jan 06, 2023 11:26 am

mpr121 proximity nodes callibration

Post by ghenk »

Hello, I am using a mpr121 with arduino where I am reading proximity (touch) data from all nodes.

What i am strugling with is to get a good proximity respons. I have tried to implement this function by changing the way the data is interpret by the sketch. But then i realised there might be a register to write to in order to change the way the mpr121 read my fingers on copper plates. So i can callibrate it to my liking.

I want to set a baseline for normal finger pressure resulting in a mid rage value. a baseline for light finger pressure resulting in a low value and hard finger pressure resulting in a high value.

Is there a way to set and calibrate the mpr121 as the library is now?

For instance how do i set the baseline value?

like this:

Code: Select all

cap.writeRegister(MPR121_BASELINE_0, 2)
or
like this:

Code: Select all

 cap.writeRegister(MPR121_ECR, 0x00);
  cap.setThresholds(0x1E, 0x01);
  cap.writeRegister(MPR121_ECR, 0x8F);

User avatar
ghenk
 
Posts: 4
Joined: Fri Jan 06, 2023 11:26 am

Re: mpr121 proximity nodes callibration

Post by ghenk »

Excuse me i meant

Like this:

Code: Select all

cap.writeRegister(MPR121_BASELINE_0, 2)
or like this:

Code: Select all

cap.writeRegister(MPR121_ECR, 0x00);
  cap.setBASELINE_0(0x1E, 0x01);
  cap.writeRegister(MPR121_ECR, 0x8F);
Where 0x1E is the register i write to and 0x01 is the value i give to it.

I use:

Code: Select all

cap.setThresholds(12, 6);
to set the touch threshold and release values. This seems to work fine. But i want to chainge the baseline for medium proximity.

User avatar
ghenk
 
Posts: 4
Joined: Fri Jan 06, 2023 11:26 am

Re: mpr121 proximity nodes callibration

Post by ghenk »

I would like to know if it is possible at all. if not I think i have to alter the copper pcb board plates that i have designed and am using. They are large and are not covered by a solder mask. the added ground trace that surounds the touch plate is also touched when i touch a single node and is connected to arduino gnd seems to work a lot better than without. But in order to get a good respons from the plates i had to limit the working range from 10-380 to 10-60 in arduino code. This is a bit sad to limit the proximity data by this much. If there is a way to callibrate the mpr121 some more than only ''cap.setThresholds(12, 6);'' Please do tell :)

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: mpr121 proximity nodes callibration

Post by adafruit_support_mike »

There's no way to calibrate an MPR121 for the kind of results you want.

Fundamentally, the sensor measures the time it takes to charge the parasitic capacitance of the touch pad using a known amount of current. Bringing a finger near the touchpad changes the pad's capacitance since water can hold about 80x more capacitive energy than air.

The .setThresholds() function has no effect on the operation of the sensor. It just defines the amount of change in the sensed values the MPR121 defines as a 'touch' and how much change after that counts as a 'release'. The readings themselves don't change.

In addition, the MPR121 compensates for the effects of things like pad size and humidity (both of which have an effect on the readings) by tracking the average charging time and automatically adjusting the default 'normal' timing for each pad based on that information.
ghenk wrote: Sun Jan 08, 2023 6:25 am if not I think i have to alter the copper pcb board plates that i have designed and am using. They are large and are not covered by a solder mask.
Adding solder mask will have little effect on the parasitic capacitance of the pads.
ghenk wrote: Sun Jan 08, 2023 6:25 am the added ground trace that surounds the touch plate is also touched when i touch a single node and is connected to arduino gnd seems to work a lot better than without.
Having a GND ring around the touch pad does help by changing the geometry of the system.

A capacitor is any pair of conductive plates with insulation between them. For a single pad, we can calculate the effect of an infinitely large pad an infinite distance away and still get a meaningful value. In that sense, every object in the universe shares a capacitive connection to that infinitely-distant theoretical plate. The stored energy fills a volume of space that starts perpendicular to the surface of the pad, then becomes more spherical as the distance from the pad increases.

Putting a GND ring around a pad changes the geometry of the system by giving the capacitor an explicit second plate. The energy stored by that capacitor starts perpendicular to the pad, and ends perpendicular to the trace around the pad. That changes the field from a sphere to a torus whose center is in the middle of the pad and whose outer edge is at the edge of the GND ring. For the purposes of touch sensing, that's reasonably similar to the capacitor storing energy in a disc above the pad and GND ring.

As you've seen, the way a GND ring concentrates energy makes the pads more responsive. Having exposed conductive surfaces for both the pad and the GND ring will cause some minor problems though: human skin has a resistance between a few kilohms and a couple of megohms depending on the moisture at the surface of the skin, so a finger touching both the pad and the ring will conduct current from one to the other. It won't be much current, but for the small amount of charge stored in the parasitic capacitance it may as well be a short circuit.

Putting soldermask over both the pad and the GND ring will have a negligible effect on their capacitive behavior, but will eliminate conduction between them when a pad is touched.

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

Return to “Arduino”