Electrical – LDR circuit with relay

electromagneticldrrelay

I have a LDR circuit here:

enter image description here

I'm using it to turn on a relay that is connected to an electromagnet lock. When there is light the lock unlocks and when there isn't the lock goes back to locked.

Everything works perfectly when i'm running the LDR circuit on a 9v battery and the relay and lock on a different 12v power supply running on the same ground as the 9v battery.

However I want to run everything off of the same 12v power supply and ditch the 9v battery. When I try to remove the 9v battery and run the LDR circuit off of the same 12v power supply the lock unlocks when light hits the LDR and then when the light is gone it never locks again. I have to move the pot all the way down in order to get it to lock. Any idea whats going on here?

Best Answer

When I try to remove the 9v battery and run the LDR circuit off of the same 12v power supply the lock unlocks when light hits the LDR and then when the light is gone it never locks again. I have to move the pot all the way down in order to get it to lock. Any idea whats going on here?

Your circuit is really simple and therefore very dependent on the component values, tolerances and things like supply voltage.

A quick and easy fix would be to connect the LDR to 12V with a 3V or 3.3V Zener-diode in series. That will drop the voltage from 12V to about 9V and your circuit will likely start to work again.

Since you've mentioned that you're triggering a lock: The lock is likely a electromagnet and the same precautions as driving a relay apply: Do you have a flyback diode in parallel to the lock? If not, please add one. The transistor will thank you.

Related Topic