Electromagnet Troubleshooting


I am trying to build a driver circuit for an electromagnet to connect to my Arduino Uno. I have the output pin programmed to send a signal to the driver for a half second, every few seconds. However, my electromagnet gets very hot after only a few pulses. In addition, it seems that the power is not very strong- at most it can pull a metal tack from about a centimeter away.

Furthermore, I am trying to make sure I have an appropriate MOSFET/Shottky diode combination, though I am unsure how to calculate this, as I have read many other forums, and changed my MOSFET and Shottky values, but still have the same problem.

I have been struggling with this for some time and would really appreciate any advice on how to reduce the heat, and increase the power of the electromagnet.

Here are my specs (I have also attached images of my eagle files for reference):
1N4004 Rectifier Diode
1K Resistor (to protect the Arduino)
12V DC 3.33 Amp Power Supply
Magnet Wire: MW-35C/MW-73C wrapped around a standard metal sewing machine bobbin (bobbin is nearly full).

Thank you in advance to anyone who may have some insight!

"any advice on how to reduce the heat, and increase the power of the electromagnet."

Is that an oxymoron ? Maybe not.

You wound your own electromagnet? Did you have a project guid that you used to do that? A url?

To reduce the heat, add a cooling fan. To increase the power, reduce the inner diameter of the coil, and add more windings. Or buy an electromagnet that has specs.

Just a thought. What do you think.

A diode across the mosfet is wrong. It should go across the load/solenoid, anode to drain.

The diode is not a schottky diode, but a general purpose 1A diode. But a normal 1N4004 is perfect here.

Buy a proper 12volt solenoid, so that R2 is not needed. Choose a logic level mosfet. Add a 10k resistor from Arduino input to source/ground (safer when Arduino boots up). Change R1 to 220ohm (faster switching). Leo..

You will get a better magnet using a plastic former around an iron bolt. An air core on a metal bobbin does not make the best electromagnet (from my high school physics).


You need a proper magnetic circuit to have any power worth using in an electromagnet or solenoid - iron concentrates the field 1000 to 10000 times.

Thanks everyone. Still working through some issues. Files are attached for reference.

I switched the MOSFET so it is across the solenoid, anode to drain. I also changed the MOSFET to a logic-level 30V 1.7A.

I am using a 1N4004 diode.

I added a 10K resistor from the Arduino input to GND.

I changed R1 to 220 ohm.

The one thing I did not yet get is the store-bought solenoid (still using my own; I used this tutorial for general reference, though I built mine using a bobbin:http://education.jlab.org/qa/electromagnet.html). However, I did order one and it is on the way.

Just tested the circuit again and it seems that the solenoid overheats as soon as I plug in the power jack to the board (even without yet turning on the Arduino). I have googled several other electromagnet diagrams for reference, and as I am a beginner, I am not yet sure why this is happening.

I will keep everyone posted on my progress, but if anyone sees anything obviously wrong in the meantime, I would appreciate if you point it out!

If it heats up, there must be a current running through it.

Are you sure you've got the wiring of all parts correct ? Are you able to do some measurements (especially measure the current through the coil) ?

kzone: Just tested the circuit again and it seems that the solenoid overheats as soon as I plug in the power jack to the board (even without yet turning on the Arduino).

Mosfets are ESD devices. The gate-pin being the sensitive part. Always connect the gate last, and disconnect first. If the mosfet is already conducting without the Arduino being on, it could be toast if you haven't made a wiring mistake.

A 1.7A mosfet seems small for a solenoid. Post a link to the datasheet. Leo..

Data sheet for the MOSFET:

Cannot find a data sheet for the Solenoid, but specs are listed here on Amazon:

I tried re-configuring the circuit a bit- now it is not working at all. I have a feeling that I may have the right components, but perhaps some part of the wiring/traces is not connecting where it should be. Images of new board attached.

I could not take measurements on the last circuit, as it got so hot so quickly I did not want to start a fire.

Thanks again to everyone for the help. At least learning a lot through all my mistakes.

As said, mosfets are ESD sensitive devices. Easy to ruin when soldering with e.g. a non-ESD safe iron. Diagram and layout seems ok. Not sure if you should use a 1.7A mosfet for a 1A solenoid. 10- or 20Amp SMD mosfets are only slightly bigger. Are you sure you have used the right package for that 4004 diode. I would give the mosfet some copper on the source and/or drain for cooling. Maybe post your Eagle .brd and .sch files. Leo..

Thank you, Wawa and everyone. Was not familiar with the ESD safe concept, but just checked my soldering station and it is marked as "ESD Safe" (it is a Weller WES51).

I will look into getting some MOSFETS with a higher amperage.

I used a SMT pad for the Diode in the Eagle file, but actually soldered a thru-hole 1N4004 to the pads.

On a related note, I am trying to make sure I understand conceptually what is going on with this circuit; the role that each component plays:

The MOSFET allows the small dc voltage from the Arduino to switch a larger dc voltage (12V) to the solenoid. In other words, applying current to the Gate allows current to flow between the Drain and Source.

So the MOSFET is not only acting as a switch, but it is boosting the signal? And the flow between the drain and source is what closes the circuit?

It will not allow me to post Eagle files here... looking for another way to post them somewhere.

kzone: It will not allow me to post Eagle files here... looking for another way to post them somewhere.

Put the files in a zip/rar folder. I use "Peazip" (free). Leo..

The solenoid you bought is 12V 1A, so if you connect it directly across the 12V power supply, it should work.
Have you tried that?
Your PCB tracks are no where near wide enough to carry 1A.
When you connect your solenoid directly to the power supply, can you measure the power supply voltage to check that it stays at 12V?
Is the gnd of the arduino connected to the ground of the solenoid power supply?

Can you please post a copy of your sketch, using code tags?
They are made with the </> icon in the reply Menu.
See section 7 http://forum.arduino.cc/index.php/topic,148850.0.html

Tom… :slight_smile:

This will be clearer.

Tom… :slight_smile:

Zip file attached.

Archive.zip (10.3 KB)

And thank you, Tom, as well. I really appreciate the diagram. Testing some things now and working on a proper response to your posts.

THANK YOU EVERYONE!!! I figured it out. The last iteration of the board did actually work, after I made all the changes based on your feedback. Had a small bridge between two of the traces that I did not notice earlier. Cut it away with an x-acto and now it works, and the store-bought solenoid that is rated for 12V does not overheat. Thanks again!!!

Next time you'll remember to do a close visual inspection after building up a board - always worth it.