Connecting 10-14 capacitive sensors to Arduino nano

Hello world!
I'm building a midi device using the Arduino nano and I want to connect around 10-14 capacitive sensors to the board. I need to be able to read/press multiple sensors simultaneously so I've looked into using shift registers, but as far as i understand they can only read digital inputs and therefore not my analog capacitive sensors.
How du i get around this problem? is there perhaps a smart way using an additional ADC? And can i even send a clock signal/ pulse through the shift register?
I'm new to diy electronics and my google skills can't get me any further, so any help or creative ideas are appreciated!
thanks in advance :slight_smile:

you can find ready made capacitive touch sensors that will just go HIGH when you touch the surface then you don't need an analog pin

1 Like

aaah that's a great idea! But I want to make my own sensors because i need it to curve, but the circuit on the picture doesn't seem to hard to recreate so I might try that :thinking:

Of course you can, the general idea is to power the sensors 1 at a time and read them when they are powered. That way you can read as many analog values as you like. If you have ever used a ESP8266 with the ADC exposed (a nodeMCU for instance) you know that there is only 1 ADC and using multiple analog inputs can be done by powering the sensors 1 at a time and relate the reading of the ADC to the sensor that is being powered.

1 Like

the sensor can be below a (not too thick) surface like wood or plastic or glass and would still detect the touch

1 Like

I think what you want is an analog multiplexer chip.

1 Like

yeah that's true. I'm building the device in a pvc tube, so the air between the sensor and the tube might be a problem but it shouldn’t be to hard to solve, thanks again! :slight_smile:

ah okay, amazing! this was very helpfull, thanks a lot! :slight_smile:

But analog multiplexers can't read multiple sensor-values simultaneously can they? :thinking:

Right, but OP had considered using shift registers, for which the same thing is true.

And if we're being nitpicky, if you really want to read multiple sensor values "simultaneously", you need one processor core per value.

In music applications, everything's a matter of latency - a multiplexer will increase latency, sure, but with anything digital in your chain, you always have to accept some of it. So this criterion of "simultaneousness" may or may not actually be important.

No it is not all that important if you are taking measurements and sending them as midi commands. A 3 byte midi command takes about 1ms to transmit, which is quite a bit more than it would tak to read all sensors.

if it's just the equivalent of a digitalRead() you can get a full port status - like 8 digital reads - in 1 go on a UNO for example and it's pretty fast since it's just accessing a register that is mapped into memory - so as fast as a byte read in SRAM. Reading 2 ports would not be "simultaneous" but pretty darn close (less than a µs) which is negligible when it comes to user physical reaction and coordination of multiple fingers

I make a lot of MIDI instruments that use touch sensors.

Most of the time I use a MPR121. This is an I2C interface and has 12 touch sensors. You can get these chips on a board from many places on eBay or other vendors like this one

You can change the address of these chips so you can have more than one on the board, in fact you can have up to four giving you 48 touch sensors without resorting to I2C tricks.

You make your own conductive pads to this board, and for a curved one you can use self adhesive copper foil. I have also made sensors from sheet brass or carbon fibre rods.

I have also used trill sensors that come in a variety of shapes including flexible ones and make your own pad types these are also very good and return actual coordinates of where you touch the sensor, not just on and off.

This is what I made using the trill sensors
https://blog.bela.io/creating-a-guitar-with-trill-and-raspberrypi/
But it could be done with an Arduino as well

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.