Chessboard pcb

Dear Community,

I am using KiCad to create a pcb for a chessboard motherboard. I found sources for wiring, but only in image formats, so trying to recreate them.

Is this the best place to ask oppinions about a schematic? I added a screenshot, about what I’ve done so far (the input part is ready, the screw terminals will be wired to an arduino shield). If allowed, I upload the project to github and link it. I think, I understand, how it works (74HC165N reads 8 inputs, while the 74HC595 selects which lines to read).

It would be great if someone with more knowledge could give hints or improvement ideas.
Thanks,
vm

This place is good to ask how to convert schematic into PCB using KiCad. But to ask about ‘how it works’ you should ask at electronic forums like eevblog.

1 Like

They are 8-bit shift registers (that can be chained for lots of bits) – 595 is output and 165 is input. You set/clear a data bit on the 595 and clock it in, then do that 7 more times for the full byte, then pulse the line that transfers the shift reg to the output buffer. Similarly, the 165 lets you read 8 bits one at a time. Spend some time reading the data sheets. Much like an SPI port.

To use a keyboard matrix you need to put just one active bit into the 595, then read all 8 bits of the 165 to see if a button has been pressed. If so act on it (possibly wait for it to be released first). Then move the active bit down the chain in the 595 and read the 165 again. To do a full scan you are shifting the test bit into the 595 eight times and reading the 165 each time.

I would put pullup/pulldowns (eg: 10k to 100k) on all inputs to the 595/165 (look at datasheet and learn how the parts work). I also like to put a series resistor (eg: 100 ohms) on input lines to soften transients and tvs clamps if there is a cable of any substantial length.

Here is a chess board I just made; no electronics in this one though :slight_smile:

1 Like

Been years since I have used these parts, but they are handy i/o expanders. Your schematic needs some serious fixes, like a common ground, a single connector probably, many resistors, but you can chain the two parts and drive with some simple bit-bang code loops. See the notes on schematic below:

Hello @vilmarci,

This is a simple keyboard matrix, the '595 is driven from the host/MCU cycling one column at a time. The '165 then reads in if any row is high for the driven line indicating a key press. The diode is there to prevent key ghosting.

This will start you on your way: Keyboard Matrix - James Lewis

As mentioned, there is probably better forums to ask this question but this should get you on your way.

Ta,

./TBE

Recently (some months ago) there was a post on the EEVBlog about a chessboard. In that thread an old patent turned up (Probably long expired) in which each chess piece had an inductor inside which was (I think) capacitively coupled to the board itself. The board had two analog MUX’es which put one of the pieces into an oscillator circuit, and the oscillation frequency was mapped to the particular chess piece.

For each color (black / white) there were only 6 or so different frequencies. All the pawns had the same frequency, both towers the same frequency, etc.

Besides the fun of the project, it is terribly off topic here. Some say the KiCad forum should be limited about techinical questions about the software itself :slight_smile:

Thank you, the expression “keyboard matrix” indeed leads to enough documentation.

How do you want to implement the switches?
Mechanical switches (with a small stub sicking out of the middle of each square) could be done. This could also be used to center the chessboard pieces, which is sometimes done for “travel” variants of chessboards. Reed switches in the board, combined with magnets in the chess pieces is another option.

And for the keyboard matrix…
Usually these are wired directly to microcontroller pins. There are plenty of keyboard projects on the 'net. Have a look at GH60 for example (An Open Sourced PC Keyboard)

I’d go for the reed switches.
Yes, I did a lot of research, and found ideas for full direct wiring (16 Arduino pins), direct wiring for rows and output shift register for columns (11 pins), combination of input and output shift register, and a variant of the 3rd, using a 74HC4051 (de)multiplexer (6 pins, if I counted correctly).

I’d do it capacitively.

1 Like

Extra image for our beloved Raptor. Capacitive is probably a good option. The bottom of the chess pieces can have a piece of aluminium foil (or from a can, which is typically 0.2mm thick and easily be cut with household scissors or a sharp knife) and the whole matrix can be designed into the PCB.

The biggest problem I see is whether a capacitive matrix still works with 32 simultaneous button presses.

or a different-sized slug of steel in the pieces, which changes an inductor below the surface – changing the freq of an oscillator on each square. The pieces are much nicer when they are weighted anyway. I epoxied five pennies into my king, less weight in the others… A proper design could identify not just location, but which piece (k/q/b/r…)

RFID :dizzy_face:

1 Like

Any idea is welcome as long as it is easier to implement than the reed switch matrix :slight_smile:
The only thing that matters is that I need to end up with a 8x8 array of 1/0 with the pieces.
If you can link a plan, schematic that is complete or easy to scale up, I’d like to take a look.

the receiving part of a NFC eeprom can be very small, the reader on the other hand is a bit more complex but in my opinion could be done.
Very cool project :slight_smile:

Not much is going to be easier than a magnet and reed switch.

1 Like

I use PCB coil at open U-core with piece of flexible ferrite sheet as tamper. Detection not by oscillator and frequency measurements but by L/R time constant change detection. Using LVC gates I can set one slope to be 2ns before the second and changing time constant by 4ns gets me slopes 2ns in opposite order what is detected by LVC D Flip-Flop. You can detect state very fast - one pulse and you get state latched. It can be organised in rows and columns matrix. You have no movable parts but the maximum thickness between core and sheet is about 0.5mm.

Edit:
I’m not sure if not mixed up times from my other solution with E core where I could do it differentially based on having the same core in both core windows.
Edit 2:
I have checked in my measurements. Indeed I mixed it up. In the solution with U10 core I have set the reference slope 8.5ns later then slope from L/R without ferrite sheet touched (ferrite sheet at 0 distance shifts slope by 32ns). This allowed me to believe that I took into account all tolerances (specially ferrite material) but the needed to work distance is 0.35mm.
If you not think about serie you can be less tolerant to tolerances - if you change 8.5ns to 5.5ns the switch distance is 0.8mm.

1 Like

Well, when talking about:

Kitchen grade loadcells have sub gram resolution. You could put three of them under the chessboard, and then measure the weight distribution changes. HX711 is the “default” load cell digitizer, and you can get around 16bit of resolution out of it. I am not sure though if this can be made reliable enough. for example when there is some wind, it may disturb the loadcell measurements, temperature changes may have weird effects on the measured values, and you can’t distinguish between chess pieces moving or anything else touching the chessboard.

1 Like