I would like to use 2 magnetic proximity sensors (normally open reed switches) to determine the position of a chicken door (vertical sliding door) which in turn controls a motor. If the door comes within reach of the first (lower) switch, the motor should slow down some. When both switches are closed, the motor slows down even more and finally when only the second (upper) switch is closed the motor stops completely.
I would like to use a simple circuit that generates a voltage that can be read with a single GPIO (ADC). I would prefer an output that matches the following truth table:
(S1 = bottom switch, S2 = top switch, x = open circuit)
S1, S2, Output
x x 0V
1 x 1.6V
1 1 3.3V
x 1 5V
The output does not need to be in that order, but it needs to be distinguishable (at least 1/4V between states).
If at all possible, I would like to use only discrete components.