Using LM339 as an op amp

GroupDIY Audio Forum

Help Support GroupDIY Audio Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

ruffrecords

Well-known member
Joined
Nov 10, 2006
Messages
16,265
Location
Norfolk - UK
For my 10 segment bar graph LED VU meter I am using LM339 comparators for the LED drivers. 10 LEDs need 10 comparators and three chips contain 12 so I have two left over. So I am wondering if I can use these two as op amps to precision rectify the audio to drive the meter?

Cheers

Ian
 
Yes it can be used as an amplifier. You need a load resistor on the output to the positive rail, since it is an open collector output. Stability at lower gains might be a problem, there is no internal compensation.
 
open collector comparators make crappy op amps, but yes it can be done. The comparator input LTP is more one way or the other optimized for other stuff than smooth linear operation. Can be hard to stabilize, so don't expect great HF rectification if you scrub off a bunch of GBW to stabilize it. 

I seem to recall an old quad package that was two 339 comparitors and 2 GP op amps  (lm324 performance opamp). Of course I can't find it now so probably long obsolete, or a figment of my imagination. I never used it in a design.

They now make a better part  TMS102 with a 2.5v voltage reference thrown in for good measure. http://www.ti.com/lit/ds/symlink/tsm102.pdf  looks like SMD only

for TH they still make a LM393 (1/2 LM339) which is a dual comparator you could cobble together with a dual opamp.

Or you could use sections of a quad op amp as comparators.  I've used op amps as comparators in meters too (I've made lots of meters over the years).

JR 
 
Thanks JR. I found the LM613 which appears to be two comps and two op amps in a DIP package but nobody seems to stock it. LM339 plus TL072 looks like the best way forward.

Thanks for the input.

Cheers

ian
 
volker said:
Yes it can be used as an amplifier. You need a load resistor on the output to the positive rail, since it is an open collector output. Stability at lower gains might be a problem, there is no internal compensation.
Hi Volker:

OT: I have sent the UI39 winding data to Electro Mag. I will let you know what they say.

Cheers

ian
 
> LM339 ...wondering if I can use these two as op amps to precision rectify the audio

Did you read the fine data sheet?

OIC. That part is left out of many modern editions. This has it:
http://www2.ensc.sfu.ca/reference/data-sheets/LM339.PDF

It's not compensated. The hack is a half-mike cap directly on the output pin. This will make it SLOW. The examples are for Av=100; it may still not be unity gain stable.

To hold a reference voltage it might be fine. To rectify wideband audio, I don't think this is the tool. (Even 'good audio' opamps lose precision by 10KHz. As a program meter this might be tolerated. If someone runs tone they may be befuddled.)
 

Attachments

  • LM339-opamp.gif
    LM339-opamp.gif
    9.7 KB · Views: 40
TI hides the old paper they got from competitors' tag-sales.

Comprehensive usage, including how to tie-off unused sections:
http://www.ti.com/lit/an/snoaa35/snoaa35.pdf

"Beer sheet" - company buys a beer if you write-up yet another way to use a part:
http://www.ti.com/lit/an/snoa654a/snoa654a.pdf
pg 25 discusses opamp tricks, <100Hz.
 
PRR said:
> LM339 ...wondering if I can use these two as op amps to precision rectify the audio

Did you read the fine data sheet?

OIC. That part is left out of many modern editions. This has it:
http://www2.ensc.sfu.ca/reference/data-sheets/LM339.PDF

It's not compensated. The hack is a half-mike cap directly on the output pin. This will make it SLOW. The examples are for Av=100; it may still not be unity gain stable.

To hold a reference voltage it might be fine. To rectify wideband audio, I don't think this is the tool. (Even 'good audio' opamps lose precision by 10KHz. As a program meter this might be tolerated. If someone runs tone they may be befuddled.)
yup... as already suggested... for today's dose of TMI

The problem for precision rectifiers is the combination of HF "and" low level. While perhaps not obvious, at zero crossing transition between positive and negative, the output of the rectifier op amp needs to slew roughly two diode drops to change drive polarity direction. This clearly shows up as a HF rolloff getting worse at lower amplitudes as the op amps literally run out of open loop voltage gain.  Most simple audio meters don't read low enough to cause problems with decent audio grade op amps, but a tricked up 339 is starting with both arms tied behind its back.

I had to take extra measures to deliver 20kHz -3dB @ -50dBu in my old TS-1 rectifiers.

JR
 
Isn't it one of the, mostly unwritten, engineering rules that comparitors and op-amps should not be used interchangeably.
 
Winston O'Boogie said:
Isn't it one of the, mostly unwritten, engineering rules that comparitors and op-amps should not be used interchangeably.
Its a rule, but not a law... They are not interchangeable.

Old school bipolar op amps had significant input bias current that could cause errors when used as comparators. When the op amp input LTP is saturated in one direction you get 2x input bias current, saturated the other way, no bias current.  Modern op amps are not as severe of a problem in this regard. Old bifet op amps had suitably low input bias current, but poor DC characteristics. 

I recall one published design from a competing kit company back last century who used an op amp as a comparator where it made a difference, but not enough of a difference to break the design. That designer is now passed so RIP.

I used op amps as comparators in one of my old meter designs so I could both sink and source current (needed for this particular peak/ave meter topology). Peak first going high turns on an LED between two op amp outputs. Average next going high turned them off again, generating a floating bar display with top of the bar indicating peak, bottom average or VU (height of the floating bar indicates crest factor if equal dB increments are used). 

As usual TMI

JR
 
JohnRoberts said:
As usual TMI

Not at all.  I learned something.  For those of us not proficient in programming a micro-controller, an old school design that simultaneously shows peak and average is useful.
 
Winston O'Boogie said:
Not at all.  I learned something.  For those of us not proficient in programming a micro-controller, an old school design that simultaneously shows peak and average is useful.
I've posted about my meters ad nauseum... That floating bar was my second patent (US05119426  Roberts) assigned to Peavey in 1992 so now public domain... My earlier patented version from 1979 (US04166245  Roberts) is likewise free to use.

Speaking of micros, here is pix of later one, based on my first dot/bar patent that I coded up for a friend's console company (APB), this century.

JR
 

Attachments

  • peak:vu.pdf
    163.3 KB · Views: 40
Thanks John.
I  haven't read your posts re. your meters (I was AWOL for a few years) so I'll search for them.  Likewise I'd like to read the patents.  Thanks.
That dot/bar 4 channel pcb looks neat  :)
 
Ian

Tangent,  a 1970-80s US desk manufacture used unused sections
of their 399 based VU meters in both their 7 LED and 11 LED VU versions
as driver stages for their meters.  These are actually very nice designs
in their day.  I would say give it a shot.

GARY
 
gar381 said:
Ian

Tangent,  a 1970-80s US desk manufacture used unused sections
of their 399 based VU meters in both their 7 LED and 11 LED VU versions
as driver stages for their meters.  These are actually very nice designs
in their day.  I would say give it a shot.

GARY

Thanks for that Gary. The only info I have been able to find is on the 3216 model. That has 12 LEDS and uses 3 x LM339 plus a TL084. Can you remember which model console had the 7 or 11 LED VUs?

Cheers
Ian
 
Back
Top