I'm working on a circuit that will open a relay once an input signal rises above 3 volts (it will be between 0-10VDC). My plan so far has been to use an op amp to compare the input to around 3 volts (made using a voltage divider from another voltage source of 24 V). I'm having two problems however: the appears to be a constant voltage in the op amp input pins even when there is nothing is attached and even with the output being around 24VDC, the relay does not turn on (instead, it hums - i think it is rapidly turning on and off?) as there might not be enough current going through? I'm curious if anyone knows why this might be the case and how I might go about getting around it. Also, if anyone has any suggestions on how to design this circuit differently to achieve the same function (maybe using transistors?), I'm all ears. I'm working with I have around me, so I expect there might be an easier approach if I purchase more suitable components. I'm completely new to circuits so any push in the right direction will be greatly appreciated.

Sorry about that, here is a basic schematic of my circuit. The op amp has 24 VDC in the high pin (from the same source that is being divided) and the low pin is connected to ground. The output is connected to the relay (which is then connected to ground).

Sorry about that, here is a basic schematic of my circuit. The op amp has 24 VDC in the high pin (from the same source that is being divided) and the low pin is connected to ground. The output is connected to the relay (which is then connected to ground).

Click to expand...

Ok, but where is the circuit you actually built?

A general and incomplete schematic is meaningless when you are asking why a specific circuit is not working.

Sorry if I'm misunderstanding your question, but I have everything connected. My two problems are that the input pins are constantly giving around a 2 volt difference between the ground pin and that the output (even when around 22VDC) is not enough to open the relay. I've attached an actual image of my setup with some labeling. Sorry if it is a bit unclear

You can't just leave the non-inverting input floating like that, it must be referenced to something so connect it to 0V via a 100k resistor.

The op-amp cannot deliver enough current to drive a relay and even if it could, the back-emf generated by the coil when it switched off would probably kill it. The relay should be driven by a transistor and there must be a diode across the relay coil.

The threshold voltage of your circuit is 2.18V not 3V

Here is one example of the correct way to drive a relay, C1 isn't necessary:

Thanks for the advice. I currently have a 2904N op amp that I was planning on trying out, but I'm looking into the comparator you posted. This may be a silly question, but is there a difference between an op amp and comparator?

Thanks for the advice. I currently have a 2904N op amp that I was planning on trying out, but I'm looking into the comparator you posted. This may be a silly question, but is there a difference between an op amp and comparator?

Click to expand...

Yes...

A comparator is designed to do what you want to do, compare analog input voltages and produce a digital output. It basically behaves like a 1 bit ADC. Some comparators provide an open collector output that will allow it to interface with different output voltage levels.

An opamp can be used as a comparator also, but its generally intended for signal gain, reduction, nversion or impedance matching (just to name a few). Because of this flexibility, it takes a little more design effort to produce the required output for driving a relay.