Thanks folks I think this is close to what I"m looking for, but I don't
think it will work for my situation. If I understand the circuit drawn then
either the output is grounded OR it has 5v on it? I don't think I can have
any voltage on the output. I either need it grounded or effectively an open
circuit.
Let me try this again (and maybe that answer is the same and I just need to
dig into the circuit more).
What I basically am trying to do is create a switch and ideally I'd like to
isolate the the output from the rest of the circuit. I think the voltage
comparitor is going to work but I think I need a bit more. Here's the way
I'm visualizing this.
If the resistance is <2.5k then O1 is tied to GND and O2 is tied to I2
(which wouldn't have anything connected to it so it's an open circuit). If
the resistance is >7.5k then O1 is tied to I1 and O2 is tied to GND. If we
are between 2.5k and 7.5k then I1 is tied to O1 and I2 is tied to O2 (i.e.
both are open).
+5 I1 I2
| | |
| | |
| | |
| +------+
| | |---->OUT1
[10K]<--| |
| | |---->OUT2
| +------+
| |
| |
| |
| |
GND GND
If it helps make the circuit simpler I could also make it work a little
different. If the resistance is <2.5k then I1 is tied to O1 and O2 is open.
(so basically an isolated switch is closed if the input requirement is met
otherwise it's open) If res is >7.5k then I2 is tied to O2 and O1 is open.
If 2.5k-7.5k then O1 and O2 are open.
+5 I1 I2
| | |
| | |
| | |
| +----------+
| | | | |
[10K]<--| / / |-----GND
| | | | |
| +----------+
| | |
| | |
| | |
| | |
GND O1 O2
Thanks for the responses,
-Zinfari
John Fields said:
Depends on the accuracy you need - simpliest solution would be to use
two comparators, connect the pot betwwen GND and +5, and three
resistors in series also between GND and +5. Connect the comparator
inputs between the pot and the resistors.
_________________
| |
+5______|___ |
| | | |comparator
| | res |
| | |-------------
pot-| res
| | |-------------
| | res |
| | | |comparator
GND-----|---- |
-----------------|
---
Yeah, but you left out all the good stuff:
+5 +5 +5 +5
| | | |
| [2K49] | [1K2]
| | | |
| +-------|+\ |
| | | >---+---->OUT2
[10K]<----------+--|-/
| | |
| | | +V
| [4K99] | |
| | | [1K2]
| | | |
| | +--|+\ |
| | | >---+---->OUT1
| +-------|-/
| | |
| [2K99] |
| | |
GND GND GND
An LM393 would be OK for the comparator at 5V except for its common
mode voltage of V+ -1.5V at the high end, so either something with
rail-to-rail inputs should be chosen, or a series resistor added to
the pot and the divider string. Something like this should do it, but
you might want to check the numbers just to be sure:
+5 +5 +5 +5
| | | |
[10K0] [10K0] | |
| | | |
| [2K49] | [1K2]
| | | |
| +-------|+\ |
| | | >---+---->OUT2
[10K]<----------+--|-/
| | |
| | | +V
| [4K99] | |
| | | [1K2]
| | | |
| | +--|+\ |
| | | >---+---->OUT1
| +-------|-/
| | |
| [2K49] |
| | |
GND GND GND
BTW, the resistors are all 1%'ers except for the pullups and,
probably, the pot.