Go Down

Topic: MOSFET Trouble (Read 1 time) previous topic - next topic

Brandeaux

Jan 30, 2013, 03:14 am Last Edit: Jan 30, 2013, 03:18 am by Brandeaux Reason: 1
I am building a robotic arm for Science Olympiad at my high school and I really want to have an electromagnet on the end of the arm to pick up nails. I planned to program the Arduino to respond to the push of a momentary switch. This would tell the Arduino to send a HIGH signal to the gate of a MOSFET which would then allow the electromagnet to power itself from a different, stronger, power source, rather than the Arduino.

My problem is with the MOSFET transistor. It is NPN (I'm pretty sure...) and I have looked up the data sheet (http://pdf1.alldatasheet.com/datasheet-pdf/view/52980/FAIRCHILD/IRF630A.html) to be sure of the pinout. No matter what I try, I cannot get the supposed gate pin to effect the state of an LED (I am using this to make sure I have connected the MOSFET correctly). The LED stays HIGH. I have even tried reversing the transistor in case the data sheet or my understanding of it was incorrect. I cannot figure out what to do. I will attach several pictures including what I believe I have hooked up in a schematic, as well as two shots of the setup. please bear with me in the way that I know I only have one power source in use here. The original was in a crowded breadboard, so I quickly mocked up everything on a clear(ish) one to make it easier to see. In reality, I want the Source and Drain pins to be connected to a 7.4 volt Lipo battery.

And yes I know the pictures show nothing hooked up to the third pin. That would be connected to the positive of the battery.

I spent quite a time trying to get this to work. I am so frustrated right now that anything you can tell me would be much appreciated.

I couldn't get my photos to work right so here are the links to them.
http://www.flickr.com/photos/brandondub/8428913456/in/photostream
http://www.flickr.com/photos/brandondub/8427821511/in/photostream
http://www.flickr.com/photos/brandondub/8427822445/in/photostream

retrolefty

#1
Jan 30, 2013, 03:34 am Last Edit: Jan 30, 2013, 03:36 am by retrolefty Reason: 1
OK, first the terms NPN and PNP are used in reference to bipolar junction transistors (BJT) not terms used with MOSFET transistors, which are said to be either P-channel or N-channel mosfet transistors. The most commonly used type in applications like you wish to use is a N-channel as a 'low side' switch. The positive voltage source would wired to the load, electromagnet in your case, the other side of the magnet to the mosfet drain terminal and the source terminal back to the negative terminal of the voltage source. There also needs to be wire from the negative power terminal to a arduino ground pin. Then finally a wire from a arduino output pin through a low ohm series resistor to the gate terminal of the mosfet, 200-330 ohms should be fine.

Now what could be causing you your problems. The wiring of course has to be correct which I've tried to outline above. Second and just as important is the specific MOSFET you are trying to use. It's not what is called a 'logic' level mosfet, but rather a standard one that can't be fully turned on to it's lowest possible resistance (Ron value) unless you have at least +10vdc across it's gate/source terminals, and as a arduino can only go to a maximum of +5vdc, your mosfet can't fully turn on. So you really should get a proper mosfet for use with an arduino. You also need to know how much current the magnet draws at the voltage you are powering it with. If that data is not available to you, you should measure the current draw with a meter with the magnet simply wired across the power supply terminals. Once you know that value you are in a better position to select a properly rated 'logic' level N-channel power MOSFET for your project.

That help?

Edit: By the way the drawing in one of your linked photos is completely wrong and see if you can redraw it using the wiring directions I gave above. If you can't first draw it correctly, you aren't in a position to wire it correctly.  ;)

Lefty

Brandeaux

Lefty: Thank you for correcting me on my use of "NPN." I'm about 2-3 months into electronics and almost a month into Arduino. I clearly have a lot to learn. There are no electronics classes at my high school so I'm doing everything on my own. It's really cool to show successful projects to my teachers because they are in awe, but it's a huge pain in the ass when I need help because no one there knows enough to help me out.  :smiley-roll:

As far as my schematic goes, is this correct? http://www.flickr.com/photos/brandondub/8428978072/in/photostream

Also, probably an idiotic question: I don't need a pull down resistor on the gate here because the Arduino will write LOW when told so, but if I was just using an SPST switch it would need an in-circuit pulldown, correct?


retrolefty


Lefty: Thank you for correcting me on my use of "NPN." I'm about 2-3 months into electronics and almost a month into Arduino. I clearly have a lot to learn. There are no electronics classes at my high school so I'm doing everything on my own. It's really cool to show successful projects to my teachers because they are in awe, but it's a huge pain in the ass when I need help because no one there knows enough to help me out.  :smiley-roll:

As far as my schematic goes, is this correct? http://www.flickr.com/photos/brandondub/8428978072/in/photostream

Your drawing is correct, except for forgetting about the all important ground wire from an arduino ground pin to the negative terminal of the battery.

Also, probably an idiotic question: I don't need a pull down resistor on the gate here because the Arduino will write LOW when told so, but if I was just using an SPST switch it would need an in-circuit pulldown, correct?

Not a idiotic question at all, but rather an insightful one. Yes a 10K ohm resistor wired directly across the source and gate terminals would insure the mosfet turns off when there is no signal going to the gate terminal. Some people advise to wire that in even when using an arduino in that there might be a case where your arduino is powered off but the battery is still available to power the magnet and without an active low coming from the now unpowered arduino the mosfet may not stop conducting.

Have you dealt with how much current your magnet draws when being powered via the battery?



Brandeaux

#4
Jan 30, 2013, 04:20 am Last Edit: Jan 30, 2013, 05:54 pm by Brandeaux Reason: 1
On my board all of the ground buses are connected and I use separate buses for different voltages, so I'm (generally) automatically good on the grounds being connected. (I am powering other things directly from the Arduino so the ground is already present on the breadboard.)

Would a TIP120 work with the 5V from the Arduino?

To be honest, I don't have the electromagnet in my hands because I have yet to make it. I am going to try and wind magnet wire around the core of an AC induction motor out of a microwave, which I should get tomorrow. I was playing with a "test" electromagnet today though, and off of a 9 volt it drew 1.2ish Amps. So...I'm hoping I can play with these numbers a little and say that 9V/1.2A = 7.5? in the system. Provided that is correct, 7.2V/7.5? = 0.96A. I also would like to believe that making the actual electromagnet will require more wire than the beefy nail I made today, so the resistance will be higher, and thus the current lower.

I realize that these numbers are pretty low... If you don't mind me bouncing another idea off of you: What if I wired 2-3 9 volts in parallel to give this a little extra current capacity, put some resistors in parallel with the electromagnet to reduce resistance, thus causing more of a draw on current? Do you think this would be viable for a short period of time? I really only need this to work for about 15 minutes tops.

Also, this just came to mind: Because an electromagnet builds up an inductive field, should I be putting a diode backwards across the inputs of the electromagnet to protect the transistor from the potential voltage spike when it is turned off?

Go Up