mainly sensing

Discussion in 'The Projects Forum' started by tibbles, Jun 8, 2014.

  1. tibbles

    Thread Starter Active Member

    Jun 27, 2008
    249
    3
    hi
    im thinking of putting together a simple noughts and crosses game,(im sure my grandchildren multiply by the day.)

    very much chunky and hands on, but with an electronic element.
    my first thought was a thick wood board into which the noughts and crosses in the form of wood blocks of around an inch cube,would be placed. with bells and whistles stuff for the winner.
    im looking for some way of sensing whether a nought or a cross has been placed . i would love to hear any suggestions.
    is it pussible to get a two way NO.reed switch (or hall effect)or to modify one so that a positive or negative magnet in the blocks would change over reed switches in the base board.?
    regards
    tibbles
     
  2. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,796
    831
    If you made the board with 3x3 squares, into which a cutout naught or cross could be placed, note the following. If you were to imagine the bottom of each square divided into thirds, then the naught would always cover the middle and leave the corners open. A cross would always cover the corners and leave the middle open.

    So with two sensors - LDRs - one could determine the state of each position.
    • A corner covered, a cross is there
    • The middle covered, a naught is there
    • Both uncovered, an empty square.
    Both covered is an undefined case. Also, when testing for a covered sensor, you could also ensure that the other sensor was uncovered.

    Of course, you'd need a microprocessor. Have you used one before?
     
  3. tibbles

    Thread Starter Active Member

    Jun 27, 2008
    249
    3
    thanks djsfantasi
    some good thinking there,i had'nt thought about the logic yet, whether to use gates or a processor,- ive got one(pic) somewhere, i did a circuit with it a couple of years ago, but couldnt get my head round the programming.
    thank you again
    dougal
     
  4. tibbles

    Thread Starter Active Member

    Jun 27, 2008
    249
    3
    hi
    thought id try gates first,not too bad ,did i say simple..could someone kindly have a look to see if i missed anything, i usually do.(my senior status, i think, is a reflection of my age rather than my ability)
    djsfantasi mentions indeterminate states,
    now where did i put that processor...
    sorry about the drawing, ive been using a circuit design program,but it seems to have some copyright restrictions, so ive had to use trusty ms word.

    if its any use to anybody, ive sourced a dual hall effect switch with 2 outputs,which change state depending on the polarity of the magnet, but i think i'll be going with ldrs,
    regards
    doug
     
    absf likes this.
  5. paulktreg

    Distinguished Member

    Jun 2, 2008
    611
    120
    I thought two reed relays/magnets in different positions at each station to sense a nought or a cross. You could then use 2 three input AND gates at each station to "look" for a winner, eight AND gates altogether.
     
  6. tibbles

    Thread Starter Active Member

    Jun 27, 2008
    249
    3
    thanks paulktreg, sorry for the delay in responding, wouldnt it need more than 8 and gates?

    just been looking at bipolar hall effect switches, these have a high or low output depending on the orientation of the magnet, north, output high-south, output low,
    and they are more readily available than the dual output types,these, the bipolar, would have been ideal,only one needed at each square and no modificaton of the blocks.were it not for the fact that, as far as i can see, they are indeterminate when no magnetic field is present.

    please keep the ideas coming in.
    thank you
    doug
     
  7. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    Your problem is that you have three states for each square on the board; empty, 0 and X.

    So simply put, you either need a sensor capable of three states, OR two sensors per square.

    For a three-state sensor you could use a linear hall sensor, that outputs a linear voltage depending on the strength of the magnetic field and its polarity. That will detect all three states but requires analogue voltage decoding.

    This project gets very easy if you use a microcontroller. :) But will be hard and complex without one.
     
    absf and djsfantasi like this.
  8. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,796
    831
    Thanks RB. My proposed solution used two sensors, which could represent four states.

    Tibbles, it is this fourth state that I meant was indeterminate. The first state, both sensors at not activated - is an empty square. The next two states have only one sensor activated. One for a naught and the other for a cross. The fourth state would be when both sensors are activated. However, in normal operation both sensors would not be activated.

    A sensor could be an embedded LDR. I recommend this approach, as alignment of magnets and a Hall effect sensor is avoided. Alignment of the playing piece and the LDR is automatic because if the difference in shapes between a naught and a cross.

    Also my comment about using a microprocessor was made in the same vein as RB's. Without a microprocessor, one would have to wire up 16 - 3 input AND gates and 8 input OR gates plus another OR gate. Or something like that (I didn't draw up the circuit). The microprocessor would require AT MOST 18 input pins and AT LEAST one output pin. (I didn't draw this one either nor sketch out code)
     
  9. tibbles

    Thread Starter Active Member

    Jun 27, 2008
    249
    3
    HI
    thanks guys, once again sorry for the delay ,i totally agree with all sentiments, having just done the pcb, i dont think i wanna do that again,
    (i try not to route traces between the pins) im hoping to make three, so at least all the boards 6,, will be the same,would you please have a look at this http://www.sensorso.com/home/type.php,
    i didnt want to copy the pic, its the 16th one down ,

    they are all pretty rar in the uk and i dont know what processing if any they will need,
    theres also this in the uk.but its described as a dual latch, although not badly priced, http://uk.farnell.com/honeywell-s-c/vf526dt/sensor-hall-effect-dual-sot89b/dp/1811314,
    i;ll update occasionaly just in case anyone ever thinks of doimg a similar project
    pcb-
    thanks again
    doug
     
    Last edited: Jun 15, 2014
  10. tibbles

    Thread Starter Active Member

    Jun 27, 2008
    249
    3
    just a quick update.
    well the hall effect switches came today,just a couple of days to come halfway round the world,looks as i might be going with these as they work better than i dared hope,
    the switches are miniscule,the ones i used are unipolar, non latching, mounted back to back.the output is a sink to neg.
    i cobbled together a test circuit with a buffer transister, but it didnt need it.more than enough output to run an led.
    im using a speaker magnet for the magnet for the time being,position and distance dosen't seem too critical.the polarity determining the output,with no output with no magnet.
    looks as though the whole thing,apart from consumables, should be less than a fiver $9.50, but priceless in other terms...
    thank you
    doug
     
  11. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    Thanks for the update, looks like a good solution! :)

    Those unipolar hall switches are easily good for sinking 20mA, so (as you said) there is no need for a transistor. Just drive the LEDs directly.

    If you buy modern hi-intensity LEDs (ie 6000mCd brightness or more) they can be very bright from just 1 or 2mA. That will save you a lot of battery power if this is going to be battery powered. Just be aware that the blue ones can require 3v or more to light up, red and green about 1.2 to 1.9v range.
     
  12. tibbles

    Thread Starter Active Member

    Jun 27, 2008
    249
    3
    just a quick shot, while ive got the camera out- all working well so far..
    i must look up the word convoluted,
    the hall effect switches have to go face to face.
    the magnet works up to an inch away with no ambiguity whatsoever,
    a big thank you to all ,
    regards
    doug
     
  13. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    Nicely done! :)
     
Loading...