This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Is there a way to get more capacitive touch inputs?

Both the capacitive touch library and the driver (which is better ?) are using the analog inputs. There are only 8 of them , and we need 10 at least buttons.

Is there a way to "cheat" ? I need different buttons where you can also detect when I touch 2 at once.

The docs says you can connect 2 pads for the same analog pin which seems impossible knowing the basics of hardware and capacitance ( how one pin differentiate between to shorted pins?) infocenter.nordicsemi.com/index.jsp

Thanks.

  • Hello Lola

    The idea of connecting the input to two pads is described under the resource usage section here. It states that neighboring pads should not be connected to the same input pin. That way by checking the neighboring buttons, you can tell which way the finger is sliding.

    In theory, I think it might be possible for the sensing circuit to tell two different buttons apart, if the two button do not have the same capacitance. Mind you, I have never tried this myself.

    If their capacitance is far enough apart, and you do not have coupling from one to the other, you might be able to tell one pad from the other by how much the frequency of the relaxation oscillator changes. For example, one pad would change the frequency from f0 to f1, the second pad from f0 to f2. If both were pressed, you would get frequency f3.

    A limitation to this however is that the change in capacitance is dependent on many different things, pad size and shape, size of finger, skin moisture etc. so the capacitance can vary a lot. Sadly I am not sure how realizable it would be.

    Best regards

    Jørn Frøysa

  • Thanks very much, your solution sounds cool but not for production obviously. Is there a way to get more then 8 using some kind of digital input manipulation ? I could not find any library that does that .

  • Unfortunately no, the comparator input is limited to the analog input pins. The digital inputs does not have the ability to sense input levels other than high or low.

  • With high and low you can do things :) for example to measure how long is it takes from the moment you raise to high on 1 pin, to the moment you sense high on the other pin that connected to him (will be changed based on capacity). But maybe I am wrong. Thanks.

  • I didn't think of that, but you're right it should be possible. I spoke with a colleague and he pointed me to this. I don't know how well it works, but it is a cap-sense example using GPIO. It does not work with the softdevice due to the direct use of PPI (Hardware registers), and it is for the nRF51. But perhaps you can find something that helps you.

Related