Dual comparator closest to LM311

From circuitbending to homebrew stompboxes & synths, keep the DIY spirit alive!

Moderators: Kent, luketeaford, Joe.

User avatar
devinw1
Super Deluxe Wiggler
Posts: 1941
Joined: Tue Aug 07, 2018 11:20 am
Location: Portland, OR
Contact:

Dual comparator closest to LM311

Post by devinw1 » Fri Feb 19, 2021 12:41 am

So the title says it all! I am wondering if there's a compartator that is the same performance of the venerable LM311 but a dual. The key besides the performance is that it must have open collector AND have the emitter (output ground) terminal brought out. Many duals do not! I find this feature to be super handy since you can use the LM311 for example on +/-12V power and signals (LM311 lets input differential signal be +/-30V!) but then have the output be +/-5V with no extra components (assuming you have the 5v rails).

So far it looks like maybe LM319 is the closest bet?

:despair:

User avatar
guest
Super Deluxe Wiggler
Posts: 5576
Joined: Mon Aug 19, 2013 11:49 am

Re: Dual comparator closest to LM311

Post by guest » Fri Feb 19, 2021 1:02 am

i think the LM319 is it, although it has a different input stage that cant handle more than +/-5V differential input voltage. one trick for the LM393 is to just shift all of your input signals up to 0-12V range, and run it single sided.

[EDIT] but, an advantage to the LM319 is that its significantly faster
openmusiclabs.com

User avatar
guest
Super Deluxe Wiggler
Posts: 5576
Joined: Mon Aug 19, 2013 11:49 am

Re: Dual comparator closest to LM311

Post by guest » Fri Feb 19, 2021 1:12 am

theres also the LM161/361 but they have high input bias current (but are ridiculously fast). although not quite dual, just dual output.
openmusiclabs.com

User avatar
devinw1
Super Deluxe Wiggler
Posts: 1941
Joined: Tue Aug 07, 2018 11:20 am
Location: Portland, OR
Contact:

Re: Dual comparator closest to LM311

Post by devinw1 » Fri Feb 19, 2021 11:33 am

Cool, thanks. So it looks like I have scoured everything haha! I think the LM319 will actually be OK in this case because I'm using it as a window comparator at +5 and -5. The differential max is 10V total difference so I would be well inside that here.

I do have some 361s as well. That one is a weird one, it has that neat complementary output and is crazy fast as you said. But if you're not using the comp output, it sucks that it's only a single comparator in a big 14 pin package.

User avatar
devinw1
Super Deluxe Wiggler
Posts: 1941
Joined: Tue Aug 07, 2018 11:20 am
Location: Portland, OR
Contact:

Re: Dual comparator closest to LM311

Post by devinw1 » Fri Feb 19, 2021 11:52 pm

Fuck, I just realized the signal swing is +/-5 so the diff max is right at the limit. I tried it and it just drew a fack ton of power which makes sense the graph shows Input bias current goes thru the roof past the safe zone. I made it work by putting a 1k resistor between the Vref + and - and the inputs but that seems like a questionable bodge tho.

I guess I'll try a Lm393 and just use grounded emitter, assuming it is fast enough. On paper I believe it's slower than the Lm311

User avatar
guest
Super Deluxe Wiggler
Posts: 5576
Joined: Mon Aug 19, 2013 11:49 am

Re: Dual comparator closest to LM311

Post by guest » Sat Feb 20, 2021 12:06 am

yeah, the lm393 is slightly slower than the 311, but not by too much. you could put some clamps and limiting resistors on the 319, but at that point its more parts than just an extra transistor on the 393, and the cost is more. if you want to share the surrounding circuitry, i might be able to find some shortcuts.
openmusiclabs.com

User avatar
guest
Super Deluxe Wiggler
Posts: 5576
Joined: Mon Aug 19, 2013 11:49 am

Re: Dual comparator closest to LM311

Post by guest » Sat Feb 20, 2021 12:40 am

also, i just noticed the "new" LM393B variant. it looks like an all around improvement. its faster, cheaper, lower offset voltage and lower bias current. also, whats the difference between the 2903, 293, and 393? i never could discern that from datasheet.
openmusiclabs.com

User avatar
devinw1
Super Deluxe Wiggler
Posts: 1941
Joined: Tue Aug 07, 2018 11:20 am
Location: Portland, OR
Contact:

Re: Dual comparator closest to LM311

Post by devinw1 » Sat Feb 20, 2021 1:03 am

Ah interesting about the B varient. I hadn't seen that. Great question about the 2093 vs 293 vs 393. So confusing. I think it may just be a combination of package size and operating temperature? So hard to tell from the datasheet.

I'm just using this to trigger the flip flop on a new quadrature oscillator I'm working on btw. I'll share it soon when I get further along. Only reason I liked the open emitter and collector of the 311 was I could then power the CD4013 off +/-5 and automatically have the quadrature square waves come out in a ready to use 10Vpp wave for a euro module. It's really not a big deal to just go 0-5 or 0-12 And then level shift the square tho especially if it means I can use a single package for the window comp.

I see that 393B is SMT only but actually I may do this whole thing in SMT as I am utilizing TMUX6136s which are SMT only (but fucking awesome) so it may end up being no biggie

User avatar
guest
Super Deluxe Wiggler
Posts: 5576
Joined: Mon Aug 19, 2013 11:49 am

Re: Dual comparator closest to LM311

Post by guest » Sat Feb 20, 2021 2:54 am

yeah, that TMUX chip looks really good (a little costly though). looking forward to seeing the oscillator when its ready. as for the 4013, youd probably want a buffer of some sort before the output for protection anyways, so level shifting wouldnt be too much added on to that.
openmusiclabs.com

User avatar
EATyourGUITAR
has no life
Posts: 6078
Joined: Tue Aug 31, 2010 12:24 am
Location: Providence, RI, USA

Re: Dual comparator closest to LM311

Post by EATyourGUITAR » Sat Feb 20, 2021 10:16 am

search on mouser for type "push-pull" where it has open collector, open emitter etc..category selection. it has only one output pin but you can drive +/-5v cmos directly without any resistors. I think that is what you want anyway.
WWW.EATYOURGUITAR.COM <---- MY DIY STUFF

User avatar
devinw1
Super Deluxe Wiggler
Posts: 1941
Joined: Tue Aug 07, 2018 11:20 am
Location: Portland, OR
Contact:

Re: Dual comparator closest to LM311

Post by devinw1 » Sat Feb 20, 2021 2:13 pm

guest wrote:
Sat Feb 20, 2021 2:54 am
yeah, that TMUX chip looks really good (a little costly though). looking forward to seeing the oscillator when its ready. as for the 4013, youd probably want a buffer of some sort before the output for protection anyways, so level shifting wouldnt be too much added on to that.
Yeah, it's a tad high, but when you look at the landscape for SPDT switches in DIP...it is becoming bleak. DG333 went obsolete. ADG333 is probably the best one and it's like $10 and I don't trust AD to not obsolete that soon, what with only 60 or so in stock at Mouser. THere's also those cool-as-shit phase reversal switches that Maxim makes but those are spendy and they seem to be phasing (ha) those out as well.

I have been utilizing SPDT switches with 2 op amps as a very very effective Binary/Analog (meaning 1 input is 0 or 1 and the other is full analog) 4 quadrant multiplier. If you do it right, it works better than an optional inverter because you don't have any op amp slew rate to contend with. And those TMUX6s have virtually no charge injection and are super fast.

And yeah, I agree with you on the flip flop. Would be a buffer anyway, so yeah not much extra work to shift and scale it at all.

User avatar
devinw1
Super Deluxe Wiggler
Posts: 1941
Joined: Tue Aug 07, 2018 11:20 am
Location: Portland, OR
Contact:

Re: Dual comparator closest to LM311

Post by devinw1 » Sat Feb 20, 2021 2:16 pm

EATyourGUITAR wrote:
Sat Feb 20, 2021 10:16 am
search on mouser for type "push-pull" where it has open collector, open emitter etc..category selection. it has only one output pin but you can drive +/-5v cmos directly without any resistors. I think that is what you want anyway.
This makes sense. I seem to remember looking for pushpull output comparators a long while back it it seemed like they were all low power models and waaaay slower than LM311, but it is worth revisiting! :tu:

User avatar
guest
Super Deluxe Wiggler
Posts: 5576
Joined: Mon Aug 19, 2013 11:49 am

Re: Dual comparator closest to LM311

Post by guest » Sat Feb 20, 2021 7:04 pm

i seem to recall the 311/319/393/339/361 being the only models that can handle +/-12V rails. i think there was an lt1012?, but thats about it. there just isnt the same variety in the comparator market as there is for opamps, and they get a bit expensive as well.

as for switches, the DG4xx series still seems to be going strong, although the SPDT only comes in singles. you can use a quad SPST to get a dual SPDT, though, and some of the DG4xx series have inverted logic on half of the channels, so no inverters are necessary. but if the 4053 has good enough performance, that would definitely be the way to go.
openmusiclabs.com

User avatar
oldenjon
Ultra Wiggler
Posts: 864
Joined: Sun Feb 26, 2012 1:28 am
Location: Sacramento, CA

Re: Dual comparator closest to LM311

Post by oldenjon » Sat Feb 20, 2021 7:12 pm

LM306? Guess that has the same differential input limitation that was being discussed earlier though. For VCOs, why not just design for low power in the core? That really opens up the options.
"We all dance by ourselves, that's why we only play electronic music"

http://synthscalledbeasts.tumblr.com/

User avatar
guest
Super Deluxe Wiggler
Posts: 5576
Joined: Mon Aug 19, 2013 11:49 am

Re: Dual comparator closest to LM311

Post by guest » Sat Feb 20, 2021 9:23 pm

i went through and had a look at all the +/-12V comparators on digikey. i had done this a few years ago, but didnt write down any of my findings, which seems like a common mistake i make. at any rate, i found one i had forgotten about: TLV6710/TPS3701. these are dual comparators with an internal reference voltage common to both, intended to be used as a window comparator. unfortunately they are very slow. there is also the TLV1805 which is the only high voltage comparator that is push/pull other than the LM361.
openmusiclabs.com

User avatar
J3RK
Super Deluxe Wiggler
Posts: 6714
Joined: Tue Dec 22, 2009 12:46 pm
Location: Seattle

Re: Dual comparator closest to LM311

Post by J3RK » Sat Feb 20, 2021 11:43 pm

I like the LM393 quite a bit. I use it in a few circuits. It’s not ultra fast or fancy, but it’s easy to work with, and does its job.
Are you lemon? Does your head come to a nub?

User avatar
devinw1
Super Deluxe Wiggler
Posts: 1941
Joined: Tue Aug 07, 2018 11:20 am
Location: Portland, OR
Contact:

Re: Dual comparator closest to LM311

Post by devinw1 » Sat Feb 20, 2021 11:48 pm

That 6701 sounds cool. There should be a fast version of something like that. Or basically something like a 555 timer but with voltage refs.

Good point on the lower power oldenjon. Again I always get caught up in having "ready to use" waveforms but really maybe I should not worry about that so much. If I make the core go +/- 2.5V or 0 to 5V that really does open up a ton of options for all kinds of chips.

Btw Lm306 is not a dual.

User avatar
oldenjon
Ultra Wiggler
Posts: 864
Joined: Sun Feb 26, 2012 1:28 am
Location: Sacramento, CA

Re: Dual comparator closest to LM311

Post by oldenjon » Sun Feb 21, 2021 12:47 am

devinw1 wrote:
Sat Feb 20, 2021 11:48 pm
Good point on the lower power oldenjon. Again I always get caught up in having "ready to use" waveforms but really maybe I should not worry about that so much. If I make the core go +/- 2.5V or 0 to 5V that really does open up a ton of options for all kinds of chips.

Btw Lm306 is not a dual.
There are advantages to low power too.

Yes, but neither is lm311. Lm306 is a push pull comparator that can be run on 12V rails. Thought it was worth mentioning. Two single comparators take up about the same space as a dual in many cases.
"We all dance by ourselves, that's why we only play electronic music"

http://synthscalledbeasts.tumblr.com/

User avatar
devinw1
Super Deluxe Wiggler
Posts: 1941
Joined: Tue Aug 07, 2018 11:20 am
Location: Portland, OR
Contact:

Re: Dual comparator closest to LM311

Post by devinw1 » Sun Feb 21, 2021 1:05 am

Can lm306 run off -12 / +12? Or just 0 to 12v? It's hard to tell from the datasheet. I *think* it's saying the max differential supply voltage is 30V

User avatar
oldenjon
Ultra Wiggler
Posts: 864
Joined: Sun Feb 26, 2012 1:28 am
Location: Sacramento, CA

Re: Dual comparator closest to LM311

Post by oldenjon » Sun Feb 21, 2021 1:25 am

devinw1 wrote:
Sun Feb 21, 2021 1:05 am
Can lm306 run off -12 / +12? Or just 0 to 12v? It's hard to tell from the datasheet. I *think* it's saying the max differential supply voltage is 30V
I think so, the datasheet specifies VCC+ = 12V VCC- = -3 to -12V (unless otherwise noted) for the electrical characeristics. The only reason I know anything about it is because it's a drop-in replacement for the comparator used in the Serge PCO which I think used something like -4V there. Not sure why. It's really fast from what I understand.
"We all dance by ourselves, that's why we only play electronic music"

http://synthscalledbeasts.tumblr.com/

User avatar
devinw1
Super Deluxe Wiggler
Posts: 1941
Joined: Tue Aug 07, 2018 11:20 am
Location: Portland, OR
Contact:

Re: Dual comparator closest to LM311

Post by devinw1 » Sun Feb 21, 2021 1:58 am

oldenjon wrote:
Sun Feb 21, 2021 1:25 am
devinw1 wrote:
Sun Feb 21, 2021 1:05 am
Can lm306 run off -12 / +12? Or just 0 to 12v? It's hard to tell from the datasheet. I *think* it's saying the max differential supply voltage is 30V
I think so, the datasheet specifies VCC+ = 12V VCC- = -3 to -12V (unless otherwise noted) for the electrical characeristics. The only reason I know anything about it is because it's a drop-in replacement for the comparator used in the Serge PCO which I think used something like -4V there. Not sure why. It's really fast from what I understand.
Sweet. I am 99% sure I have some of those in my stash box of infinite secrets. Will give them testing tomorrow. The response time is indeed very fast according to the dataheet

User avatar
devinw1
Super Deluxe Wiggler
Posts: 1941
Joined: Tue Aug 07, 2018 11:20 am
Location: Portland, OR
Contact:

Re: Dual comparator closest to LM311

Post by devinw1 » Sun Feb 21, 2021 7:16 pm

Another one I just found, which is kind of an odd duck is the TL712. I tried it out and it is FAST. It has 3 state outputs and doesn't need a pull-up. It's interesting because it runs on single supply 0 to 7V, put has a huge differential input range. I tried it as a zero crossing detector on a a10Vpp signal and it worked fine powered from 5V. The output response was like a brick wall. Much faster than a LM311 with a 2k to 5V pull up resistor. The downside is it has a massive power consumption. Each one uses 20mA just sitting there. Yowza.

Also it seems I do have some LM306s around but they both didn't work at all for me. Output just went high and stayed there. I tried the strobe inputs low and open and no change. Maybe they are both fried. But I don't know why they would be.

User avatar
guest
Super Deluxe Wiggler
Posts: 5576
Joined: Mon Aug 19, 2013 11:49 am

Re: Dual comparator closest to LM311

Post by guest » Sun Feb 21, 2021 7:57 pm

thats an interesting one, it looks like its a current input device, so if you increase the source resistance you could sense whatever voltages you wanted to. but, that does mean it has high input bias currents. the "offset voltage" appears to be +/-100mV, so not the most accurate thing in the world, but maybe im reading the datasheet wrong. for a fast and cheap comparator, nothing beats a 74AC14 (or any schmitt trigger input CMOS). the downsides are that its comparison point is fixed, and varies from part to part, and there is hysteresis. but, if you only need a single sided trigger (one threshold moves with temperature, the other does not), its less than 10ns.
openmusiclabs.com

User avatar
devinw1
Super Deluxe Wiggler
Posts: 1941
Joined: Tue Aug 07, 2018 11:20 am
Location: Portland, OR
Contact:

Re: Dual comparator closest to LM311

Post by devinw1 » Sun Feb 21, 2021 8:50 pm

That is fast! Yeah, in this case I am using 3 comparators: 2 for a window that triggers the flip flop, and a 3rd which is a zero crossing comparator for one of the 2 signals in the quadrature feedback loop. Hysteresis on the zero crossing one would be most disastrous for that, so a no go there, or use a second flip flop. Though, I haven't really found where the speed limits are on this thing yet. My guess is is that it might be chasing the dragon a bit to try and get the comparators to be ridiculously fast when I still have some CMOS switches that have their own delays.

Speaking of switches, I tried a MAX4053 in place of the 2 TMUXs and it worked equally well to my ears. I am not sure what the difference is between the MAX4053 and the regular CD4053 but I did not actually have any CD4053s laying around. I just went to buy some and Mouser is freakin' out of them and have them on order. I noticed Digikey only had 23 of them (COVID anyone!!), so I bought them all...

User avatar
oldenjon
Ultra Wiggler
Posts: 864
Joined: Sun Feb 26, 2012 1:28 am
Location: Sacramento, CA

Re: Dual comparator closest to LM311

Post by oldenjon » Sun Feb 21, 2021 9:36 pm

I have been looking for a good SPDT lately, and DG403 caught my eye. Have you seen that one? The tmux looks better but DG403 is available in THT.
"We all dance by ourselves, that's why we only play electronic music"

http://synthscalledbeasts.tumblr.com/

Post Reply

Return to “Music Tech DIY”