1

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.

Uinelj
  • 13
  • 3

1 Answers1

1

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.

Andy aka
  • 434,556
  • 28
  • 351
  • 777
  • Thank you for your fast answer. About the MOSFET, I have this : [C1815](http://pdf.datasheetcatalog.net/datasheet/unisonic/UTC2SC1815.pdf). That should do it. About the supply and the GND, I wire this to Arduino's pins ? – Uinelj May 28 '14 at 09:32
  • The "supply" should be 6V - if you haven't got a 6 volt supply then maybe it might work at 5 volts but the extra current "stolen" from the arduino's power supply may cause problems to the arduino as will possibly the glitching on the 5 volt supply when the solenoid is turned on and off. The C1815 is unsuitable for use - it is a BJT with maximum current capability 150mA - don't use it, don't even think about using it. – Andy aka May 28 '14 at 10:13
  • I would recommend to use a separate power supply for the solenoid and use something like an analog switch IC to switch the solenoid using your arduino. – Handoko May 28 '14 at 10:58
  • @Handoko I appreciate you chipping in but maybe you can give your reasons for recommending a separate supply (if they are different to the ones I list) and because analogue switches are normally not suitable for this type of application, it would be useful to state which ones are suitable - most would fry and the OP may not appreciate that (but a few would be OK). – Andy aka May 28 '14 at 11:02
  • Do I really need an external power supply for a thing a 1,5V AA battery can supply ? :( I asked other transistors and I now have [2N222A](http://www.slideshare.net/Microtechsolutions/2-n2222-30176175) in my hands. Does this work ? Sorry for these newbie questions, but I don't even understand what a transistor is. – Uinelj May 28 '14 at 12:41
  • The spec you linked for the solenoid (picture in my answer) shows 6V for the solenoid. It will work at a lower voltage but I can't tell you how low it will reliably work. At lower voltages it will have significantly less pushing force so only you can try this out. For instance at 1.5 volts the current is 25% and the force it generates will be 1/16 of the force at 6V. A MOSFET is the preferred device because it will hardly "drop" any voltage when powering the solenoid. Not so for a 2N2222a or the C1815 (these are BJT transistors). You can try the 2N2222 but put a 100 ohm in the base lead. – Andy aka May 28 '14 at 12:55
  • I am also working with solenoids but without Arduino. I would suggest the following link, its a good read: http://electronicdesign.com/analog/what-s-all-solenoid-driver-stuff-anyhow – sheetansh May 28 '14 at 13:38