Not sure how to explain this, so hopefully it makes sense ... I suspect this is probably pretty easy for someone that knows what they're doing.
I'd like to build a simple circuit involving two resistors and two switches ... this part is no issue. I want to attach one side of each resistor to a single analog pin on an arduino (probably a mini), then each resistor to a switch, then each switch to ground creating parallel circuits from the one pin.
The challenge is that I want to size the resistors so that an analog read of the pin (when pulled up) will return values in 4 distinct ranges ...
- Both S1 and S2 are open
- Only S1 is closed
- Only S2 is closed
- Both S1 and S2 are closed
The other consideration is that I'd like the ranges to be large enough to allow for a little bit of tolerance in the wire, connections, and the resistors themselves as I'd like to repeat this a bunch of times (all virtually identical) but want the return values to be somewhat predictable so that no adjustments need to be made per pin (the analog read for a scenario might be +/- 100, but that shouldn't overlap the other possibilities).
Any insight on how to calculate what resistor values to use for this would be greatly appreciated.
Thanks
