Requesting help with a board game digitisation project

Hello everyone,

Firstly I would like to outline my project for you:

The aim is to make a board game (the game of go/baduk/weiqi) recordable via a computer.
For everyone interested this is the game: Go (game) - Wikipedia
Usually the game is played on a wooden board with 19 by 19 intersecting lines. The black and white playing stones are placed on the intersection of the lines. Each turn exactly one stone is placed. Stones can under certain circumstances be removed from the board (captured).

My idea is to use sensors to detect whether a stone has been placed on an intersection. Due to the size of the board, using a sensor for each intersection results in 361 sensors. Having the cost of the whole thing in mind I was thinking about using LDRs for the purpose of detection.
The next thought that came to my mind was that 361 sensors is a lot of input to handle even for an arduino mega with 54 digital I/O pins and 16 analog pins.
Continuing this trail of thought, my next take was to use multiplexers for this. For example the CD74HC4067 http://www.ti.com/lit/ds/symlink/cd74hc4067.pdf.
Hooking up every single ADC pin of the arduino to one of these however only gives 16*16 = 256 inputs. The thought here was to cascade the multiplexers, so that after adding a second layer of 7 multiplexers there are exactly 361 available inputs.
As the selection pins of every layer can be connected and the channel to choose can be controlled using the EN pins of each multiplexer the digital I/O pins of the mega should be sufficient.

However I am pretty inexperienced in designing and building circuits in general and here come my questions:
1.) Could such a design in principle work?
2.) I am very unsure about things like the voltage supply and whether the cascading multiplexers maybe add too much resistance as to effectively read the LDRs. I have a hunch that there is a lot here, which I cannot grasp.
3.) Is the general approach here a useful one? If not could you imagine a better design?

I would be very grateful for any inputs and am more than willing to answer remaining questions.

Greetings
Hendrik

The key word is "matrix". Search for that.

Thank you Morgan for taking the time to provide me with a search term. However I am afraid, that I do not quite understand what hint you are trying to give me.
I am indeed aware that the sensors would be arranged in a matrix like structure. Maybe the hint just went over my head, but after doing some searches including the term "matrix" no obvious solution came to my mind.
It would be awesome if you could elaborate a little more.

Thanks again and sorry if I am missing something obvious.

Greetings

Start small. Maybe 3x3. Do you need 9 sensors (switches or light sensors or whatever?) Yes you need 9 sensors.

Do you need 9 inputs on your Arduino for those 9 sensors? No. You only need 3. Wire them in rows and columns. Energize a row from an output pin and read the columns on 3 input pins. Each sensor makes a join between one row wire and one column wire.

Ah I think I get what you are saying. So that would mean, that for example for a 9 * 9 sensor matrix I would only need 9 analog input pins and 9 digital output pins to read all the values? So that for each row to be read all outputs except the one for this row is 0?
Did I understand that correctly?
If this works I guess that solves my problem instantly.

Thanks a lot!

Yes.

Reading LDRs in a matrix is a little tricky. I would use a more modern sensor like QRE1113

With LDRs you don’t even need analog inputs, if you choose your pull-up resistor smartly you can actually use digital inputs. In any case your sensors will ONLY work when there’s enough light falling on the board, a basic dining table light may not be enough.

The complete matrix needs 19 + 19 = 38 pins. That’s a LOT of wiring. The only way of doing it and keep yourself sane is by building a PCB where you can just solder the LDRs on. And diodes: you will need a diode at every single LDR.

Look for “button matrix”. This is the same, with the buttons replaced by LDRs.

The QRE1113 sound like a good alternative, indeed. It does not depend on ambient light but may get fooled by sunlight (lots of IR in there). With the correct pull-up it should also work fine with a digital input.

Thanks a lot! I have looked into the QRE1113, however I'm afraid that it might be a little expensive for what I have in mind. The cheapest offer I could find was at 0,44 € per piece, which would mean approximately 160€ for the sensors alone in the final 19 x 19 matrix.
@Morgan: What do you mean by "Reading LDRs in a matrix is a little tricky" ?
@wvmarle: Is it really necessary to have very bright lighting? I could probably install the sensors in a way, that if a stone is placed atop the sensor would turn completely dark. I imagine that the problematic of ambient light could be reduced by software calibration as well?
The button matrix indeed looks promising. I will look into that further.

Greetings

Light doesn’t have to be very bright, just bright enough. With the limitation of the board that can be tricky: only light from above is falling onto the sensor.

You’ll have to do some experimenting. As I mentioned reading them as digital outputs in a matrix is easiest, the trick is to have your pull-up resistor the proper value so it’ll pull high when dark (that’s the easy part as the LDR resistance goes >1M), but also pull low when light (so <0.3Vcc, or >2 LDR resistance).

Come to think of it, maybe it’s easier to use a pull-down. High readings are at 0.6* Vcc, so you need your pull-down resistor to be >1.5 * LDR resistance.

The 0.3 and 0.6 are from the top of my head, do double check with the data sheet to make sure.

With little light the LDR may still have 100-200k resistance, falling as light levels increase. So you’d probably need a pull-down of 100k-500k to make it reliably trigger a digital input. Some trial and error is in order here - for starters you’ll have to measure the resistance of an LDR built into your board at the poorest light levels you want it to work.

Another possible problem is if you have just one light source and someone casts a shadow over the board, suddenly making the board think there are stones on those squares while there really aren’t any.

It is tricky because you can’t calibrate in software. You can’t adjust for different light levels.

Then there is the shadow issue.

How big is a Go board normally? Probably expensive to make it a single PCB. But once you spend that cash, you will have zero issues with wiring and soldering.

The Go board I have here is about 50x50 cm. Pretty big.

Alright thank you two again! I have a lot of testing to be done I guess. The shadow issue is indeed bugging me. I do not really see a good way around it.

I think before I make a PCB, I'd rather build a smaller prototype to verify that this is working at all. Maybe I even have to consider switching the sensor and accept the higher cost.