Hi guys, let me start by saying that I'm posting on this section of the forum because it's related to multiplexing.
I'm new to electronics and I'm currently in the process of experimenting with textile materials.
I've created a 2x2 pressure sensor matrix made out of cloth and aluminium tape. It has three layers, the top one has two aluminium stripes taped horizontaly (rows), the middle one is composed of a resistive material (Velostat) and the bottom one has two aluminium stripes taped vertically (columns).
Image attached with a basic idea (Layers.png).
I now want to read the values of each sensor.
The basic idea is to power one of the rows, read the value of each column sequentially, and repeat the process for the second row.
To power the rows sequentially I'm using a 74HC4067 Analog Multiplexer/Demultiplexer (info on pins here: Tutorial – 74HC4067 16-Channel Analog Multiplexer Demultiplexer | tronixstuff.com).
Both rows have a pull down resistor so that they don't interfere with the readings when they're not being powered.
To read the columns I'm also using a similar Multiplexer/Demultiplexer. Each column is read in turn, and the value is sento to A0 analog pin.
I've attached a diagram with all the wiring (Diagram.png and Diagram.fzz).
The green lines are the address lines for the MUXs, the two parallel yellow lines are used to read the columns values from the sensor, the single yellow line is used to send the value to the analog pin A0, and the two blue ones are used to power the rows.
Now the thing is, if I only press one or two sensors everything works fine, but if I press three sensors the fourth one will also register a value.
I've attached an image with an possible scenario (Multiple presses.png). If I press the three sensors marked as solid red, the top right one will start to ghost.
This actually makes sense, since that if we power the first row and the last column the electrons can flow through the path shown on image Electron flow.png.
Does anyone know how I can prevent this from happening?
I've seen lots of info on the net but I haven't found one solution that works.
Sorry for my Paint skills.
Oh, and before you say that I don't need the multiplexers for this, later I want to scale this to a bigger matrix. I just wanted to start small and iron any issues that might appear before scaling it.
EDIT: Source code added as attachment
Source code.txt (1.61 KB)