Electronic – Is it considered a hack to use an op-amp in place of a relay

operational-amplifierrelay

I have an application that would traditionally be solved by the means of a relay. I have a 12 VDC load that I would like to switch on and off via a 5V microcontroller pin. But, I'm already using some 6134 (rail-to-rail) op amp chips in my project, and I have a free one I could use, since the IC comes with 4 op amps per chip.

Would it be considered a hack if I used my remaining op amp as a comparator instead of adding an additional relay to my circuit? If I put 2.5 V into the inverting input and the microcontroller pin into the non-inverting input, could that replace the relay? The positive rail of the op amp is already my 12 V load, and the negative rail is ground.

Best Answer

You ask that question like it is a bad thing!

If it does what you want, over the conditions you want (voltage, temp, lifespan, etc.) then what's the problem? People use electrical components in "non-traditional" ways all the time. LED's are used as photodiodes. Bipolar transistors are used as diodes. Op-amps are used as voltage comparators. I've even seen CMOS logic devices used as opamps and analog buffers!

The bigger question for you is: Are you using op-amps and relays correctly? And by correctly, I mean within the specs of the devices. Replacing a relay with an op-amp is certainly non-traditional. The two devices are different enough that it raises lots of red flags and other questions, but there are situations where that could be fine. Your question didn't give enough details for us to comment on directly.

So... Your question is, "Is it considered a hack to use an op-amp in place of a relay?" The answer to that is: Yes it is, but there is nothing 'wrong' with that-- provided that it works.