How to turn on electromagnet with Arduino Uno?

Hey everyone. I'm new with Arduino and I'm excited to start building. I'm in a competition called Science Olympiad and I'm building a Rube Goldberg machine. I would like to implement an Arduino One to activate a electromagnet that I made. To my understanding, the Arduino can only supply up to 500 mA, which is obviously not sufficient for an electromagnet. I understand that I would have to use two power supplies, one for the Arduino and one for the electromagnet, but I am not sure how to set this up. I don't know much about relays, but from some quick searches, it seems like I could use an Arduino to switch on the relay, which would turn on the electromagnet circuit. If you have information or other ideas, please let me know! I appreciate your help, and thank you.

tarembrandt:
Hey everyone. I'm new with Arduino and I'm excited to start building. I'm in a competition called Science Olympiad and I'm building a Rube Goldberg machine. I would like to implement an Arduino One to activate a electromagnet that I made. To my understanding, the Arduino can only supply up to 500 mA, which is obviously not sufficient for an electromagnet. I understand that I would have to use two power supplies, one for the Arduino and one for the electromagnet, but I am not sure how to set this up. I don't know much about relays, but from some quick searches, it seems like I could use an Arduino to switch on the relay, which would turn on the electromagnet circuit. If you have information or other ideas, please let me know! I appreciate your help, and thank you.

First the Arduino can supply nowhere near 500ma. You might quickly get 50ma from a single pin, but not for long. They are made for controlling voltage, not supplying current.

Second, when you tested the electromagnet, how much current did it draw and what voltage did you use? How long did you leave it connected? Did it get hot?

What power supplies do you have available?

What Arduino program do you have to control a relay? What relay?

Paul

A relay is just an additional smaller electromagnet (most common electromagnetic type). If anything, you should buy a module, not a bare relay.

Is your 'electromagnet' something you threw together yourself, wrapping wire around a nail or something?

I do not have any relays yet or any other devices besides the Arduino one and the homemade magnet, which consists of a magnet wire wrapped around the coil. I have yet to test the current, but I used a 9V rechargeable NiMH.

Yeah, so your homemade electromagnet is a straight up short circuit which is only limited by the battery's own internal resistance, which is just fine for very short experimental demonstrations in grade school. But it will get too hot to touch quickly.

It's best if you keep that battery and homemade electromagnet all alone and use a mechanical relay to interrupt its circuit.

The thing is, though, a relay is literally just another electromagnet so you're back to square one in terms of needing an adequate circuit that is safe against inductive load and is supplied sufficient current.

What exactly is your homemade electromagnet doing? Picking up objects? Moving a switch?

Introducing a microcontroller (Arduino) will detract from the project more than it will add. While there isn't really a point to RG contraptions, I'd say a defining quality is being able to see what's happening. Throwing what's basically a black box that has control aspects to it into the mix is missing the point.

It really shouldn't be that hard for you to close the electromagnetic circuit via some mechanism that just touches two wires or brings a wire into contact with the battery. No Arduino needed.

The electromagnet will be lifting up a lightweight class 1 lever a couple mm. At one side there will be a permanent magnet, on the other side, the fulcrum and a small load. I will have a string suspending the lever at a position such that the friction between load and lever is nearly that of the gravity on the load. I want to use the electromagnet to lift the lever a few mm past this position so that gravity will overcome friction and the load will slide off.

Look on Ebay for a 5v 1 channel Arduino opto relay.
They use an opto isolator driven off your Arduino pin so current is low similar to an LED .
You may have to select the voltage you wish to run the relay unit and your magnet from. Cost about Aus$1.00

Hello everyone, thanks for your advice and recommendations. I decided to purchase a 5v relay module for Arduino (Amazon.com ). I decided to use a 6v lantern battery instead of a 9v because it can supply more current to the electromagnet. I will have the electromagnet and arduinos on different power supplies, both will be connected to the relay, and the relay will be activated by some other device connected to the Arduino (LDR or thermistor).

Also, INTP, I would activate the electromagnet using a simpler mechanical way, but I already designed my project to comply with the attached rules. I have all the electronic steps in a specific order and have began designing apparatus for them, so I am going to stick with this Arduino way.