Converting ~5V DC to 12V DC safely to turn on/off magnetic lock

Hello

I have a 12v magnetic lock, which is just an electromagnet. here the link.

I want to turn it on with my Arduino Uno. I need 12v. I need a 5v to 12v DC convertor. I guess I do not need any additional transistor, no diode?

Also, is the current from the Arduino enough to power a magnetic lock, or should I have an external power source? Is it a relay a solution and do I need additional electronics elements or just a relay is ok?

Thanks

You must have an external power source, the magnetic lock will probably draw too much current to supply through the Arduino Uno, especially considering the boost converter.

I'd use an external 12v supply, and connect that to the Vin pin to power the Arduino as well...

You absolutely do need a transistor to switch it. Get a logic level N-channel MOSFET in TO-220 package (nice and big, easy to work with) - There's lots of information on how to wire MOSFETs online, you need only google.

What DrAzzy said.
This is, according to the ebay auction, 12V/0.35A, which would translate to 0.84A at 5V. Add the efficiency of a step up converter, account for peaks when you trigger the solenoid, and you're well over 1A, which is way more than the Arduino can deliver.
You could power your arduino from 12VDC using the round DC socket though, split the cable a bit before the plug, and add 2 more wires onto it to connect it to the solenoid of your lock - then use a FET to switch it, as DrAzzy said.

Like any inductive load you must prevent inductive kick-back (for DC this is usually done
with a free-wheel diode across the solenoid). Failure to do this will destroy your transistor
and perhaps Arduino.

An n-channel logic-level MOSFET is a good way to go, a 2N2222 BJT will also work as the
current is quite low. Either way you need a free-wheel diode across the solenoid.

Thanks for your replays. Very helpful. Just one more thing. Are these elements a good solution:

1.MOSFET : N-Channel 60V 30A (https://www.sparkfun.com/products/10213)

  1. DC-DC-Converter
    (http://uk.rs-online.com/web/p/dc-dc-converters/0389287/)

  2. Diode: Vr - Reverse Voltage:50V; If - Forward Current: 1 A

(http://www.mouser.com/ProductDetail/Fairchild-Semiconductor/1N4001/?qs=PKwgOmPR8%252bnXpabSf4kJpg%3D%3D)

Any additional resistor needed? Any diagram circuit how to connect all of them?

I found these diagram , is that ok?

Thanks

Why the DC/DC converter.
The relay circuit must be powered from 12volt, and the Arduino can be powered from 12volt.
So why not use a single 12volt supply for both.
Leo..

Ok. So just need a external power supply, MOSFET and free-wheel diode or I dont need any diode?Also do i need a resistor 10K?

You always need a diode across an inductive load, otherwise you could fry the transisor with the kickback of the coil when the transistor turns off.
A 2N2222 with 220ohm base resistor could be enough for this small 350mA latch.
A logic-level fet (as in your link) with the same value gate resistor is better.
A 10k bleed resistor from Arduino pin to ground makes sure the fet is not doing anything on it's own during Arduino bootup (floating output pin).
Leo..

Sorry do not understand between where the 10k bleed resistor is connected?Which pin from Arduino to ground for 10k bleed resistor?

So the best solution is a MOSFET ( N-Channel 60V 30A) , free-wheel diode( Vr - Reverse Voltage:50V; If - Forward Current: 1 A), 4,7K gate resistor and 10k bleed resistor. The 4.7K gatre resistor is connected between the Gate and Arduinos 5v?

Thanks

No, a 220ohm gate resistor is high enough value to protect the Arduino pin.
4k7 slows down switching.

220ohm would work for both a normal NPN transistor and a mosfet.

The person who posted that diagram with a 4k7 resistor probably didn't know what he/she was doing.
An average 5volt relay draws ~75mA. If you use a common NPN transistor, you need ~5mA base current for saturation. A 4k7 resistor is only 0.9mA base current.

The 10k resistor to ground is optional. It keeps the gate at ground level (off) during Arduino's bootup.
It can go from gate to ground, or from the Arduino output pin to ground.
Better from Arduino output pin to ground, because then it doesn't lower the gate drive voltage.
Leo..