Shop OBEX P1 Docs P2 Docs Learn Events
MOSFET help PLEASE! — Parallax Forums

MOSFET help PLEASE!

QuadrtrFlyrQuadrtrFlyr Posts: 73
edited 2013-04-06 20:57 in Propeller 1
Hello folks,

I am in dire need of your assistance, I need to power a load with a 9V battery while using the parallax propeller as a switch. So I am using an IRF510 N channel mosfet but am having difficulty switching the mosfet on with the parallax microcontroller I/O pin. My schematic is attached. Both battery ground and microcontroller ground are connected. I am not too sure about adding resistors but would probably need some from the I/O pin to the gate. I would very much appreciate the help since this is urgent. I also have a 2N3055 Transistor if that is any better.

Thank you,
Robert
Iu3cj.jpg
377 x 355 - 22K
«1

Comments

  • KC_RobKC_Rob Posts: 465
    edited 2013-04-06 15:08
    Hello folks,

    I am in dire need of your assistance, I need to power a load with a 9V battery while using the parallax propeller as a switch. So I am using an IRF510 N channel mosfet but am having difficulty switching the mosfet on with the parallax microcontroller I/O pin. My schematic is attached. Both battery ground and microcontroller ground are connected. I am not too sure about adding resistors but would probably need some from the I/O pin to the gate. I would very much appreciate the help since this is urgent. I also have a 2N3055 Transistor if that is any better.

    Thank you,
    Robert
    Iu3cj.jpg
    Make sure that you are indeed driving the gate with enough voltage to fully meet the VGSth requirements for that particular FET. Somewhat off-topic, but you might want to put a resistor in series from the gate to the I/O pin. That's a good idea, especially when driving inductive loads. (Also, a pulldown isn't a bad idea either.)
  • QuadrtrFlyrQuadrtrFlyr Posts: 73
    edited 2013-04-06 15:12
    Could you possible help me determine this gate voltage? On the specs sheet for the mosfet is states that VGSth = 2.0 to 4.0V so I believe 3.3V should work.. but it doesn't. and what sort of resistor should I use between the I/O pin and the gate, would 100ohms suffice?
  • RaymanRayman Posts: 14,665
    edited 2013-04-06 15:13
    Looks to me like 3.3V on the gate would just barely turn on the transistor...
    It wants about 10V to go to full on...

    Also, you should know that motors have a habit of inducing a lot of noise spikes on start and stop...

    So you should have the motor on a seperate power supply...
    Maybe you can use that transistor as a gate driver for the mosfet...
  • QuadrtrFlyrQuadrtrFlyr Posts: 73
    edited 2013-04-06 15:18
    10V full on! oh boy this is kind of over my head now. Can this be implemented with the parallax microcontroller since its I/O only gives 3.3V? I feel really bad asking you guys for this enormous help but this topic is way in over my head and I cannot figure it out no matter how much I try..

    Robert
  • KC_RobKC_Rob Posts: 465
    edited 2013-04-06 15:26
    Could you possible help me determine this gate voltage? On the specs sheet for the mosfet is states that VGSth = 2.0 to 4.0V so I believe 3.3V should work.. but it doesn't. and what sort of resistor should I use between the I/O pin and the gate, would 100ohms suffice?
    Then you're probably not hitting it with enough voltage to turn it on sufficiently. Pick another FET (with lower VGSth requirements), or drive the gate of that MOSFET with an open-collecter buffer that can switch a higher voltage.
  • KC_RobKC_Rob Posts: 465
    edited 2013-04-06 15:31
    10V full on! oh boy this is kind of over my head now. Can this be implemented with the parallax microcontroller since its I/O only gives 3.3V? I feel really bad asking you guys for this enormous help but this topic is way in over my head and I cannot figure it out no matter how much I try..

    Robert
    PS - They do make power MOSFETs with lower VGSth.
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2013-04-06 15:48
    Hi QuadrtrFlyr;

    The IRF510 is just not suitable for a 3V drive.

    The 2V to 4V spec is the threshold where it barely starts to turn on.

    A much better MOSFET is the IRF3708.
    Here is a graph of the performance I personally tested.
    MOSFET_IRF3708_Vgs.jpg


    This will fill the bill.

    You technically don't need a series resistor but 1K or so would be good.
    And a 100K or so from gate to ground will make sure it stays off if the pin goes to input, as it will after a reset.

    Duane J
    891 x 491 - 36K
  • garyggaryg Posts: 420
    edited 2013-04-06 15:49
    IRF 510 sounds like the one available at Radio Shack.
    I've tried using those and have not had good success.
    The problem I have with them, is that when driving something like an LED, The LED does not turn off correctly.
    I think that maybe the IRF 510 might not be suitable for your application.
  • QuadrtrFlyrQuadrtrFlyr Posts: 73
    edited 2013-04-06 15:54
    Thank you for the advice KC_Rob but sadly I need to complete this project tonight and cannot order a different part. I did purchase the IRF 510 from Radio Shack and just like you stated garyg, it is not the best mosfet to use (looked around the forums and found the same thing), especially since Duane just stated that 3V isn't a suitable voltage to drive the mosfet. So I guess enough with the IRF 510 and moving onward. Are there alternatives to the mosfet as a switch for a 9V battery (load draws ~20ma), maybe a common BJT? I could still swing by radioshack and buy something before it closes. Any input is very much appreciated! maybe a 2N3904 NPN transistor?
  • KC_RobKC_Rob Posts: 465
    edited 2013-04-06 15:59
    Thank you for the advice KC_Rob but sadly I need to complete this project tonight and cannot order a different part. I did purchase the IRF 510 from Radio Shack and just like you stated garyg, it is not the best mosfet to use (looked around the forums and found the same thing), especially since Duane just stated that 3V isn't a suitable voltage to drive the mosfet. So I guess enough with the IRF 510 and moving onward. Are there alternatives to the mosfet as a switch for a 9V battery (load draws ~20ma), maybe a common BJT? I could still swing by radioshack and buy something before it closes. Any input is very much appreciated!
    Use your BJT to drive the MOSFET, like so.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-04-06 16:03
    For many apps you don't need big big MOSFETs although you do need true 3.3V logic drive. This means that the MOSFET's Rds-on is at near it's lowest quoted channel resistance which will mean it will be operating closer to the desired "perfect switch". In turns this would mean that there would be very little power dissipated by the switch so that it would not need to be big or require cooling, in fact in should stay cool. For many motor and solenoid loads I just use tiny dual MOSFETs in SOIC8 run directly from the Prop but with at least a gate pull-down resistor and an optional series resistor in case of catastrophic failure resulting in the high supply being shunted onto the Prop pin so that at least it's current limited.
  • QuadrtrFlyrQuadrtrFlyr Posts: 73
    edited 2013-04-06 16:05
    Thank you KC_Rob. will my 2n3055 NPN transistor work? I also have 2N2222 and 2N4401 BJT's if those work. I will try it out now
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-04-06 16:06
    Thank you for the advice KC_Rob but sadly I need to complete this project tonight and cannot order a different part. I did purchase the IRF 510 from Radio Shack and just like you stated garyg, it is not the best mosfet to use (looked around the forums and found the same thing), especially since Duane just stated that 3V isn't a suitable voltage to drive the mosfet. So I guess enough with the IRF 510 and moving onward. Are there alternatives to the mosfet as a switch for a 9V battery (load draws ~20ma), maybe a common BJT? I could still swing by radioshack and buy something before it closes. Any input is very much appreciated! maybe a 2N3904 NPN transistor?

    Since you are powering the load with the most inefficient power source known to man, the common 9V battery, I can only conclude that it is a very light load so in which case just use the BJT to directly drive the load and forget about the MOSFET. You can even parallel the 3904 if that is all you have got.

    EDIT: The 2222 is a much better bjt for this app as it can handle up to 1A.

    Don't use the 3055, it's current gain is way too low for starters and the size of it is ridiculous. Anyway how much current could you possibly get from a 9V battery after all?
  • KC_RobKC_Rob Posts: 465
    edited 2013-04-06 16:08
    Thank you KC_Rob. will my 2n3055 NPN transistor work? I will try it out now
    Overkill nor ideal but it should work.
  • KC_RobKC_Rob Posts: 465
    edited 2013-04-06 16:10
    Don't you have a 2N3904/06 around?
  • QuadrtrFlyrQuadrtrFlyr Posts: 73
    edited 2013-04-06 16:11
    Yes correct, it is a very light load. What do you exactly mean by parallel the 3904?
  • QuadrtrFlyrQuadrtrFlyr Posts: 73
    edited 2013-04-06 16:14
    Yes, I do have a 2N3904 with me. I will try the circuit out with that BJT and IRF510 FET.

    Robert
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-04-06 16:16
    Yes correct, it is a very light load. What do you exactly mean by parallel the 3904?

    You mentioned you had 2N2222 which would be much better for this application so use them. If you need more current (or power handling) than one could handle (1A) then just use two or more in parallel except each base has it's own resistor (around 220R). Collector to Collector, Emitter to Emitter. Skip the MOSFET, just use the BJT, that is all the is necessary.
  • QuadrtrFlyrQuadrtrFlyr Posts: 73
    edited 2013-04-06 16:18
    Thank you Peter, I will try this also and report all results back to you guys VERY soon! I must say you guys are incredible, absolutely just turned my day around :smile:

    Regards,
    Robert
  • KC_RobKC_Rob Posts: 465
    edited 2013-04-06 16:32
    Thank you Peter, I will try this also and report all results back to you guys VERY soon! I must say you guys are incredible, absolutely just turned my day around :smile:

    Regards,
    Robert
    No problem. In the future you might consider a FET like the TN0610 [thru-hole eq., more parts here] for relatively small loads (VGSth max. 2V). I've used them for years. FETS are generally better for this sort of thing; you just pick the right one for the job. :)
  • QuadrtrFlyrQuadrtrFlyr Posts: 73
    edited 2013-04-06 16:41
    KC_Rob. It works beautifully!! I have found that when 3.3V is applied to the base of the BJT the load turns off and when 0V is applied to the base of the BJT then it turns back on! Is this correct??

    Robert
  • KC_RobKC_Rob Posts: 465
    edited 2013-04-06 16:43
    KC_Rob. It works beautifully!! I have found that when 3.3V is applied to the base of the BJT the load turns off and when 0V is applied to the base of the BJT then it turns back on! Is this correct??

    Robert
    Yes. If you want to swap the logic, just do the same thing but with a 3906.

    PS - That gets a bit more complicated, however.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2013-04-06 16:49
    Depending on the current required (anyone know?) by this "fan" "dc motor", I think that the NPN (2N2222) alone should do.
  • QuadrtrFlyrQuadrtrFlyr Posts: 73
    edited 2013-04-06 16:54
    Excellent, since I do not have a 3906 BJT with me now I will leave it as is. How much more complicated are we talking? At the moment, the BJT is drawing .34mA to keep the load from running which isn't too bad I guess. Once again, you were an incredible help KC_Rob, I honestly cannot thank you folks enough.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2013-04-06 16:57
    Excellent, since I do not have a 3906 BJT with me now I will leave it as is. How much more complicated are we talking? At the moment, the BJT is drawing .34mA to keep the load from running which isn't too bad I guess. Once again, you were an incredible help KC_Rob, I honestly cannot thank you folks enough.

    Try it with the NPN instead of the FET. With a 220ohm resistor between the Propeller pin and the base, emitter to Ground, and the motor between +V and collector. Then it'll be on with a HIGH out and off with a LOW out.
  • KC_RobKC_Rob Posts: 465
    edited 2013-04-06 16:58
    Excellent, since I do not have a 3906 BJT with me now I will leave it as is. How much more complicated are we talking? At the moment, the BJT is drawing .34mA to keep the load from running which isn't too bad I guess. Once again, you were an incredible help KC_Rob, I honestly cannot thank you folks enough.
    Yes, that's the problem with doing it that way in a battery-powered circuit. The FET is more efficient but you gave that up. As for how complicated the other way, it goes something like this. Again, FETs are generally better for this sort of thing, but you have to get the right one.
  • QuadrtrFlyrQuadrtrFlyr Posts: 73
    edited 2013-04-06 16:58
    KC_Rob wrote: »
    No problem. In the future you might consider a FET like the TN2510 for relatively small loads (VGSth max. 2V). I've used them for years. FETS are generally better for this sort of thing; you just pick the right one for the job. :)

    Definitely will do that in the future. Sadly, there isn't much of a mosfet selection for 1 day projects at RadioShack, i've learned my lesson for leaving things to the last minute..
  • QuadrtrFlyrQuadrtrFlyr Posts: 73
    edited 2013-04-06 17:01
    Yes, that's the problem with doing it that way in a battery-powered circuit. The FET is more efficient but you gave that up. As for how complicated the other way, it goes something like this. Again, FETs are generally better for this sort of thing, but you have to get the right one.

    That is quite a bit more complicated.. I guess choosing the right FET is the way to go.

    PJ Allen: I will try this right now also, and let you know the results! What are the benefits of the BJT/mosfet combo as opposed to just the 2N2222 ? It handle more current correct?

    Robert
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2013-04-06 17:04
    Here's a pic
    It shows 12V, but just see that as "9V".
    468 x 258 - 13K
  • KC_RobKC_Rob Posts: 465
    edited 2013-04-06 17:06
    I will try this right now also, and let you know the results! What are the benefits of the BJT/mosfet combo as opposed to just the 2N2222 ? It handle more current correct?

    Robert
    Well, if it were just a FET alone, or probably even with the BJT logic flipped, you'd have more efficient drive; ie, the FET is more like an ideal switch.
Sign In or Register to comment.