Arduino Board to drive a series of Electromagnets

Thread Starter

mikeysela

Joined Jul 24, 2010
87
Hello people,

I would like to use an Arduino micrcontroller and its 6 PWM digital output pins to deliver current to a series of electromagnets. From the Arudino specs, I can only output max 50mA current from the pins (obviously not much more than that). How can I amplify the current coming out of each of these pins to provide enough rated current to my electromagnets?

Thank you kindly,

M
 

retched

Joined Dec 5, 2009
5,207
This is a job for Transistors.

What you need is a "driver".

Depending on the current you are looking at using, there are a myriad of selections.

One good option for this type of driver is a Logic Level MOSFET.

The arduino speaks "Logic Levels". The MOSFET can be switched on and off with a arduino PWM pin to use current from the power supply instead of the arduino.

This way you are only limited by the MOSFETs current specs, not the arduinos.

However it all comes down to how much current each magnet draws. How much current DOES each magnet draw?
 

Thread Starter

mikeysela

Joined Jul 24, 2010
87
This is a job for Transistors.

What you need is a "driver".

Depending on the current you are looking at using, there are a myriad of selections.

One good option for this type of driver is a Logic Level MOSFET.

The arduino speaks "Logic Levels". The MOSFET can be switched on and off with a arduino PWM pin to use current from the power supply instead of the arduino.

This way you are only limited by the MOSFETs current specs, not the arduinos.

However it all comes down to how much current each magnet draws. How much current DOES each magnet draw?
Thanks for the reply retched.

I will find out the current ratings of the magnets soon. In the mean time, just to clarify something, How would I use the PWM outputs for this? Do i just program the duty cycle of the outputs to the desired voltage ratings of these
magnets? From what I understand about what you said, I would just use the PWM outputs to ensure I have a logic level 1 for the mosfet, and then it can use the current form the power supply. How do I control the exact amount of current to my magnet then? Would not the PWM outputs themselves give me that control over the current levels?

Thanks very much again.

M
 

mik3

Joined Feb 4, 2008
4,843
This way you are only limited by the MOSFETs current specs, not the arduinos.
The arduino's maximum output current limits the maximum switching frequency if the MOSFET is driven directly by the arduino's output.

fmax=Iomax/Qg

fmax=maximum switching frequency (Hz)
Iomax=maximum output current of arduino's (A)
Qg=MOSFET total gate charge (C)
 

retched

Joined Dec 5, 2009
5,207
mikey, I think you may be confused.

Do you know what PWM is used for?

What is the reason you want to use it for your magnets?

There may be better ways to do what you want. What EXACTLY are you trying to do?
 

beenthere

Joined Apr 20, 2004
15,819
I will find out the current ratings of the magnets soon. In the mean time, just to clarify something, How would I use the PWM outputs for this?
If the magnets are only on/off, then all that is necessary is a driver that can supply the necessary current at whatever voltage the magnets use. Some inexpensive FET may be all you require.
 

retched

Joined Dec 5, 2009
5,207
The arduino's maximum output current limits the maximum switching frequency if the MOSFET is driven directly by the arduino's output.

fmax=Iomax/Qg

fmax=maximum switching frequency (Hz)
Iomax=maximum output current of arduino's (A)
Qg=MOSFET total gate charge (C)
True. I should have went more in depth.

A MOSFET driver in addition to the arduino would be needed to maximize the potential of the MOSFET.

Without knowing the requirements of the project, and the magnets specs, we cant design a driver circuit for them.
 

mik3

Joined Feb 4, 2008
4,843
If you want a current, which is always constant, through the magnet use a resistor in series with the magnet coil. However, this is not very efficient. If you want to vary the current while the magnet is operating then use PWM.
 

Thread Starter

mikeysela

Joined Jul 24, 2010
87
OK, let me be more clear , my apologies guys. I want to explore 2 options:
1. Supplying CONSTANT current to a series of magnets at the rated current and voltages of these magnets from the output pins of an Arduino board. This action and the time it takes place will occur depending on a program written in the arudino software.
2. Supplying a VARYING Current at specific time instants which I will control through software as well.

Questions about this:
1. Is it possible to deliver varying levels of current to a magnet in order to control the intensity of the magnetic field it is producing?

Basically, the idea of the project is that I would like to place a series of magnets on a surface, and depending on the amount of current and which magnets will receive that current at any instant of time, will determine the force exerted by the pad onto a device sitting on top of it.
 

mik3

Joined Feb 4, 2008
4,843
Then use MOSFETs to control the magnets and PWM from the Arduino to control the current through the magnet's coil. You will need a means of current feedback as to control the current accurately.
 

Thread Starter

mikeysela

Joined Jul 24, 2010
87
Then use MOSFETs to control the magnets and PWM from the Arduino to control the current through the magnet's coil. You will need a means of current feedback as to control the current accurately.
Can you be a little more specific about that? Maybe a diagram ? thanks very much
 

Potato Pudding

Joined Jun 11, 2010
688
You will need a reverse bias Schottky Diode across the coil - aka a snubber.

PWM with an inductor works to allow an average current to flow.

During the on phase the current builds a magnetic field.

During the off phase, the magnetic field collapses while the inductor conducts through the snubber.

Without the snubber the coil would raise up a high voltage of CEMF.

If you understood all of this already then that is fine, but I thought I might as well make certain that you were aware.
 

Thread Starter

mikeysela

Joined Jul 24, 2010
87
This is the kind of projest I expected you might be doing.

Magnetic feedback levitators
Not quite i do not think. What I am trying to do is place a series of electromagnets on a mouse pad, and be able to use force feedback onto a users hand as he is using the mouse using the magnetic fields produced when i drive the magnets with currents. Any suggestions on the best method of doing this?
 

mik3

Joined Feb 4, 2008
4,843
Then you don't really need a current feedback since accuracy is not very important. It is important to be able to change the vibration power, thus you need to use PWM to do this. You will need to generate a high frequency PWM signal which will be modulated by a lower frequency square wave (vibration frequency).
 

Thread Starter

mikeysela

Joined Jul 24, 2010
87
Then you don't really need a current feedback since accuracy is not very important. It is important to be able to change the vibration power, thus you need to use PWM to do this. You will need to generate a high frequency PWM signal which will be modulated by a lower frequency square wave (vibration frequency).

Can I achieve this with the outputs from the Arduino board? I am not sure how what you mean, since I know I can just change the frequency of the PWM signal to change the average voltage of if it.

Thank you.
 

hgmjr

Joined Jan 28, 2005
9,027
There should be no problem using the 6 PWM outputs to drive your electromagnets. You will need however to put a MOSFET or BJT between the output of the Arduino and the electromagnet to achieve the drive level needed.

hgmjr
 
Top