Due to high demand expect some shipping delays at this time, orders may not ship for 3-4 business days. On MLK Day no orders will be shipped.
0

How to use bottom fat pins as capacitive touch sensors in Ar
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

How to use bottom fat pins as capacitive touch sensors in Ar

by waleedkadous on Wed Apr 01, 2020 1:23 am

Hi there!

I'm trying to work out how to use the #2 pin across the bottom as a capacitive touch sensor as suggested here: https://learn.adafruit.com/adafruit-clu ... ll#pinouts (about halfway down the page under GPIO).

I can't work out how to reliably do that using Arduino. Any thoughts or (boom-tish) clues?

waleedkadous
 
Posts: 1
Joined: Sat Oct 12, 2019 9:33 pm

Re: How to use bottom fat pins as capacitive touch sensors i

by kevinjwalters on Thu May 21, 2020 7:48 am

I only occasionally do Arduino programming and I've not explored the capactive touch but I did a bit of noodling and and I'll ask around to try and find you a proper answer.

It looks like it's implemented in CircuitPython as some simple code which sends a pulse to the pad as an output and then measures it as high impedance input. There's a lengthy discussion of how it was implemented for the nRF52840 in GitHub: adafruit/circuitpython nrf: implement touchio.TouchIn #1048 which ended up a time-based measurement approach. I think the code ended up in https://github.com/adafruit/circuitpyth ... le/touchio and that's used by anything which doesn't have native support in the hardware.

I see there's an Adafruit_FreeTouch arduino library but the comments and code suggest it's very SAMD21 specific and it doesn't show recent updates for SAMD51 or nRF52840.

There is code in the Adafruit_CircuitPlayground library for capacitive touch. That initially doesn't sound promising but it's been enhanced to work with the nRF52840-based Circuit Playground Bluefruit so I think all the code exists it's just a question of finding the right library or failing that best example to borrow.

kevinjwalters
 
Posts: 988
Joined: Sun Oct 01, 2017 3:15 pm

Re: How to use bottom fat pins as capacitive touch sensors i

by adafruit2 on Thu May 21, 2020 12:50 pm

https://github.com/PaulStoffregen/Capac ... its/master
has nRF52840 support

@kevin - please do not comment on github commits to get tech support questions answered, keep to the forums :)

adafruit2
Site Admin
 
Posts: 20485
Joined: Fri Mar 11, 2005 7:36 pm

Please be positive and constructive with your questions and comments.