Go Down

Topic: Triggering electromagnets (Read 1 time) previous topic - next topic

Andy J W


I am thinking of using the arduino to switch on a series of electromagnets.  These magnets would pull on a permanent magnet that is allowed to pivot in response to the change in magnetic field.  My diagram only has 3 coils but in the finished project I think there will be about 8 coils.

I haven't really done anything beyond the blinking LED sketches.  This would by my first application of both the sketch and electronics in general.

The premise of the circuit is to have a dedicated capacitor and transistor for each coil.  When I want to turn the coil on I will do a digitalwrite to a pin on the arduino that is wired to the base on the transistor.  This should "complete" the circuit, draining the capacitor through the coil causing a magnetic field.  The permanent magnet would then swivel toward the coil.  Right now the power source would be either the 5V power that would be shared with the arduino or a seperate 9V battery.  (IIRC there needs to be additional circuitry if I want to use the 9V battery)

My questions are as follows:

1) Does this sound like I am on the right track in my thought process/design?

2) Should there be any diodes in the circuit?  I am wondering if the magnet is moved near the coil if it will create an EMF that could blow out any of the components in the circuit.  Possibly put it between the coil and the transistor.

3) Do I need to put any resistors after the capacitors to prevent too large of a current flowing through the transistor and coil too quickly?  I am looking to have the reaction speed be fairly quick (<.5s).  The intention is that these electromagnets would be turning on and off faster than a human could notice.

4) Am I missing anything else?

Thank you for your advice and time.



The placement of the capacitors is odd, are you using them to limit current?

I think most of your questions would be answered by a howto on building a coil gun.


2) Should there be any diodes in the circuit?  I am wondering if the magnet is moved near the coil if it will create an EMF that could blow out any of the components in the circuit.  Possibly put it between the coil and the transistor.

Absolutely a diode is needed - the EMF will come when the transistor switches off - dI/dt = V/L.  Moving a magnet near the coil won't be nearly as fast as transistor turn-off.

The diode needs to be parallel to the coil, see http://www.arduino.cc/playground/Learning/SolenoidTutorial
[ I won't respond to messages, use the forum please ]


Do a board search for MOSFET for transistor setups.
Google forum search: Use Google Advanced Search and use Http://forum.arduino.cc/index in the "site or domain:" box.


And yes the capacitors are in the wrong place, they will charge up on first use and prevent any more current flowing.
[ I won't respond to messages, use the forum please ]


This should "complete" the circuit, draining the capacitor through the coil causing a magnetic field.

Apart for the fact that your circuit wouldn't do that, why do you want to do that. At best it would turn the coil into a magnet for only a short time. Do you not want the coil to be a permanent magnet when the arduino controls it to be?

Andy J W

Hello all,

Thank you for your comments.  I think they got me headed in the right direction.  After looking up the topics you all suggested here is what I have come up with.

This is only the circuitry required to trigger one coil.  I would need to build one of these for each coil I want to use.

My thoughts are: (I am listing these so that you can tell me where I am right or wrong.)

C1 is charged by the voltage from my power source.  This charge is released through L1 when a voltage is applied to the gate on T1.

R1 is used to control the rate C1 charges.  I want C1 to charge very quickly...so I might not need it.

R2 is used to control the rate C2 discharges.  Thereby allowing me to control the amount of time the magnet is on and hopefully not burn up the coil.  For my test article I may use a variable resistor to tune the discharge time.

D1 is there to control EMF from the permanent magnet that will be moving near the coil.  When the magnet moves near the coil it induces an EMF and the diode allows the current to flow to the other side of the coil.  During operation D1 prevents current from flowing "back" through thereby forcing the current through the coil creating a magnetic field.  (Am I understanding this correctly?)

T1 is a mosfet (as suggested by zoomkat).  In the example I looked at, the transistor had a zener diode it it,hence Z1.  I will need to look at the specs of the transistor and determine if one is built in.  I am assuming that it is there to allow any undesigned large currents to flow through the diode instead of through the transistor..?

Does that look more reasonable?  Any other thoughts?

Thank you again.



This looks very reasonable and almost identical to the internals of an intrinsically safe solenoid valve's coil where a low input current (controlled by R1) is used to charge a capacitor which is then used to provide a "pulse" of current to operate the coil.

The inductance of your coil will limit the instantaneous current from the capacitor so you will probably find that R2 isn't needed.  In any case R2 reduces the efficiency of the circuit.

R1 is set to limit the current to the coil when the mosfet is turned on and the capacitor is discharged (to the steady state voltage across the coil)  Once you determine a value for R1 you can then calculate a value for C which will be large enough to operate the coil but low enough to give a recharge time suitable for your trigger rate.  The values of R1 and C are a balanced compromise between current limit and recharge time.

The diode D1 is best described as a transient suppressor and simply eliminates reverse polarity voltages getting to the mosfet and the arduino.  



The problem with that circuit is that if R1 is small or not in place then there is no point in having C1 because the power will be supplied straight through R2.
That circuit will only work if you power supply has a limited current output, not enough to supply full current to the power supply. If that is the case then by definition you can't have a fast charge time. In short your charge time can't be shorter than the discharge time because if it is then there is no point in having it.

I think you need to fundamentally re think what you are trying to do. These sorts of capacitor discharge circuits are typically use with photographic flash lights, where the supply is an inverter of limited current capability.
Do some maths and see how big the capacitor has to be to provide a current to the coil for the time you want. You will find out is it probably an unfeasibley large one.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131