# Op amp comparator

Good morning

I have problem with op amp used as comparator. It should detect when a signal exceed reference voltage (impressed by voltage divider). The signal have range about 0v to -30v (it is negative!).

I supposed to use LM358 (truly common). But this device can be powered below 30v in single configuration and in dual mode it must not exceed +15v -15v. The range is twice the dual power limit, and I can't use single mode because it is negative.

So, can I provide a 0V to the positive supply pin and -30 to the negative one? In this manner I can cover entire rage of the input signal.

Can you suggest me other solutions?

Yes. So long as your reference and signal lie within -30v and -2v.

But your output from the LM358 will only swing between -30 and -1.5v . Is that OK?

Read the datasheet carefully to confirm.

And an opamp is not ideal as a comparator - perhaps a LM311 would be a better choice.

Allan

Can you use a voltage divider on that signal.
If so, then connect the divider's fixed point not to ground but to a positive voltage.
Then your signal can become even positive on the tap of the divider.
Leo..

Hi,

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom..

gio5:
Good morning

I have problem with op amp used as comparator. It should detect when a signal exceed reference voltage (impressed by voltage divider). The signal have range about 0v to -30v (it is negative!).

I supposed to use LM358 (truly common). But this device can be powered below 30v in single configuration and in dual mode it must not exceed +15v -15v. The range is twice the dual power limit, and I can't use single mode because it is negative.

So, can I provide a 0V to the positive supply pin and -30 to the negative one? In this manner I can cover entire rage of the input signal.

Can you suggest me other solutions?

Some opamps are not designed to handle a large voltage difference between inputs (they are designed
for negative feedback). Often the input current increases radically above the nominal in this circumstance.

So best to use a comparator.

You can reduce the input voltage with a voltage divider, note, to keep the devices in a sensible range.

Perhaps you can give more details of what the signal is and what you are trying to achieve,
so we can avoid the xyproblem.

This is a simple part of the entire project. The main line should supplies fixed voltage ( -1.25 to -30v negative). LM358 should detect when signal fall below -0.1V.

I have supposed to power LM358 with -33V and 0V. The signal to the positive input is within the range -1.25V to -30V (approximately). The reference voltage (about -0.1V) is applied to negative input.

If it’s so, will I damage LM358?

Your power supply specification exceeds the absolute maximum power supply voltage differential for the LM358 (32V), which is a very bad idea.

Rethink the design.

Sure!

With Zener I think to obtain 30V on op amp’s supply. In the attachment you can find my solution, it is a particular of previous schema, focused on LM358.

Is it ok? Can op amp be powered with 0 -30v (fixed by zener) and with input signal in range -1.25v -30v?

Hi,

• Why do you need to know when the voltage falls to below 100mV?
• Is the voltage you are measuring, like in your circuit, just a 30V power supply line?

Tom...

I can't make any sense out of your circuit diagram, because it is cut off at the top.

The last image is a particular referred to the first one. It's the same like in the first case, but I have added zener to op amp power pin, so I can impress 30V instead 33V or 32V.

I need to detect when the power line below 100mv: short circuit detection or other risk due to the load.

To do this you don’t need to run your comparator with -30v … I suggest -5. Use eg a 7905 regulator.

Run a resistor of eg 47k to the voltage to be compared and to one comparator input. Then just clamp this pin to 0v with a simple diode - eg 1N4148. This pin cannot then go lower than -0.7v. - but you’re only interested if it’s </> -100mV, so who cares.

Run the other to a -0.1v reference - eg with a 4k7 / 100 ohm divider from the -5v supply. This gives -104mV

If you want it more accurate make one of the two adjustable.

Alternatively, as Wawa suggests, use a +ve offset so you can run your comparator at > 0v - in this case you could use an arduino a/d to do the comparison if you don’t want a super quick response time. . Again I’d suggest using a diode clamp to 0v.

If interested I’ll hash out a circuit.

regards

Allan

Hi,

I have problem with op amp used as comparator. It should detect when a signal exceed reference voltage (impressed by voltage divider). The signal have range about 0v to -30v (it is negative!).

You are using a LM317 to regulate a NEGATIVE supply????

Also why are you using a LM358(Audio Power Amp) when a LM393(Comparator) will do the job a whole lot better?

Tom.... :o :o :o :o

I suppose you could rig a LM317 to control a -ve supply, but it’s not straightforward.

The LM358 is not an audio power amp - it’ll only drive a few mA.

It’s a very old not very good dual opamp - and useless here as it’s common-mode input range only goes to within -1.5v of it’s positive supply. No good if you want to look at Vcc -100mV.

The LM393 dual comparator suffers the same limitation.

TI also warn they may be discontinuing it in the near future.

I’ll hack up a circuit which doesn’t require any active components with a -ve supply…

Allan

My idea for a circuit.

2 diodes as that temperature compensates pretty well.

Allan

comp1.pdf (21.2 KB)

comp1.pdf (21.2 KB)

Many thanks to all!

I'm oriented actually the Alan's solution. I'm waiting for news about, if I need I report other question!!!