Switch circuit using op amp

Thread Starter

cwacht3

Joined Aug 25, 2015
6
Hey everyone,

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.

I was also considering buying a relay similar to this to try to 'skip' the need for an op amp: http://www.jameco.com/1/1/730-kf0604d-dc-dc-solid-state-relay-control-voltage-3-32vdc.html
Can I expect the relay to fully open once the signal goes above 3V?

Op amp: 2904N
datasheet: https://www.fairchildsemi.com/datasheets/LM/LM358.pdf

Relay: 1EHC6 12VDC
product page: http://www.grainger.com/product/DAYTON-Relay-1EHC6
 

Thread Starter

cwacht3

Joined Aug 25, 2015
6
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).
 

Attachments

blocco a spirale

Joined Jun 18, 2008
1,546
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).
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.
 

Thread Starter

cwacht3

Joined Aug 25, 2015
6
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


cwacht3_20150831_123223.jpg
 

ScottWang

Joined Aug 23, 2012
7,397
Before you attach the photo, please compress to a clear and small resolution as 800x600 or 1024x768, it depends on the contents, I already compressed it from about 800 Kb to 47 Kb.

If you want to get a quick and right answer, please post a normal and complete circuit, it will let members more easy to analyze the question.
 

Thread Starter

cwacht3

Joined Aug 25, 2015
6
I am also open to discuss other ideas on how to achieve the same fuction with a different circuit. I just need something to take in an input between 0-10 and output 24V if the input is above 3V


cwacht3_20150831_1232232.jpg
 

ScottWang

Joined Aug 23, 2012
7,397
Please take seriously for your photo and get the direction right, if you don't care what you do, who will care, please don't add any loading to the members.
 

blocco a spirale

Joined Jun 18, 2008
1,546
A number of problems jump out;

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:

https://electrosome.com/automatic-garden-light-controller-system/
 

Thread Starter

cwacht3

Joined Aug 25, 2015
6
Hey eetech,

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?
 

eetech00

Joined Jun 8, 2013
3,859
Hey eetech,

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?
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.
 
Last edited:
Top