Can you recommend a comparator?

#12

Joined Nov 30, 2010
18,224
That one looks like it will do what you want.

You should learn about parametric search engines. The first thing I want to do with your question is go:
www.mouser.com
semiconductors
amplifier IC's
analog comparators
differential
1 channel
open collector
search
sort by price
LM311 still exists for about 91 cents, but you can get a quad LM339 for half that price.

Then the search engine starts falling apart. Half the chips don't show output current. Half of the rest are labeled wrong or entered wrong. Now you have to start reading datasheets to get the down-low.

http://www.mouser.com/
http://www.mouser.com/Search/Refine.aspx?N=21009524
 

Attachments

Last edited:

ian field

Joined Oct 27, 2012
6,536
Also I have been using Mouser and I have narrowed it down. I didn't see the LM339 because I had it set to only show 1 channel. Thats very odd that the 4 channel would be so much cheaper, why is that?

And the data sheets are where I was getting hung up. Some of it I understand, some of it is greek and I really just needed some feedback to help me make sure I'm making the right choices.

I didn't select "differential" as the comparator type because I didn't really understand that vs the complementary, precision, and general purpose etc.

I didn't select the ouput type because I wasn't sure why I would chose open collector or open drain specifically. I would think I could use either depending on which side I placed it on right? And further I see some with both open and I have no idea what that is suppose to mean.
Driving a relay isn't a hugely demanding task, you don't need a particularly fast comparator for example.

Most comparators have an open collector output, and in any case you'll have to provide back emf protection when driving the inductance of a relay.

If you need more output current - the open collector output lends itself well to adding an external PNP to make it a Sziklai pair.
 

#12

Joined Nov 30, 2010
18,224
The first number is a quality indicator. 1 is military, 2 is industrial, and 3 is commercial and it's mostly about temperature range. In the National Semiconductor numbering system, any LM3xx will have a LM1xx that is better in specifications and temperature rating. The suffixes are about packaging. From memory, CN means plastic dual inline pins, NOPB means no lead.

Supply current is what the chip uses for itself. Output current is what the chip delivers.
Supply voltage range means you can use any voltage in that range, as long as the inputs do not exceed your power supply voltage...and then there are exceptions. Nobody intentionally designs a power supply voltage to wander all over the place. Usually, it's just making sure a battery doesn't go flat while the inputs are too high.
 

ian field

Joined Oct 27, 2012
6,536
Back emf protector?
When you switch off the current through the relay, the magnetic field around the coil collapses and induces a large voltage spike.

Most people put a diode across the coil terminals oriented so its not conducting when you energise the coil - Tyco relays published a fairly comprehensive appnote on it, last time I saw a copy was on the Element 14 website.
 

ian field

Joined Oct 27, 2012
6,536
Ian is going into design specs. I'm still on selection specs.

A back EMF protector is a diode you place on a relay coil so the inductor doesn't kick the transistors out of the chip.
At school I was taught rote - no one ever bothered to explain why any of that stuff was interesting.
 

#12

Joined Nov 30, 2010
18,224
The 211 will be "better" in some aspect. It might only be the survivable temperature range. This is when you REALLY examine the datasheets. You might spend 10% to 30% of the entire design time reading specs. I find I have to keep going back and reading one thing or another if I'm doing a design to maximize something like total power use because I'm pushing every spec to its limit.
 

ian field

Joined Oct 27, 2012
6,536
That is specifically why I've disliked traditional education so much. I like to understand all aspects of things,and they don't bother with that, they just push you though to pass the test.

As for the voltage spike from the inductor, I really should have known that. I built a little boost converter the other day lol.
Maybe I'd have been better at maths if any of the teachers had the faintest idea what it was any use for.

It was hard work and I wanted to know what it was for - they hadn't a clue!
 

AnalogKid

Joined Aug 1, 2013
12,130
How fast is the signal your are demodulating with the comparator, and how fast a comparator response do you need? If the answers are "not bery fast", consider the quad LM339 or dual LM393, two of the largest-selling IC's in the world. They will operate up to 36 V, are available in 1xx and 2xx rugged versions, and are just about indestructible. They don't have offset trims or the other goodies on newer parts, but they are an excellent starting point for a "newbie". Another option, again if you don't need great speed) is using an opamp with a wide input common mode range to act as a comparator. The advantage is that an opamp has a totem pole output - it can source the relay driver base current without the pull up resistor that an open collector comparator output requires. Also, the device isn't sinking the base current to ground when keeping the relay drive transistor turned off, a bit of power savings in battery applications.

ak
 

crutschow

Joined Mar 14, 2008
38,506
Also I have been using Mouser and I have narrowed it down. I didn't see the LM339 because I had it set to only show 1 channel. Thats very odd that the 4 channel would be so much cheaper, why is that?
.....................
Likely because the 4 channel device outsells the single channel device by a wide margin.
The more devices a manufacturer sells, the cheaper he can make it, and there's likely little difference in the chip area (and thus cost to process a wafer) between the single-channel and 4-channel comparators.
 

ian field

Joined Oct 27, 2012
6,536
Likely because the 4 channel device outsells the single channel device by a wide margin.
The more devices a manufacturer sells, the cheaper he can make it, and there's likely little difference in the chip area (and thus cost to process a wafer) between the single-channel and 4-channel comparators.
Some of the older parts may also be out of production.

AFAIK: Semiconductors are traded just like shares, scarcity pushes the price up.

A few years ago I was getting a few PICs, the prices for parts like the 16F628 etc were quite reasonable, but I decided to get a couple of the old 16F84 because I still see the occasional project that uses them - I was shocked that they cost more than 2x the price of a 628.
 

AnalogKid

Joined Aug 1, 2013
12,130
The LM339 common mode input range includes the chip's negative supply rail, but not the positive one. Add a 2-10K-resistor divider from V1 to GND, connect the - input to the center to create a trip point of 4.5V, and scale R3 and R2 to get the delay you want. R3 and R2 can be 10x larger without affecting performance, allowing a smaller C1.

ak
 

#12

Joined Nov 30, 2010
18,224
Maybe because you're trying to get the base of the input transistor to a higher voltage than its collector.
 

Attachments

#12

Joined Nov 30, 2010
18,224
So here's an idea; if your going to be a ass that's only interested in helping those equally experienced as yourself, skip over my post and let someone else point me in the right direction or let me figure it out on my own.
I regret answering the question about a schematic that listed the OP27 as the part you were using when you were not using that part. Looking at the datasheet which shows that you were pretending to pull the base of a transistor higher than its collector supply, when you aren't even using that chip, surely allowed me to look like an ass.
 
Top