Let's Make Robots!

Multiplexing for my chess robot

Base over Apex showed to me that the "ghost piece" i was talking about could be fixed this way below. 

 Oh yeah i am doing this because my shift registers... well something happened...no im doing this.

This is a common problem. The answer is a diode on every switch. You still need to scan the rows and columns individually.

Here's how to kill the ghost:

diode_open.gif

Make your board with only 16 wires instead of 65.

 

Ok my question is how does a diode on every switch change the "ghost piece" problem?

and on the multiplexing where does the gnd go?

i am using arduino so it has a built in pull down resistor but idk how this darn multiplexing works. 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Yep, the idea is that if you're going to read row number 'N' then you set RowN+ high and RowN- low, and all other Row+ low and all other Row- high.
If you want to read Row6 for example then you set Row6+ high and Row6- low, and the rest are reversed.

As RowN+ and RowN- are always the opposite of each other, the octal inverter IC I mentioned previously allows you to just use 8 input lines, since you can have the inverter control all the RowN+ lines by using the inputs from the RowN- lines. If you use a 3-8 decoder IC then you only need 3 inputs, and only 1 of the decoder's outputs will ever be low at a time.

Edit: There was a minor error in the first diagram, but I can't edit the post now so I'm posting the updated one here:

Chess_Sensor_Array.jpg

ok i wired this circuit up and here are some things im finding. One that you do not want to make the other circuits all HIGH because then you read those too. But its best to not do anything with the ones your not reading. A single resistor is giving a different value on different squares. What does that mean? finally one resistor on a single row makes all the analog inputs equal to that one value. Thats deffinetly not good. What does this mean when it comes to the circuit? im sure the first thing you will ask me is if i have the analog inputs perpendicular to the rows im driving HIGH and i do. The columns are driven hight to read and the rows are the analog inputs. 
you know what nvm. It isnt quite as a problem as  i thought. It is a small i guess noise problem like a value of 189 would make the square next to it read about 100 but we will see if any resistors have that value of the noise and if not then it wont be too big of a problem. And about the resistor value being different on different squares is wrong too. 
Are you driving the Row+ high and the Row- low? If you have both of those going it should almosst completely wipe out any interference from other squares on the same row.

yes just for the row im reading

 

here are the resistor values i was able to find close to those. Are the close enough?

 

RES 910 OHM 1/4W 5% CARBON FILM00.08000$0.08
31CF1/41.5KJRCT-NDRES 1.5K OHM 1/4W 5% CARBON FILM00.08000$0.08
41CF1/42.2KJRCT-NDRES 2.2K OHM 1/4W 5% CARBON FILM00.08000$0.08
51CF1/43KJRCT-NDRES 3K OHM 1/4W 5% CARBON FILM00.08000$0.08
61CF1/43.9KJRCT-NDRES 3.9K OHM 1/4W 5% CARBON FILM00.08000$0.08
71CF1/45.1KJRCT-NDRES 5.1K OHM 1/4W 5% CARBON FILM00.08000$0.08
81CF1/46.8KJRCT-NDRES 6.8K OHM 1/4W 5% CARBON FILM00.08000$0.08
91CF1/49.1KJRCT-NDRES 9.1K OHM 1/4W 5% CARBON FILM00.08000$0.08
101CF1/413KJRCT-NDRES 13K OHM 1/4W 5% CARBON FILM00.08000$0.08
111CF1/418KJRCT-NDRES 18K OHM 1/4W 5% CARBON FILM00.08000$0.08
121CF1/430KJRCT-NDRES 30K OHM 1/4W 5% CARBON FILM00.08000$0.08
131CF1/468KJRCT-NDRES 68K OHM 1/4W 5% CARBON FILM

Hey PM, here's the formula I mentioned earlier:
C = D + (5V - D)×(Rl÷(Rh+Rl))
Where C is the column voltage you read from the analog input, D is the diode voltage (requires testing, probably less than 0.7V), Rl is the low-side resistance (a few kΩ will do), and Rh is the high-side resistance (i.e. the resistance that the particular chess piece has).
I'll write up a table of optimum values tomorrow if you remind me, sadly I'm out of time for today.

Edit: got home a little earlier than expected, so I'll continue.

You can rearrange the above formula to get:
Rh = Rl×((5V - D)÷(C - D) - 1)
If we assume D is 0.7V and Rl is 5kΩ, we get:
Rh = 5,000×(4.3÷(C - 0.7) - 1)
For maximum distance between piece identifier voltages, we'll take a minimum voltage of 1V and a maximum of 4.3V, with 0.3V spacing between each piece. Altogether this gives us the following table:

ID Voltage:       Chess Piece Resistor:
     5.0V                            0Ω (i.e. this square has a short circuit!)
     4.3V                        972Ω
     4.0V                     1,515Ω
     3.7V                     2,167Ω
     3.4V                     2,963Ω
     3.1V                     3,958Ω
     2.8V                     5,238Ω
     2.5V                     6,944Ω
     2.2V                     9,333Ω
     1.9V                   12,917Ω
     1.6V                   18,889Ω
     1.3V                   30,833Ω
     1.0V                   66,667Ω
     0.7V                          ∞Ω (i.e. this square has nothing on it)

You don't have to be perfect with the resistor values - these are just the 'perfect' ones. As long as they're fairly close to the target value it'll be easy enough for the ADC to tell them apart.

Thanks alot, will buy these ASAP. What diode would be good for this and what value?
Just buy the most generic, boring diodes you can find, IN4148 or something along those lines. They only have to withstand 5V max reverse voltage and less than 1mA forward current.

There are no grounds involved in multiplexing. The idea is to use your outputs as either a high signal, or as a ground which can be done in the program itself. I forgot exactly what its called, but basically you can set an output to low which the circuit will use as a ground. Theres no specific ground wire persay.The pullup resistor is used to tie a pin to high? because when you're reading your inputs you wouldnt be able to detect the lows? i think its something like that. try google :P also google charlieplexing

 

edit: this might in fact be charlieplexing but the two are asimilar.