# Help with a (simple - I think) circuit design

Discussion in 'Electronic Basics' started by Zinfari, Jul 31, 2004.

1. ### ZinfariGuest

I think this circuit should be fairly simple, but I have no idea how
to find the correct chip for this application. Here is what I'm
trying to do:

Basically I have a variable resistor (10k pot). When the resistance
is < 2.5k I want an output1 to be set to GND and output2 open. If the
resistance is >7.5k then I want Output 1 open and Output 2 set to GND.
At all other times I want Output 1 and 2 to be open (so from 2.5k to
7.5k).

Is there a chip or a couple of chips and some resistors that I can put
together that will accomplish this? I have access to 3.3v and 5v.

Thanks for any help,
-Zinfari

2. ### Robert StankowicGuest

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-----|---- |
-----------------|

3. ### John FieldsGuest

---
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.

4. ### Visi MailGuest

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

5. ### Randy DayGuest

How about running O1 and O2 thru some
open-collector gates (i.e. 7405)?
That gives you open or ground, but
you'll have to watch the current
limits...

R | O1*
___ |/
O1 -|___|--|
|>
|
|
===
GND

R | O2*
___ |/
O2 -|___|--|
|>
|
|
===
GND
created by Andy´s ASCII-Circuit v1.24.140803 Beta www.tech-chat.de

6. ### John FieldsGuest

---
Aaarrghhhh!!!

Mea culpa. I'm so used to pulling up open collectors that I didn't

Just get rid of the pullups and it'll do what you want.

+5 +5 +5
| | |
[10K0] [12K4] |
| | |
| +-------|+\
| | | >---->OUT2
[10K]<----------+--|-/
| | |
| [4k99] |
| | |
| | +--|+\
| | | >---->OUT1
| +-------|-/
| | |
| [2K49] |
| | |
GND GND GND

There is another issue which hasn't been dealt with yet, and that's
whether or not you can stand chatter on the outputs at the switching
points. If you can't, then that needs to be addressed

7. ### ZinfariGuest

Thanks for the reply. I don't think chatter will be an issue. It's very
unlikely for the resistance to remain at the switching point. I think that
should do it, but just out of curiosity I just came across this just before
(Basically a 74HC4066). I think this would work as well or am I missing
something here?

Thanks again for all the input,
-Zinfari

8. ### Rich GriseGuest

Yes, and it would be bipolar, thus much more like a simple switch closure.
An NPN open-collector only acts like a switch one way, so I think you're
closer to the original spec.

Has the OP looked up "window comparator"?

Cheers!
Rich

10. ### Robert C MonsenGuest

Note that comparators are usually open collector, meaning they are
'open' if they are high. Thats why JF's diagram had a 1.2k resistor to
the power supply 5V rail. If you get rid of that, I think the circuit
works as is.

Regards,
Bob Monsen

11. ### ZinfariGuest

Thanks for all the help everyone. It was much appreciated. After reading
up on open collectors the circuit makes sense and should work great!

-Zinfari

12. ### Robert StankowicGuest

Sorry, I simply overlooked the OP's spec of the pot (10K). Sloppy