8 conductive surfaces/objects - Measure which surfaces are connected

Hi,

Let's just imagine 8 pieces of aluminium foil.

I want to know, which of these pieces are linked by people touching the foil.
If I touch piece one and two and four, I want to be able to read "1 & 2 & 4 connected" with my Arduino.
At the same time I want to be able to read, that another person touches piece 3, 5 and 7 - "3 & 5 & 7 connected".

Just thinking about "multi buttons on one pin" layouts. But this probably won't get the job done. Any idea on how to wire stuff and which components I would need?

I hope someone gets my description :slight_smile:

I can imagine how an Arduino could detect that something is touched. But I can't imagine how it might distinguish between which person was touching it.

Even in the simpler scenario where three contacts are connected with one piece of wire and three other contacts are connected by a separate piece of wire I can't immediately see how the Arduino could tell which piece of wire contact 4 is connected to. Maybe you could set up a system where the wire completes a circuit for a voltage divider and test the voltage with the ADC.

But the resistance of the human body is so much higher that I can't see how it could complete that sort of circuit.

Others may see things differently.

...R

Hmm,

I once played on an art installation, where you had to connect different "buttons" with your body. The "buttons" where illuminated and you had to touch all the buttons of the same color at once. If you pushed a wrong button you lost the game. It was even possible/necessary to build a chain with several people. And there where multiple colors. So all colors that where illuminated green had to be connected and afterwards all buttons illuminated red had to be connected.

Variant a) would be to determine which buttons are pressed.
Variant b) would be to maybe change which buttons are connected using relais or something like that.

Seems like you know a lot more than I do - which is not much of an achievement :slight_smile:

...R

I could imagine that one of the selected objects injects a square wave signal, which then can be detected at every connected object. You have to figure out how to check the presence of the signal at every single (touched) object. Also find out the first object, that has to inject the signal.

The built-in input pullup resistors may be too low for reliable detection, eventually higher external resistors have to be used.

Why do things that look simple tend to be way more complicated in the end :slight_smile:

Could I just change the pinMode in the loop?

I just need to verify, if the "solution" of connected buttons is correct.
If each colored group has a main "sending" button I could read all other button pins and check if the correct pins are connected.
Afterwards I could check button group 2.
If all groups are correct, the level is passed.

Is it a problem to switch between send and read mode in the program loop?

If those squares are connected by a good conductor (wire) it is easy to detect which ones are connected to one another: connect each piece to an input pin; one to OUTPUT, LOW, the rest INPUT_PULLUP, and see which of the inputs read HIGH (not connected to that output) and which read LOW.

Using capacitive sensing it should be quite easy to detect which ones are touched and which ones not. If you can be sure that this is only one person at the same time touching one or more squares, that could qualify as "connected".

In case of physical buttons it becomes a standard button array or button matrix.

If connected through the poor conductor that a human body is, it's going to be a lot harder to detect which ones are connected by the same person or through two people holding hands or so. Skin resistance is quite high, so just about any pull-up resistor will be too strong for this, even 1 MΩ will leave too high a voltage for a reliable LOW detection. Maybe you could use a small "pull-up" capacitor on the pins? Connect the chain of hands through the other side to GND and this capacitor should discharge within a few ms. If the square is not connected at all, the capacitor does not discharge and the pin remains HIGH. 100-200 pF should be enough to keep a pin reliably HIGH if disconnected for a good while; while discharging within a few ms through skin resistance. Note: never tried, just an idea.

Pinmode can be changed at any time. The output pin is iterated until another pin receives the signal, then it can stay the same.

Using entire ports (8 pins as one byte, Mega) makes it easy to determine the connected pins, which have the same state as the sending pin all the time.