0
\$\begingroup\$

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?

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

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.

\$\endgroup\$
2
  • \$\begingroup\$ I seemed to have gotten it working with a 50k pot instead of 10k. What does parallel to the lock mean? Not sure where I should put it in the circuit. \$\endgroup\$ Mar 18, 2016 at 5:31
  • \$\begingroup\$ @user2570937 get a diode like the 1N4001 and place it in parallel with the lock. The kathode (marked with a ring) should point towards the power supply. \$\endgroup\$ Mar 18, 2016 at 7:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.