Electrical – How to turn on a magnetic lock with an Arduino

12varduino

I have a 12v magnetic lock, which is just an electromagnet. I want to turn it on with my Arduino.

I've been able to turn on/off a 5v motor with the Arduino. So I'm guessing the wiring is similar. The problem is I need 12v. I looked for a 5v to 12v DC convertor at Fry's and DigiKey, and couldn't find any. I can only find ones that go from 12v to 5v.

I found a this youtube video doing exactly what I want, but it's short on details. He only has a single electronic on his breadboard that he calls a "DC convertor". No transistor, no diode. How does that work?

Also, is the current from the Arduino enough to power a magnetic lock, or should I have an external power source?

I'm very new to electronics. Any help is appreciated.

Best Answer

You need a relay circuit, here is a simple relay circuit example.

enter image description here (source)

You should find a relay with 5VDC coil, and replace the +12VDC power supply with 5VDC, use the same power supply that powers your arduino. And then use 12VDC power supply instead of 240VAC. Put you magnetic lock where the 240VAC bulb is.