counts every time switch turned on/off

Thread Starter

Xufyan

Joined Aug 3, 2010
114
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.

 

Attachments

Thread Starter

Xufyan

Joined Aug 3, 2010
114
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
 

CDRIVE

Joined Jul 1, 2008
2,219
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.
 

KMoffett

Joined Dec 19, 2007
2,918
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
 

KMoffett

Joined Dec 19, 2007
2,918
what is this ???
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
 

Thread Starter

Xufyan

Joined Aug 3, 2010
114
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
it will completely change my circuit,
what i am trying to do is, applying counter operation in 'Simple Combination Lock' circuit,



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 :(
 

Thread Starter

Xufyan

Joined Aug 3, 2010
114
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.



Now i want my circuit to count the number of attempts by the user as well !
 
Last edited:

CDRIVE

Joined Jul 1, 2008
2,219
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.
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.


Ken
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. :)
 

KMoffett

Joined Dec 19, 2007
2,918
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
 

Thread Starter

Xufyan

Joined Aug 3, 2010
114
Ok leave it,

just have a look at this simple circuit,


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 ?
 

Attachments

KMoffett

Joined Dec 19, 2007
2,918
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.....
OK, a necessary limiting definition.
now every time the output change (from '0' to '1' or '1' to '0') , i want to count it.
OK
if output in any of the two xor gate change from '0' to '1' , 1 bit increase in count
OK
on second attempt if output changes from '1' to '1' the count must increases from 1 to 2
"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:
Top