ldr circuit

Thread Starter

ol'trusty

Joined Sep 9, 2009
48
Hello
I have wired this circuit and the problem I am having is that it wont go off when dark.
It goes on when light but doesnt release the relay when dark..
What am I missing?
:cool:
 

Attachments

wayneh

Joined Sep 9, 2010
17,498
That old op-amp may not be able to take its output voltage low enough to release the relay. You could try a more modern amp with a rail-to-rail output (or at least to the negative rail) or look at ways to pull the output lower to turn off that transistor. [edit] Or you could use a dual supply to power the op-amp.
 

KnRele

Joined Jan 7, 2013
20
The 741 isn't able to move its output above about 7.5V or below 4.5V. When the LDR is in the dark, the output will go to somewhere around 4.5V, which will still drive the transistor with around 3.8 mA (4.5V - 0.7 V across 1 kOhm) -- so it will still be in saturation and keep the relay turned on.

To make this work you might want to use a different op-amp, such as one half of a LM358 which can go all the way to the negative rail, or a real comparator such as the LM311 which also is likely to be able to drive your relay. Not all op-amps can do service as comparators; watch out.

I also recommend you put a diode across the relay to protect the transistor from the voltage spikes that appear when the relay is turned off: place its cathode to the +12V line and the anode to the collector.
 

wayneh

Joined Sep 9, 2010
17,498
Can you explain dual supply?
A dual supply gives 2 voltages versus ground, one positive and one negative. They're usually the same, for example ±5 volts, but they don't have to be. The op-amp sees the combined (10v) voltage for it's power, and then has no problem pulling the output voltage to zero or below. It can't get any closer to the negative rail, but now that rail is below the center voltage. Sometimes it's as simple as using a diode or two to give a "center" voltage above the negative rail.
 

Thread Starter

ol'trusty

Joined Sep 9, 2009
48
Thanks for the replies I now understand the problem
I still havent understood the dual voltage but I will read up on it
;)
 

Audioguru

Joined Dec 20, 2007
11,248
The LM741 is old and obsolete, but it will do the job with a single supply. See the attached schematic.
No.
MOST old 741 opamps will not work in the circuit, a few might if you are lucky to get one.
also you selected a Mosfet that needs a very low gate voltage to turn off which rarely happens in the circuit.
 

Audioguru

Joined Dec 20, 2007
11,248
SOME but all Mosfets do not turn off when their gate voltage is only 2V from the output of an obsolete 741 opamp.

Use obsolete 741 opamps and modern Mosfets together if you like to gamble.
I NEVER gamble with my circuit designs. ALL of them work and I have had tens of thousands made.
 
Top