Electronic Boardgame help

Discussion in 'The Projects Forum' started by masterspin11, Dec 2, 2014.

  1. masterspin11

    Thread Starter New Member

    Dec 2, 2014
    13
    1
    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.
     
  2. wayneh

    Expert

    Sep 9, 2010
    12,093
    3,031
    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.
     
  3. KJ6EAD

    Senior Member

    Apr 30, 2011
    1,425
    363
    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.
     
  4. masterspin11

    Thread Starter New Member

    Dec 2, 2014
    13
    1
    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.
     
  5. wayneh

    Expert

    Sep 9, 2010
    12,093
    3,031
    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.
     
    masterspin11 likes this.
  6. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    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.
     
    masterspin11 likes this.
  7. masterspin11

    Thread Starter New Member

    Dec 2, 2014
    13
    1
    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.
     
  8. masterspin11

    Thread Starter New Member

    Dec 2, 2014
    13
    1

    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: Dec 3, 2014
  9. masterspin11

    Thread Starter New Member

    Dec 2, 2014
    13
    1
    Oh. If I could create that, I would just give up on the board game and sell that as a product instead :)
     
    ErnieM likes this.
  10. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    :)

    You don't build them, you buy them. TAOS is one company I've worked with in the past. Just a bit pricey, 2 bucks for each sensor IC, and it's a finicky SMD pasrt too.
     
    masterspin11 likes this.
  11. wayneh

    Expert

    Sep 9, 2010
    12,093
    3,031
    Yeah, the hall sensors seem to run about $1 each.
    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.
     
    masterspin11 likes this.
  12. WBahn

    Moderator

    Mar 31, 2012
    17,716
    4,788
    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.
     
    masterspin11 likes this.
  13. masterspin11

    Thread Starter New Member

    Dec 2, 2014
    13
    1
    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.
     
Loading...