Switching two optocouplers based on different voltages

designopto-isolator

I want to build a (I think) simple circuit where I want to transmit the state of two switches across two wires (ground and live). Let's say I have a circuit with which I can set three output voltages between these two wires from the two switches (switch A pressed, switch B pressed, both pressed): 1V, 2V and 3V. How would I go about driving two optocouplers so that when the 'input' voltage is 1V, optocoupler 1 is 'closed' (if that's the right word); when the input is 2V, optocoupler 2 is closed; and when the voltage is 3V, both are closed? Thanks.

Best Answer

A slightly different way to solve your problem is to use AC and handle the two halves differently, as in the circuit below:

schematic

simulate this circuit – Schematic created using CircuitLab