Maker Pro
Maker Pro

I need to test switches connected in a matrix, sounds simple, but having trouble

TCUENGR

Apr 11, 2012
3
Joined
Apr 11, 2012
Messages
3
Hi all, my first post on the forums.

I have a 6x6 array of switches connected in a matrix, and I need to confirm that each one connects the correct row to the correct column (e.g. SW0=R0+C0, SW1=R1+C0, etc).

I also need to do it quickly, so for example press each button and see an LED light up confirming the connection.

The outputs I have on the connector are C0, C1... C5, and R1, R2, ... R5

This would be simple I thought - connect an LED/resistor + power supply to each set of connections and voila, but the problem is that if using the same power source, they all end up connected to the same ground and/or +V supply, which defeats the point of the test.

I'm sure there is an easy way to do this but I can't think of it :(

I've thought about using resistors between the columns and rows and then the user will know if the wiring is correct based on the resistance value of each switch, but I prefer to use LED's somehow if possible?
 

timothy48342

Nov 28, 2011
218
Joined
Nov 28, 2011
Messages
218
How about using 12 LED and 6 resistors like this:

Power supply connected to one end of each resistor.(They can be the same value)
Each of the 6 resistors connected, then to 1 LED. (6 total LEDs)
Each of the 6 LEDs to each of the 6 collumn leads.
Each row lead to each of 6 more LEDs.
All these 2nd group of 6 LED's to ground.

When one switch is on, the current will flow through 1 resistor, 1 LED, the switch, a 2nd LED, then ground.

The user can see which switch in on by looking at the 2 LED lit. 1 indicating row and 1 for collumn.

The value for each resistor would be the supply voltage minus 2 diode drops divided by desired curent.

-tim
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,754
Joined
Nov 17, 2011
Messages
13,754
Put an LED (with series resistor) from the output of each row to GND.
Connect each row to VCC using another switch (so the test fixture will 6 more switches).
Turn all switches off. Switch on test switch 1 (connected to C0). Test all 6 switches in the matrix that should be connected to column 0 (C0). For each switch tested exactly one LED, the one for the respective row, should light up.
Next turn of test switch 1 and turn on test switch 2 (connected to C1). Repeat the test as for column 0.
Repeat for all columns.

If you have to test more than say 2 or 3 switch matrices, It would be easier to have a microcontroller control columns 0...5 in sequence and also look for correct responses on rows 1...6. Pressing the buttons in the matrix still would be your job, unless you go into the effort of building an automated button pressing apparatus.

Harald
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,754
Joined
Nov 17, 2011
Messages
13,754
@timothy: Excellent plus you beat me by 1 minute :D

Harald
 

TCUENGR

Apr 11, 2012
3
Joined
Apr 11, 2012
Messages
3
Thanks for all the ideas guys! really great, and QUICK :D

I have actually ended up with a different solution in the meantime that I think will work better for us:

I took apart an old usb keyboard, and I'm plugging each row and column that we are testing to a row and column on the keyboard. Then when a switch is pressed (say S0) the corresponding letter (possibly Q) would be typed. Then I have a small script that will convert the input letters into actual switch names, so I type Q, and get SWITCH 0 --> or in our case that is the on/off button, so it will output that instead :D

The reason I did not use your solution is because even though our switches are connected as an array, they are not arranged in an array. They are scattered all over a device (they are actually selection buttons around an LCD).

Thanks again for all the help!!! really great guys :)
 
Top