touchRead() range?

Status
Not open for further replies.

kriista

Member
So I'm coding up a MIDI controller where I'm using capacitive touch on a Teensy 3.2 and I want to try to maximize the range/output I'm getting with this. At the moment I'm, roughly, getting a range of ~1000 to ~6000. I want to build in a calibration routine where I can store the range in the EEPROM so it is fixed on startup, but I want to know what this range is impacted by. Is it just a byproduct of the circuit/wiring, or will it vary a lot by location (in a different house/place), power (different computer/USB powering), etc...

As in, can/should I create a calibration routine where I fix the min/max to scale it with in the EEPROM or do I have to do this "per use" basically as it will vary a ton?
 
In my experience (small Buchla-type PCB keyboards) the circuit is the most important bit. I ended up with a large groundplane on the bottom layer below the keys to stabilize/shield a bit. I do calibrate on start out of habit but it's usually similar with battery USB vs. computer USB power...haven't tried regular ol' alkaline batteries now that I think about it.

For robustness, might try starting up with a fingers on one or two keys to confound the startup calibration (as one might do holding a wind controller) and also see what changes with your controller placed on a metal surface during calibration. I should do that, too!

FWIW I ultimately used Freed's FastTouch library and a multiplexer instead of TouchRead and I'm not using pressure for CC (yet).
 
Yeah, I'll mess around with adding a ground plane. Having pressure is kind of an afterthought as I was initially only interested in binary on/off, so I'll mess with the hardware a bit to see if I can improve things.

I was starting to add a calibration routine, but I think I may just hardbake some values that work, and go with that (at least for now). If it doesn't behave nicely on other computers or setups, I'll revisit the idea. I don't want to have to do a calibration routine every time I plug it in (or the computer wakes/sleeps (don't know if that kills power)).

Good to know about Freed's library. Shame it doesn't seem to do variable output (as far as I could see, quickly checking the examples). From you mentioning that, I did test and see that using touchRead() gives me less latency than the Flicker.h equivalent though, so will definitely go with that, if nothing else.

It's also crazy how sensitive it is. I'm considering even adding a 'hover' output, as I definitely get increased values if I hover my finger over the metal.
 
Hi,

I saw your posts and thought I would see if perhaps you may have been able to addess the issue with the touch read being quite noisy. I was thinking of implementing a bite sensor similar to the EWI's where two diverging metal strips produce a capacitance change as they are brought closer together providing a value mapped to modulation, etc. This works with one Teensy touch pin to one plate and ground to the other but I am getting strong noise (variance) in the values.. like + / - 20-% I tried to keep the connections short, but I just thought I'd see if you may have had any tips to share :)

Cheers,
John
 
In the end I'm still using touchRead() but then running that into the ResponsiveAnalogRead library. It's still fairly noisy unless I crank the smoothing up, which adds latency, so just a bit of smoothing is what I have now.

For my purposes it's ok enough as I only really need to know "light touch" vs "heavy touch" more or less.
 
Thanks for your reply. I'll have a play with the library and see if I can improve the response enough for my use.

Cheers,
John
 
Status
Not open for further replies.
Back
Top