Electronic – Arduino – Controlling Electromagnets/Solenoids

arduinosolenoid

I'm a French student and today I have to control some magnetic things with an Arduino.
It seems to be electromagnets, but I'm not sure, since I'm a complete novice to electronics.

I saw some StackExchange answers that helped me a bit, but I can't really figure what to do exactly without frying my Arduino.

The datasheet of the magnetic thing is here.

Wired to a AA battery, it worked, and I don't need much more power, so I think that the Arduino could power it, nope?

Do I have to make a montage like this, or can I make a more simple one? If you do need precisions.

Best Answer

Here's the detail of the solenoid you linked: -

enter image description here

It appears to need 6V and with a resistance of 32.7 ohms will take a current of 183 mA.

Wired to a AA battery, it worked, and I don't need much more power, so I think that the Arduino could power it, nope ?

You were lucky to make it work from what I believe you are saying is a 1.5 volt AA battery. You need to provide it with 6 volts and to do this I'd use a logic-level n channel MOSFET. Off-hand I can't remember what GPIO pins produce on an arduino but assuming it is 5V, connect the GPIO pin to the gate of the MOSFET, the source connects to 0V and the drain connects to the solenoid and the other side of the solenoid connects to a 6 volt supply. You'll also need a protection diode across the solenoid to prevent back-emfs frying the MOSFET and potentially frying the arduino's output pin to the MOSFET's gate.

enter image description here

Maybe try a BSS138BKW MOSFET it can supply over 300 mA, is rated at 60V and has an on-resistance of typically 1 ohm.