Using an LM393 - Non Audio!

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
I've got a little project going on where I'm feeding an LM393 comparator with a resistive pressure transducer configured as a bridge. I connected it up in pretty much the normal way, using 10k resistors to the inputs and a 10k pullup. From the output, I connected the gate of a n channel logic level FET which in turn operates a relay.

So far so good, the circuit operates in an understandable way. Then I remove the FET connection and it just goes crazy. Turns out the fet gate capacitance is imparting some stability to the LM393 output - and I can "stabilize" it without connecting the fet by adding a 200 pf cap from its output to ground. By stable I mean it apparently goes to within some Vce sat of ground in the low state, then to +V in the high, as any open collector output should.

Without the cap, the high state is some indeterminate DC voltage that I assume my meter reads because of some MHz oscillations going on. I cant for the life of me figure out why this is needed. I'm using a regular press-in 0.1" spacing proto board with leaded components. I picked the LM393 because it's a cheap and effective solution - when it working "right".

I'd just like to understand what's happening with this thing. No spec or app note mentions the necessity of loading the output capacitively to get it stable - only mention I saw was resistors connected to the input should be at least 10k to avoid oscillations. So they're 10k - check - still oscillates without the cap.

Any insights into what's happening with this little circuit would be appreciated! I've got a couple / few hours sunk into re-arranging components, changing the chip and struggling to realize what's happening. I use the other half to compare a voltage across a cap to another voltage set by a resistor ratio - no special 10k input / 200 pf output treatment there; it simply works like a comparitor should.

Analog sometimes drives me nutz... FWIW, the little pressure sensor bridge plugs into the protoboard right next the the dual LM393, with the leads all as short as I can make them. Thanks!
 
Last edited:
Gentleman, Thanks for your replies. I put two, 220 pf to ground on each of the (+) and (-) inputs to the LM339; one I assume to swamp the capacitive coupling from the output pin and the other for symmetry. (It's operating at only single digit Hz frequencies)

This cured the issue I was seeing. I like this solution a lot better than a cap connected to the output. Yes, the 10M value for hysteresis is a little steep - the level probably changes if someone "looks at it the wrong way". Appreciate the help!
 

PRR

Member
Joined 2003
Paid Member
.....the 10M value for hysteresis is a little steep - the level probably changes if someone "looks at it the wrong way"....

The 10k dominates. For 10k input, 10Meg PFB, and 5V supply, the hysteresis is reliably 5mV. The trigger levels as reliable as the 10k resistors (and the few-mV offset, and the not-negligible input current of the chip).

Anyway; don't look.
 
I spoke too soon. The thing is untenable - I assume in a push-pin proto board environment anyway. I connected my 20MHz Fluke 123 scope and the output is just full of hash - everywhere. Fuzz up to the leading edge, scope oft triggering on something it cant display, low state a big long fuzzy line - the works. Maybe it behaves a lot better in etch, with a ground plane underneath and ideal component connection routes.

I tried 10K pullup, 100 ohm to output, Various C to gnd and it would finally work when I got the "output" edge rates into the several ms - but I dont want that, I want one and only one sharp transition between states. I tried the 10M hysteretic feedback and while it did improve, it didnt solve what I'm seeing on the scope completely.

Exasperated, I threw it out and put back an LT1013; which dropped into the same "socket" - no pullup, no capacitors, no output treatment to coax a correct behavior and works flawlessly. It's a nearly $5 dual single rail op amp, vs the $0.50 LM393.

So ends that experiment. I'll look elsewhere for a cheaper and more workable chip.
 
Sounds like you've got an unintended feedback path. Those plug-boards are notoriously lousy if you are not careful. Did you bypass the power supply at the chip? It's hard to do plug boards because the lead length gets long and inductive. Did you bypass the supply? Another trick used is to place a filter on VCC, where you filter the VCC through a 10 Ohm resistor (or larger) from the power rail to the chip vcc pin. Then place a capacitor from vcc pin to ground pin. That gets rid of any high frequency crap from feeding back into the chip (technically beyond the PSRR).

Yes, Linear makes really good stuff - but you pay for it.

Do you care about speed? What about edge rates? I ask because almost any opamp will also work as a comparator - not an awesome comparator, but they work good enough depending on your application and is low cost. Also nice is the output is driven both high and low - while this comparator requires pullup (some do not).

It's a good idea to add a series resistor from the output of the chip to the gate of the MOSFET (I recommend a gate to source resistor as well). Placing caps across the output is bad news - the MOSFET has Cgd, Cgd, and they might make it go unstable due to some goofy feedback path you are not aware of.

You should post a schematic and/or photo. Maybe the problem is easier to see that way?

Good luck with it.

gene
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.