Electronic Boardgame help

Thread Starter

masterspin11

Joined Dec 2, 2014
13
I am trying to make a 2-Dimensional, tile based, electronic board game. I want a microcontroller to know where the users pieces are on the board. I am very new to electronic projects and know only the programming side. So this is my project to learn and I want to make A LOT of mistakes and expect to be buying parts as I proceed.

I feel the easiest and safest solution would be to use connection pins on the bottom of board game pieces to complete a circuit in a key matrix. The board will have a hole in each tile where the connection pin will go through. The below URL shows how its done for keyboards and shows the solution for the "ghosting problem" when simultaneous keystrokes are performed. This probably can be adapted for my usage.

http://pcbheaven.com/wikipages/How_Key_Matrices_Works/

Note: The board game requires this technology and will give feedback to the user via speaker after some basic AI is done on the microcontroller.

What are your thoughts on 12x12 - 16x16 grid? Is it too expensive? Alternative solutions? Problems? Safety concerns? Not enough pins on the microcontroller solution? Any feedback is appreciated.

Thanks,
Please elaborate on any terminology or references that you may find that is helpful.
 

wayneh

Joined Sep 9, 2010
17,496
I wonder if you could use RFID tags in the pieces, and then the board can recognize which piece is where.

Another thought - you could use magnets to help make a solid connection when a piece is placed. This would also help hold the pieces steady if you wanted to play in a mobile setting.
 

KJ6EAD

Joined Apr 30, 2011
1,581
If you have magnetized piece bases, you could use hall effect sensors to sense the presence or absence of a piece but not identify it.

Another option is to mount a plug such as a 3.5mm stereo plug and some electronics in each piece so when it's plugged into one of the corresponding sockets on the board it's identity and location can be read.
 

Thread Starter

masterspin11

Joined Dec 2, 2014
13
I looked up how to locate RFID tags and the parts look fairly expensive. I also am unsure if they will be good for such fine positioning.

Wow I didn't know magnets could be used to create a connection with hall effect sensors! So would I need one for each tile position? My worry is that the tile positions will be so close that multiple hall effect sensors will pick up the magnets. Also, if someone didn't place it exactly on the correct tile, it would be on multiple tiles. I guess that would be there fault too. Though this is an interesting idea and well worth the investigation.

KJ6EAD - Yes, definitely some sort of 3.5mm stero plug to make a connection in the board.
 

wayneh

Joined Sep 9, 2010
17,496
There are several ways you could use the magnets. One would be to simply close the connection between two flat contacts on the board, with the magnet bridging the gap.

Another would be to put a reed switch or hall sensor under each board position. Placing a magnet on the board would close the switch. (The magnet would not hold the piece to the board unless you also add something to the board to attract it.) I like this arrangement since both the switch and the magnet could be concealed.

In both of these scenarios, the position of the closed switch would be known by its placement on the board.

Take a look here for sourcing magnets.
 

ErnieM

Joined Apr 24, 2011
8,377
One wild idea I had was to look for a shadow on each tile to see if a piece was there using some sort of light detector (LDR, photo transistor,...)
It could get interesting is the detector could also differentiate color differences. Then the base of each piece could be color coded.
 

Thread Starter

masterspin11

Joined Dec 2, 2014
13
Hi Masterspin11,

Why not use reed switches as contacts and magnets in the pieces?

Regards,

Nandu.
Ah wow. A magnetic reed switch seems to be a great option. I did not know that existed! :) I am worried about the cost since I would need 1 for each tile. I looked on the internet and found a large price range. I found the cheapest are usually 10 cents per reed switch.

Is 10 cents per reed switch the best price I can get? Note a 16x16 board will cost around $25 in reed switches. I'm not trying to be cheap, just economical :)

Another concern with magnets is that the adjacent reed switch will become active if the magnet is too strong.... I guess I can always go to a local radio shack, buy one and test it out.

Thanks for the information. I'm learning a great deal here.
 

Thread Starter

masterspin11

Joined Dec 2, 2014
13
There are several ways you could use the magnets. One would be to simply close the connection between two flat contacts on the board, with the magnet bridging the gap.

Another would be to put a reed switch or hall sensor under each board position. Placing a magnet on the board would close the switch. (The magnet would not hold the piece to the board unless you also add something to the board to attract it.) I like this arrangement since both the switch and the magnet could be concealed.

In both of these scenarios, the position of the closed switch would be known by its placement on the board.

Take a look here for sourcing magnets.

I skipped over your second post accidentally, sorry. I took a look around at hall sensors and did some comparison to reed switches. It seems like a reed switch is more economical for this project.

Like you said, placing it under each tile is the way to go. I quickly went to your URL and it had some interesting info! I'll have to dive deeper tonight and check which magnet is good for a board game and a reed switch.

I imagine the board game would need a magnet that is just strong enough to trip the reed switch and not the adjacent ones. I "think" there are directional magnets that can be used in this instance... I am not sure though.
 
Last edited:

Thread Starter

masterspin11

Joined Dec 2, 2014
13
One wild idea I had was to look for a shadow on each tile to see if a piece was there using some sort of light detector (LDR, photo transistor,...)
It could get interesting is the detector could also differentiate color differences. Then the base of each piece could be color coded.
Oh. If I could create that, I would just give up on the board game and sell that as a product instead :)
 

wayneh

Joined Sep 9, 2010
17,496
It seems like a reed switch is more economical for this project.
Yeah, the hall sensors seem to run about $1 each.
I imagine the board game would need a magnet that is just strong enough to trip the reed switch and not the adjacent ones. I "think" there are directional magnets that can be used in this instance... I am not sure though.
You'll want disc magnets that have their field perpendicular to the face.

I don't think stray magnetism will be that big a deal. Aren't your pieces an inch apart or so? Use a small disc - 1/4" ? - that is still big enough to hold the piece in place and trip the reed switch. I doubt an adjacent reed switch will see it at all. Note that reed switches are directional and will need to be mounted properly, and of course the magnet's field lines are directional.
 

WBahn

Joined Mar 31, 2012
29,976
One thing that hasn't been mentioned by the OP (some of the responses have) is whether it is important to know the identity of the pieces in addition to where they are positioned? The only way that I can see that this wouldn't matter would be if it were some kind of puzzle in which all of the pieces are identical. I can think of a few two-player games in which all of the pieces are identical, but not very many and none that are particularly interesting after any amount of time.
 

Thread Starter

masterspin11

Joined Dec 2, 2014
13
One thing that hasn't been mentioned by the OP (some of the responses have) is whether it is important to know the identity of the pieces in addition to where they are positioned? The only way that I can see that this wouldn't matter would be if it were some kind of puzzle in which all of the pieces are identical. I can think of a few two-player games in which all of the pieces are identical, but not very many and none that are particularly interesting after any amount of time.
Each player has one piece to control which represents themself. There can be a total of 5 players in the game. Currently, each player piece is identical in properties. Though, I believe I have a method of determining which piece belongs to what player and thus each player can have unique properties.

Here is the method.

1.) The board game will be turned on which initializes the microcontroller into the "start" state.
2.) The board game will ask how many players there are through speaker while flashing the "generic control" button.
3.) A user will push the "generic control" button how ever many times for the number of players and then hold the button down to accept. Note that each push will make the speaker say how many players are being set.
4.) The microcontroller will ask player 1 to select the type of user it wants to be (mage, warrior, etc, if this was some kind of RPG) using the same method.
5.) The microcontroller will ask the player to place the user on a tile and then press the "generic control" button to accept. Note, now that the microcontroller knows where and what is on that tile for that player.
6.) Repeat steps 4 and 5 for each player.

LIMITATION: Only piece can be on a tile. Otherwise the microcontroller can lose information of what piece is where.

Currently right now, I am taking baby steps.
 
Top