Wiring 64 reed switches to an arduino

Discussion in 'Digital Circuit Design' started by Brandon Liu, Jul 19, 2017.

  1. Brandon Liu

    Thread Starter New Member

    Jul 19, 2017
    1
    0
    I am creating an arduino checkerboard(board game) that is hooked up to an 8x8 led matrix that has a live feed of the checkers location. I decided on placing reed switches under every single square of a checkerboard (64) and attaching magnets to the base of checker pieces.

    Theoretically, this could work... But, how in the world do I wire 64 reed switches and an 8x8 led matrix all to one arduino?

    What inputs and outputs do I even use?
     
  2. Sensacell

    Moderator

    Jun 19, 2012
    1,934
    593
    Please post a schematic of what you have so far, the solution can be 'worked into' your current design.
     
  3. dendad

    Well-Known Member

    Feb 20, 2016
    1,962
    512
    Last edited: Jul 19, 2017
  4. RichardO

    Late Member

    May 4, 2013
    2,274
    889
    If you put the switches in a matrix to save input/output pins then you will have to add diodes -- one for each switch. This is because more than two switches can be on at a time and this causes "sneak" paths without the diodes.

    Here is a good explanation:
    http://blog.komar.be/how-to-make-a-keyboard-the-matrix/
     
  5. AnalogKid

    AAC Fanatic!

    Aug 1, 2013
    7,034
    1,991
    How will the board determine red, black, and king?

    ak
     
  6. ebeowulf17

    Well-Known Member

    Aug 12, 2014
    2,333
    409
    That was my first thought too!
     
  7. AnalogKid

    AAC Fanatic!

    Aug 1, 2013
    7,034
    1,991
    If you control the polarity of the magnets, such that (for example) north is up for all red pieces and down for all black pieces, and replace the reed switches with Hall Effect sensors, then you can electronically detect red, black, red king, and black king.

    ak
     
    ebeowulf17 likes this.
  8. dendad

    Well-Known Member

    Feb 20, 2016
    1,962
    512
    That is a good idea to use Hall sensors to determine the red/black info, as long as the hall sensors are analog. Then you will also need an analog MUX to select the inputs, but that is pretty easy.
     
  9. BobTPH

    Senior Member

    Jun 5, 2013
    1,188
    239
    You know the initial configuation, and each move, which is enough to determine the new state.

    Bob
     
    GopherT and dl324 like this.
  10. dl324

    AAC Fanatic!

    Mar 30, 2015
    7,090
    1,629
    And you could use color/bi-color LEDs and brightness to differentiate between black/red and kings.
     
Loading...