Transfering 6 switched states across 2 (or 3) connections...

Discussion in 'General Electronics Chat' started by Jonathan David Bond, Nov 10, 2015.

  1. Jonathan David Bond

    Thread Starter New Member

    Nov 10, 2015
    25
    0
    I'm afraid I don't have any circuit diagrams, sorry about that.

    I have a board game that I am trying to "electrify", and there is one part I am having difficulty working out.

    I need to transfer the state of several switched to a "mobile" display panel. This panel is the players piece, and to make it easy for the player to move and as robust as possible I am planning to use a mono or stereo jack plug to complete the circuit.

    The problem is the number of switched states I need to transfer.

    There are 6 switches which are either on or off. On the playing piece there are 6 lights/LED's corresponding to the 6 switches. The idea is that various patterns are displayed on the playing piece depending on the the position of the switches.

    So how do I condense the 6 switch states down 2 or 3 wires and then split them back out again?

    I am presuming it is going to be some form IC, but this is an area I have no experience in.
     
  2. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    First, there is "encoding". Six switches have 2^6= 64 possible states. Direct encoding implies 7 wires; six for the signals, and the seventh for the common.

    Then there is transmitting the states to remote location. I can think of some ways...

    Parallel-in, serial-out shift register. Wires: Load, Shift, Data, common.

    Arduino: Parallel read the switches, send the state of the switches as an ascii character using the built-in RS232 hardware. Wires: data, common.

    Digital-to-analog: use a DAC to convert six bits to 64 different voltage levels. Wires: analog, common.
     
    Last edited: Nov 10, 2015
    Jonathan David Bond likes this.
  3. Jonathan David Bond

    Thread Starter New Member

    Nov 10, 2015
    25
    0
    Hmmm.

    If I'm trading that correctly, the Arduino and DAC solutions seen the best as they only need 2 wires.

    I could use the shift register, but I don't like soldering 4 pole mini jacks.

    Of the Arduino and the DAC, of the DAC is a single chip solution I think that would be my preferred method due to costs (4 pieces would equal 8 Arduino's).

    Can you recommend an IC?
     
  4. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    Arduino is just about a single, cheap chip solution
     
  5. Jonathan David Bond

    Thread Starter New Member

    Nov 10, 2015
    25
    0
    Interesting - cheaper than I thought!

    I have very little experience with those, I was given a kit a while back (EDTracker) which I successfully built, but that needed programming.

    Does this need programming? Or is it plug and play?

    And would the DAC be just plug and play?
     
  6. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    Arduinos require programming. The little minis are available two ways: one has a usb interface on the board; the other uses a usb dongle.

    The DAC is a chip; you would have to build it up, including a power supply.
     
    Jonathan David Bond likes this.
  7. MrSoftware

    Active Member

    Oct 29, 2013
    504
    124
    If you're going as high level as an arduino, don't bother with voltage levels and dac/adc, just send serial data. Either on schedule, or when you detect a switch change, send a sync word followed by one data byte, each bit can represent the state of one LED. 1 is on, 0 is off. You can get fancy with encoding and checksums if you want to ensure data integrity. Actually I would be surprised if the arduino serial library wouldn't do this for you automatically. Heck, with the arduino you could also use SPI or i2c to send the data, lots of options, all will work.
     
    Jonathan David Bond likes this.
  8. Jonathan David Bond

    Thread Starter New Member

    Nov 10, 2015
    25
    0
    Thank you for your advice.

    The Arduino is looking more promising, although I will have to work out how to program it. The last one I built had specialist software so it was plug it into the PC and run a programming and done.

    If I wanted to experiment with the DAC/ADC are there any pre packaged IC's that would meet my needs.
     
  9. MrSoftware

    Active Member

    Oct 29, 2013
    504
    124
    In my limited experience, I recommend against trying to use voltage levels for this. i think binary data is the way to go. My guess is there is a hardware only solution for sending the data over as serial, or something similar, without coding. Maybe one of the more hardware experienced guys can chime in with suggestions.
     
    Jonathan David Bond likes this.
  10. crutschow

    Expert

    Mar 14, 2008
    13,053
    3,244
    The Arduino with a serial digital interface would seem to be the best solution.
    Time to enter the world of programming.
    For your application, the program should be minimal, especially if you use the standard SPI or I2C interfaces.
     
  11. ian field

    Distinguished Member

    Oct 27, 2012
    4,415
    784
    An old trick was to use AC along 2 wires with a changeover switch and 2 diodes on the other end - with a centre off switch that can give you 3 possible states; off, + half cycles and - half cycles. A make before break switch with a centre position would replace the off condition with both half cycles.
     
  12. Jonathan David Bond

    Thread Starter New Member

    Nov 10, 2015
    25
    0
    If I am understanding you correctly, I think you have mis-understood me.

    I need to transfer the state of 6 switches to their corresponding lamps, but only have 2-3 wires to do this with, not the 7 I would have with a direct connection.

    If I am mis-understanding you, could you elaborate a bit?

    Many thanks.
     
  13. ian field

    Distinguished Member

    Oct 27, 2012
    4,415
    784
    With AC on 2 wires - you can decode to 2 lamps with 2 more diodes.
     
  14. Jonathan David Bond

    Thread Starter New Member

    Nov 10, 2015
    25
    0
    But I have 6 lamps
     
  15. Jonathan David Bond

    Thread Starter New Member

    Nov 10, 2015
    25
    0
    I've done some further random research...

    The "Arduino" way looks good, but it is still a little large for my liking... But I have found PIC's!

    I'll still need to learn to program, but the smaller footprint looks like it will be perfect.
     
  16. MrSoftware

    Active Member

    Oct 29, 2013
    504
    124
    The Atmel chips used in the arduino can be placed onto a PCB smaller than the Arduino. The actual chip that does the work is tiny. There are other small chips too, the ATTiny, etc.. It depends on how dirty you want to get your hands. ;)
     
    Jonathan David Bond likes this.
  17. paulktreg

    Distinguished Member

    Jun 2, 2008
    612
    120
    Why make things so complicated when some 8 core cable and 8 pin DIN plug and sockets are so inexpensive?

    If you wish to learn a little more then fair enough.
     
  18. Jonathan David Bond

    Thread Starter New Member

    Nov 10, 2015
    25
    0
    Because I want the piece to be able to rotate in the socket and just be blindly chucked in.

    I did consider the simpler approach, but it requires too much faffing with orientating the plug and socket.
     
  19. paulktreg

    Distinguished Member

    Jun 2, 2008
    612
    120
    Faffing?

    How about a Molex 8 way flat cable as used on PC power supplies?
     
  20. Jonathan David Bond

    Thread Starter New Member

    Nov 10, 2015
    25
    0
    It's for a board game where the piece will be picked up by different people in different directions and moved to another space. For ease the piece just needs to "drop in". The only way I can see to do that is with a stereo jack.

    All other connectors are either "keyed" or rotating them would change the outputs.

    The only other way I see it could be done is with concentric circles in the board and sprung contacts in the base of the piece - but getting a good contact there would be tricky.
     
Loading...