2
\$\begingroup\$

I have a need to know if two or more of eight switches are on at the same time. The supply voltage is 12 volts dc. The switches are SPST. I have looked at digital circuits but have yet to figure it out. Any help, please.

\$\endgroup\$
6
  • 1
    \$\begingroup\$ Are the switched dedicated to this problem? Or do they have another use as well. If they have another use, you should add that information to your question. \$\endgroup\$ – Math Keeps Me Busy Mar 1 at 14:03
  • 2
    \$\begingroup\$ Your question title does not match your description (is it one or two switches?). Please correct it to avoid confusion. \$\endgroup\$ – StarCat Mar 1 at 14:26
  • \$\begingroup\$ A microcontroller and some resistor voltage dividers would be simple enough to do this. But we need to know more about your circuit. \$\endgroup\$ – Passerby Mar 1 at 15:03
  • \$\begingroup\$ Looks like homework to me ... \$\endgroup\$ – brhans Mar 1 at 15:21
  • 1
    \$\begingroup\$ @Bob You should fix the title \$\endgroup\$ – Math Keeps Me Busy Mar 1 at 18:07
5
\$\begingroup\$

You could do something like this:

schematic

simulate this circuit – Schematic created using CircuitLab

R9 + R10 is 7.07K, which is optimized to maximize the difference between Vcc/2 and the voltage with one switch and two swiches (about 1V nominal difference in each case). 1% resistors are suitable and cost about the same as 5% these days.

Here are the voltages at the comparator vs. the number of switches closed (>6V turns the LED on):

enter image description here

\$\endgroup\$
3
\$\begingroup\$

This is a simple voltage adder circuit. Resistance values are just for show. In this circuit you can play with the switches and see that the output voltage changes based on how many switches are thrown. You can also see how the output voltage changes with resistance.

Reading Vout will tell you exactly how many switches are thrown if you set the range of the adder between Vmin and Vmax of your ADC. If you only want to know when 2 or more are flipped just make Vout = Vmax when 2 switches are thrown (This is now digital logic).

The equation is (V1-D1)/R1 + (V2-D2)/R2 ... = Vout/R4

If you don't care about a little power feeding into the other lines you can make the resistance values large and remove the diodes.

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
2
\$\begingroup\$

A circuit like this will get you there:

schematic

simulate this circuit – Schematic created using CircuitLab

The idea is that you choose the R values and the zener voltage so that when the desired number of switches are closed, you get a voltage above the (-) input on the (+) input.

In this case 1 switch will only get you 6V but two will get you 8V and the output will turn on.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.