Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

switch counting circuit

Status
Not open for further replies.

rebeccaeazzy

New Member
hello, i apologise about the simplicity of the question and my ignorance in electronics but i am trying to design a circuit to count the amount of switches pressed simaltaniously. i would like the circuit to be able to count up to 9 switches and im really not sure of the right components to use. sorry again if its a stupid question. i know i will need a seven segment display and the switches but im afraid thats about it. thanks for your time.
 
Hero999 i think he is asking about counting how many are pressed, need more explanation,
tell us where you are going to use it. and what is the purpose?
 
I see, that's more complicated.

I have an idea if each switch connects to a 1V voltage reference, you could use an op-amp adder circuit to add all the voltages together and working out how many switches are being pressed simultaneously.
 
hello, i apologise about the simplicity of the question and my ignorance in electronics but i am trying to design a circuit to count the amount of switches pressed simaltaniously. i would like the circuit to be able to count up to 9 switches and im really not sure of the right components to use. sorry again if its a stupid question. i know i will need a seven segment display and the switches but im afraid thats about it. thanks for your time.

hi,
Dont buy a counter and connect all the switches in series, it will not work.!:(
 
Couple of possibilities.
9 NO switches with series resistors, in parallel, from a voltage source, feeding a voltage summing opamp. Output voltage equals the number of switches pressed.
A ladder of 9 NC switches in series, paralleled by 9 resistors in series, with "rungs" between switch junctions and resistor junctions, fed by a constant current source. Voltage between the top and bottom of the ladder equals the number of switches pressed.

Ken
 
Last edited:
Couple of possibilities.
9 NO switches with series resistors in parallel, from a voltage source, feeding a voltage summing opamp. Output voltage equals the number of switches pressed.
A ladder of 9 NC switches in series, paralleled by 9 resistors in series, with "rungs" between switch junctions and resistor junctions, fed by a constant current source. Voltage between the top and bottom of the ladder equals the number of switches pressed.

Ken

hi Ken,
I was thinking along the same lines, perhaps using a LM3914 as the display.

Eric
 
hi,
Dont buy a counter and connect all the switches in series, it will not work.!:(

Yes, ignore my first post, I didn't understand what you meant.
 
there is a way by using digital logic only as attached, the out put of 4017 is like a scanning train that will give a logic high when it passes a switch that is pressed(closed) and it will appear as a series of pulse at the out put and the counter will only see the pulse train.

may be its a long way, but digitally its possible to do like this, may be some one can come with more simpler solution too..
 

Attachments

  • switch counter..JPG
    switch counter..JPG
    50.6 KB · Views: 190
It might be preferable to modify mbarazeen's circuit so that the counter will continually reset and start a new cycle automatically so that it will always indicate how many switches are pressed.

You probably also want to use a display buffer so that the readout indicates a steady number while the counter is counting.
 
It might be preferable to modify mbarazeen's circuit so that the counter will continually reset and start a new cycle automatically so that it will always indicate how many switches are pressed.

You probably also want to use a display buffer so that the readout indicates a steady number while the counter is counting.

refreshing it with another slower clock will be better for a new cycle. also another improvement has to be done, since the delay during the change from one output to another may not be recognized at the input of the counter, so better to cascade two 4017 and use every other out puts. ex: Q1, Q3, Q5.....etc.
 
Last edited:
refreshing it with another slower clock will be better for a new cycle. also another improvement has to be done, since the delay during the change from one output to another may not be recognized at the input of the counter, so better to cascade two 4017 and use every other out puts. ex: Q1, Q3, Q5.....etc.
Just change the circuit slightly to avoid any delay issue. Clock the counter with the same clock as the 4017. Use the output of the 4017 count gate (labeled count on your schematic) to enable the counter. That way the counter will count only when a switch is depressed for that count position. The counter is reset to zero, of course, at the start of each new period.
 
Hi Rebecca,

A seven segment display will only display numbers from zero to nine,
however you can extend that by using letters A,b,C,d,E,F to get to fifteen.

If you use a meter you could just use resistors, and mark the scale yourself.

This is the simplest circuit possible for this job.
(unless someone shows a simpler one)

John :)
 

Attachments

  • Switches..JPG
    Switches..JPG
    30.4 KB · Views: 161
The OP only needed "up to 9" switches. No need for a non-linear scale. Just a linear voltmeter. Expandable too.
But this only tells how many "are" pushed, not how many "were" pushed. I don't know if that's needed.

Ken
 

Attachments

  • NC Switch counter&.gif
    NC Switch counter&.gif
    12.7 KB · Views: 175
Last edited:
hi, QUICK QUESTION ABOUT YOUR CIRCUIT.

I tried implementing your circuit with counter 74168 and it doesnt quite work for me> can you tell me what kind of counter u used and how u were able to connect your circuit to the counter. Thanks
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top