BareConductive/mpr121

Can we have a dedicated example based for proximity detection

Closed this issue · 1 comments

Hi,

First of all, I would like to thank you guys for the library. It works like a charm !
I have a custom MPR121 user interface board and want to implement the proximity detection feature.
I tried the "DataStream" example but the 13th electrode reads 0 every time.
So if we could have a dedicated proximity detection example to explore this feature, that would be great.

Regards,
Sumant

Hi

Glad you are enjoying the library. The virtual 13th electrode proximity detection you are talking about is very layout specific and is generally most useful for proximity detection to a keypad or other array of finger-sized buttons. This is because the maximum distance for proximity detection is proportional to the total electrode area (and somewhat to its geometry) - hence it is limited for finger-sized electrodes. Connecting 12 finger-sized electrodes together to create a larger virtual surface at the beginning of the multiplex scan sequence allows for a greater proximity detection distance.

For most of our users, their electrode layout is more fluid and generally not a keypad array. Often individual electrode sizes are much larger and hence the virtual 13th electrode would become huge - and difficult to charge, even with the maximum 63uA charge current. For this reason, developing this feature in our library is not high on our priority list.

If you want to achieve proximity detection per-electrode (as opposed to the multi-electrode combination that the 13th electrode implements) I would suggest taking a look at the Datastream code in conjunction with our MPR121 grapher.

However, if you're keen on using the virtual 13th electrode I would start by taking a look at AN3893 and run from there. If you wanted to implement the functionality and submit a pull request I would gladly include it in our library (along with a credit to you).

Hope this helps

Stefan