counts every time switch turned on/off

Discussion in 'The Projects Forum' started by Xufyan, Apr 25, 2011.

  1. Xufyan

    Thread Starter Member

    Aug 3, 2010
    114
    0
    please have a look at the circuit,
    in this circuit the output will always remain '1' no matter what the input is,
    i want my circuit to count every time any of the four switch turned on or off by the user, how can i do this ??
    please give some idea.

    [​IMG]
     
  2. KMoffett

    AAC Fanatic!

    Dec 19, 2007
    2,574
    230
    Do you actually mean "count" with a numeric display...or just pulse the LED on and off again each time a switch is closed or opened?

    Ken
     
  3. Xufyan

    Thread Starter Member

    Aug 3, 2010
    114
    0
    i know how to display using 7 segment, i just want count every time any of the switch is closed or opened. (since the output always remain high , i wonder how to count how many times switch is opened or closed :confused: )
    basically i am designing a circuit that will turned off after 4 counts
     
  4. KMoffett

    AAC Fanatic!

    Dec 19, 2007
    2,574
    230
    Try this 4X "edge detector" circuit with a "diode ORed" output.

    Ken
     
  5. CDRIVE

    Senior Member

    Jul 1, 2008
    2,223
    99
    Since you're using TTL, there's a host of "divide by n" counters available. The output can then be fed to a PNP switch in line with your Vcc.
     
  6. Xufyan

    Thread Starter Member

    Aug 3, 2010
    114
    0
    please elaborate...we are still learning the basics of DLD
     
  7. Xufyan

    Thread Starter Member

    Aug 3, 2010
    114
    0
    what is this ???
     
  8. KMoffett

    AAC Fanatic!

    Dec 19, 2007
    2,574
    230
    CDrive,

    It sounds like Xufyan's problem is not the counting, it's the inability to generate a pulse for each and every opening or closing of every switch with their TTL OR'ing circuit simulation.

    Xufyan,
    What is DLD?

    Ken
     
  9. KMoffett

    AAC Fanatic!

    Dec 19, 2007
    2,574
    230
    Each section with a switch, 2 resistors, capacitor, and XOR (exclusive-OR) gate form an "edge detector" circuit. It gives you a brief pulse out whenever the switch is opened or closed. (see explanation with Figure 2. http://sound.westhost.com/appnotes/an005.htm )The "diode OR-ing" D1/D2/D3/D4/R9 act like a 4-input OR gate. Any time one of the XOR gates outputs goes high, R9 is pulled high by the XOR's diode. The other diodes isolate the other XOR's outputs. Or you could use a 4-input OR chip.

    ken
     
  10. Xufyan

    Thread Starter Member

    Aug 3, 2010
    114
    0
    it will completely change my circuit,
    what i am trying to do is, applying counter operation in 'Simple Combination Lock' circuit,

    [​IMG]

    the 4 switch that i was talking about are the input switch for the user to input the code , every time any switched changed its state the count increase to 1,
    i have already applied 7 segment operation into my circuit (input from the switch appear on 7 segment) now all i have to do is to apply counter operation , i'm having real hard time with it :(
     
  11. KMoffett

    AAC Fanatic!

    Dec 19, 2007
    2,574
    230
    I'm getting confused with what you have. Can you post a schematic of your whole circuit?

    Ken
     
  12. Xufyan

    Thread Starter Member

    Aug 3, 2010
    114
    0
    i've the same circuit as this on bread board, but i have made some changes in it,

    The output of nor gate that is connected to 'Red Led' is removed , and that output of Nor gate is the input of '555 Timer' then the output of the Timer is connected to Red LEd in my Circuit (for on/off effect of Red LED).
    I have connected 4x 7447 IC (BCD to 7Segment) into my circuit and the 'A' (7) pin of each IC are connected to 4 switches (all others input pins of 7447 are set to zero) so that the input at pin 'A' will be '0' or '1', if each of the 4 switch is set to '0' , 'A' become zero and all the 7 segment display '0' or vise versa.

    [​IMG]

    Now i want my circuit to count the number of attempts by the user as well !
     
    Last edited: Apr 25, 2011
  13. CDRIVE

    Senior Member

    Jul 1, 2008
    2,223
    99
    Ha, you'd think by now I would have learned that an OP's description rarely matches the issue at hand and are usually two vastly different things. I read "count" and the rest is AAC archives. :)
     
  14. KMoffett

    AAC Fanatic!

    Dec 19, 2007
    2,574
    230
    Sorry, I really don't want to try to visualize or draw up all your circuit changes for you. My circuits can replace your input switch pull-down resistors (my 1K's replace your 10K's) to give you the edge-detector pulses for a digital counter.

    Ken
     
  15. Xufyan

    Thread Starter Member

    Aug 3, 2010
    114
    0
    Ok leave it,

    just have a look at this simple circuit,

    [​IMG]
    in this circuit every time the switch turned off or turned on , the output at the two XOR will be changed from '0' to '1' or from '1' to '0' , but a user can turned off/on 1 switch at a time.....
    now every time the output change (from '0' to '1' or '1' to '0') , i want to count it.
    if output in any of the two xor gate change from '0' to '1' , 1 bit increase in count on second attempt if output changes from '1' to '1' the count must increases from 1 to 2 ,
    is it possible to do so ??
    i need just an idea to design such a circuit....we have studied and learned Gates,Latches,Multiplexers,Adders,Decoders,Flip Flop and decade counter so far , so is it possible to acheive this result using any one of these ?
     
  16. KMoffett

    AAC Fanatic!

    Dec 19, 2007
    2,574
    230
    OK, a necessary limiting definition.
    OK
    OK
    "from '1' to '1' " ??? A typo? Did you mean '1' to '0'? If so than yes, it can be done with OR-ing the outputs of the two XOR gates to one of my XOR edge-detector circuits. With that, you then need some kind of positive-pulse-counter-to-display circuit.

    Ken
     
    Last edited: Apr 26, 2011
Loading...