Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

PWM for my electromagnet? I need help!

  1. Jun 22, 2013 #1
    Hi, I need help with my electro magnet pulse with modulation PWM. I have a Velleman® IR Light Barrier Kit from Radio Shack and this kit is ment to turn on and off a 9V buzzer. But instead of soldering in the buzzer I tried to hook it up to a MOSFET transistor NTE2984 so that I could use it with my 12V 3.6A battery to turn on/off my electro magnet. When I get it all hooked up it burns out my transistor every time. And the reason why I cant just use a solenoid is because I need this to PWM for a few thousand times an hour and no 9V solenoid that I know of can hold up to that much use. Do you think that Im inductively spiking my MOSFET? Should I use a flyback diode? Is my transistor choice good enough? How would you use a 12V 3.6A battery to get signals from a passive IR switch like my 9V IR Light Barrier Kit? Is there something that I can do with an Arduino Uno. Basically If you have any idea I would be very happy to know how you think I should approach this PWM problem.
  2. jcsd
  3. Jun 25, 2013 #2
    MOSFET and electromagnet


    Without seeing schematics of exactly what you have done it's hard to be sure but you are almost certainly doing two bad things to the transistor - when you switch it on it is sinking more current than it can handle and when you switch it off a whopping great back emf from the collapsing magnetic field is sending charge racing backwards through it.

    So I would recommend a current limiting resistor between Vcc and the transistor and a Zener diode between the tranny and the magnet connecting to ground, again via a sensible sized resistor. Remember to get the Zener pointing the right way.

    Check the data sheet for the transistor and use Ohm's Law to work out the values of the current limiting resistors. I know the MOSFET can sink a big current for a long time, but it won't take kindly to huge spikes.
    Last edited: Jun 25, 2013
  4. Jun 25, 2013 #3
    Definitely need a diode across the coil for back EMF protection. Not usually a zener, just something like a 1N4004. See here:


    The MOSFET you spec'ed is rated 17A at 60V so should handle the current with a proper heatsink. (68 amp pulsed.) Make sure you're not overdriving the gate and that it's wired correctly. Also that your magnet has sufficient windings to limit current to an appropriate value. A battery can provide a very high current in a short circuit condition, even though it might be rated 3.6 amp/hour. 50 amps plus is easily possible if you don't have enough wire or the wire gauge is too heavy in your coil. Check it with an ammeter in series with the coil hooked straight to the battery without the rest of the circuit in play...

    Also, I looked at the schematic for the receiver you mentioned--from what I see you can't just remove the buzzer and put a MOSFET in its place. That seems like it would have the MOSFET in the ON state all the time, only turning OFF when the original output LED and transistor turns on, triggering the original buzzer. Needs to be a bit of a modification to the circuit.
    Last edited: Jun 25, 2013
  5. Jun 26, 2013 #4
    Several notes:

    1. For PWM it is better to drive gate not via resistor but with special MOSFET buffer IC ( low impedance, high speed, high current driver). This way you reduce transition time between on/off stete and power dissipation.
    2. The diode is a must. It should be rated for high enough current and be fast to avoid voltage spike. For this low voltage some few Amp Schottky should be good.
    3.The electromagnet likely will have strong eddy currents in the core thus wasting PWM energy and causing excessive currents in transistor. One should consider adding few tens uH , several Amps ferrite inductor in series.
    4. The PWM frequency should be carefully selected, likely should be 10 Khz or so.
  6. Jun 26, 2013 #5
    Thanks for the help guys, you clearly know more then I do and it is very helpful to learn from you all.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook