Ok I have an Op-Amp as a comparator,

Its the TCA0372... whole amp it can source, not needed just nice.

and I have a relay,


Its driven by 12v. enter image description here So with flyback diode and all I have it set up as a regular Op-Amp comparator to the coil of the relay. This worked great everytime without fail when I did this on a bread board. I put this onto a PCB board I made and had fabricated and populated and now it works for a few seconds and never works again untill power cycling and giving it time. (almost sounds like overheating)

The Op-amp V+ is 12v and V- in Ground. Also I know an Op-Amp is not always best to use as a comparator but I had it laying around and verified on bread board it would work.

I check the + input the problem is not there as it gets the full 3.3v im using to drive it. Also the Vref is set with a voltage divider and iv verified its at 1.6v. I power on my board and this whole thing works a time or two and then it never works again. The output is around 0.43v. Its almost as if its over heating and needs time powered off to recover. however this Op-Amp can source a while amp and with the internal resistance of the relay coil it should draw no more then 44mA from the output of the Op-Amp.

Anyone know what could be going on. Iv tried the reference voltage extremely low and also tried pull up and pull down resisters on the output.

  • 1
    \$\begingroup\$ Do you have a 'scope? Could be oscillations (driving inductor) and the stray capacitance of proto-board killed oscillations. Maybe add some series resistance ahead of coil? \$\endgroup\$ Sep 28, 2017 at 15:04
  • 2
    \$\begingroup\$ How sure are you that the circuit is implemented correctly? if it outputs just .43V that sounds like you have a a diode drop - you didn't accidentaly solder the diode in backwards? \$\endgroup\$
    – Joren Vaes
    Sep 28, 2017 at 15:04
  • \$\begingroup\$ Can you afford a resistor in series with the output? \$\endgroup\$
    – winny
    Sep 28, 2017 at 15:13
  • \$\begingroup\$ George: I tried a resister in series ahead of the coil and diode yesterday evening and it didn't help, but I have not hooked it up to my scope yet. Joren: The components were soldered on at the board house and I checked they are soldered in in the correct orientation. Its a surface mount version of a 4n4001. Also it does output 12v like it should at first, its just after around a min it stops outputting correctly and drops to .43v. It never recovers from that state tell the pcb is powered off for a long time. \$\endgroup\$
    – Rob
    Sep 28, 2017 at 15:38
  • 1
    \$\begingroup\$ OK I will ask the dumb question.... does it get hot? \$\endgroup\$
    – Trevor_G
    Sep 28, 2017 at 15:57

2 Answers 2


You should use a Schottky diode in this application. Try the SMT version of the 1N5819 rather than the 1N4001 type you are using.

That will prevent the coil current from being shared with the chip output isolation junctions (to an appreciable degree) at turn-off.

Injecting currents from voltages below ground can cause latch-up which can damage the chip if there is enough supply current available.


There is a potential for relay coil current to commutate through a path you don't want.

Turning the coil is no problem, note the current path shown in red below, enter image description here

Turning the coil off is where the problem can occur, enter image description here

What you want to happen is for the coil to decay through your flyback diode (yellow loop). However if the ESD/substrate diodes of the opamp have a lower forward voltage by 10's of mV they will hog all the current and potentially latch up the opamp (blue loop).

When you run a bi-polar opamp as a comparator it can no longer drive a 4-quadrant load (reactive elements). You are forcing either the high-side or low-side output element to be on (driving the output high/low). The problem here is that the low-side element can only sink current not source. So if you need to source current at a low output voltage, the kickback from the coil forward biases the substrate diodes. This is in contrast to when you run an opamp in closed-loop, it will drive the output stage as needed (source or sink) to maintain the desired output voltage.


Add a diode in series with your opamp. This ensures the coil commutates through the flyback diode, not the substrate of the opamp.

  • \$\begingroup\$ Thank you. So even though this is not the smartest setup, to attempt to get it working ASAP you would suggest adding the diode as shown in the 2nd picture. The one you have going to the negative rail? not in series with the output. Also I was pretty sure the coil was off. When this circuit stops working there is only mV on the output of the OpAmp and I believe the relay coil wasn't charged but I will double check that. \$\endgroup\$
    – Rob
    Sep 28, 2017 at 19:48
  • \$\begingroup\$ The blue loop is what you don't want to happen. The relay coil has inductance and needs to be discharged. You want to discharge through the yellow loop. As @spehro suggest you can start with a low forward voltage fly back diode. Otherwise I would recommend a diode in series with the opamp output \$\endgroup\$
    – sstobbe
    Sep 28, 2017 at 21:06
  • \$\begingroup\$ That didn't seem to work. Any other ideas? \$\endgroup\$
    – Rob
    Sep 29, 2017 at 4:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.