12V Solenoid wiring diagram

Hi, I've been trying to design a magnetic lock that is turn on and off by detecting the light.

So far my circuit looks like this image: arduino hosted at ImgBB — ImgBB

I watched this tutorial: https://www.youtube.com/watch?v=VFzeFEPreC8

The first time I turned it on, it burnt out the relay - what am I missing?

The code works (i think) - essentially, when the input from the light sensor on pin 2 is HIGH and then pin 5's output is set to HIGH, turning the solenoid on.

What do you mean it burned out the relay?

There was smoke, and the smell of burning plastic.

i've since modified to the above circuit and a new relay, but now the solenoid does not get enough current. it still works when hooked directly up to the powersupply

It might be taking in flyback voltage from the coil of the solenoid and hurting your relay; crazy it got this severe unless something isn't quite hooked up right somewhere but the schematic you drew looks right. Only thing I can mention is that relay should have a "catch diode" on it where cathode is up at the +V side of the relay and shorts over to the low side of the coil. Search "relay flyback diode" and there's a ton of stuff there on this and how high the voltage spike can be without that.

Do you have a link to the solenoid? Solenoids are rated for continuous duty or intermittent duty, what exactly do you have. Already mentioned is need for a flyback diode across your solenoid coil. The same is true for relay coils.

Ron

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.