# Am I able to make a comparator on optocoupler?

Initially I'm trying to make over current protection scheme. So if the R2 current (and therefore R2 + D1 voltage) will go higher than some certain level I should have a signal to break the circuit.

I'd make it with a comparator, but making a comparator with isolated output can lead to a relatively complicated schematic: in addition to comparator itself I will need isolator (optocoupler for example) and isolated DC-DC power source to feed the comparator: tall tale.

However if I don't need high precision, high speed and so on - it looks very attractive to made a whole comparator scheme using optocoupler only.

For the moment I made a schematic which basically works (comparing U(R2)+U(D1) voltages with some threshold), but pretty bad:

Blue line representing the forward current of the coupler LED.

Basically I need to make a signal if the R3 current will be higher than some threshold. The precision can be as bad as +100 -50%.

This schematic was built intuitively. I hope that I could make a better comparator of the optocoupler. Am I?

• What are you comparing? I only see one input and one output. Apr 24 '16 at 18:43
• @Daniel I'm trying to compare U(R2) + U(D1) with some threshold. I made needed comments to my question. Apr 24 '16 at 18:58
• Can you sense across the 100 Ohm resistor? That seems like a more reasonable place to do it. Apr 24 '16 at 19:55
• @Daniel 100 Ohm resistor is a variable here. As I need to sense the current and I don't know in advance the load resistance I should sense MOSFET channel voltage. Apr 24 '16 at 20:13
• Please explain in the question (not in the comments) what the circuit is supposed to do. e.g., "I want an opto-isolated signal to indicate if an input voltage is above a certain (adjustable) threshold." That way someone can give you a good solution rather than try to fix a bad one. Apr 24 '16 at 21:00