Shop OBEX P1 Docs P2 Docs Learn Events
OnOffSwitch with mosfet — Parallax Forums

OnOffSwitch with mosfet

DANuiucDANuiuc Posts: 4
edited 2010-12-04 05:29 in General Discussion
Hello,

I need to control a motor (just on off) one direction and I was thinking I could do it with a mosfet or transistor. I am specifically looking into controlling it with ONE mosfet. Is this possible? Basically send a high signal to the gate of the mosfet and it will allow current to flow through the mosfet allowing the motor to spin. The motor voltage is 5v and I am using the basic stamp to control the mosfet. Any help would be appreciated.

Thank you

Danuiuc

Comments

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2010-12-03 02:24
    The short answer is "Yes, you can"

    The long answer requires a bit of reality. What voltage is the motor to be powered at? You said 5 Volts.
    How many amps do you intend to provide to it? still unknown
    And which micro-controller are you planning to use? Propeller is 3.3 volts while the BasicStamp is 5.0 volts output. You said the BasicStamp

    The 2N7000 Mosfet is often selected for hundreds of milliamps output, while the 2n2222 transistor is chosen for similar reasons.
    But MOSfets generally prefer more than 3.3 volts to be fully switched on. The Propeller can work with them, but may need some careful engineering.

    Using the MOSfet might be best as the motor will be powered at 5 volts. The transistor isn't a bad choice either, just not as good.
    You really would do even better to have the motor powered at 9 volts or 12 volts, but I suppose you are thinking one and only one power supply voltage.

    If you used a transistor, you would suffer from wasted power due to a 0.7volt drop inside the transistor. So the higher voltage improved motor output.
  • DANuiucDANuiuc Posts: 4
    edited 2010-12-03 05:35
    How many amps do you intend to provide to it? Definately less than 1 amp, so at max 1.

    The 2N7000 Mosfet is often selected for hundreds of milliamps output, while the 2n2222 transistor is chosen for similar reasons.

    Interesting, so I'm trying to be as simplistic as possible, would one 2n7000 mosfet transistor drive a load (in this case a motor) with an external power supply for the motor (5v)? I feel like i'm being too much of a hassle but could you draw me out a schematic that would work in my situation.. (one pin to control and switch off/on the motor powered by the external battery)

    Appreciate it,

    Regards

    Danuiuc
  • DANuiucDANuiuc Posts: 4
    edited 2010-12-03 08:37
    Disregard my last post, so i purchases an IRF520 n channel fet and have the drain wired up to the ground of the battery and basicstamp, the source wired up to one end of the motor which is connected to the positive side of the battery, and the gate wired up to pin 11 of the basic stamp. However, even when the gate is not connected or recieveing a high signal, the motor spins... i tried sending the gate a low signal to stop the spinning but that didn't help. Any suggestions?
  • DANuiucDANuiuc Posts: 4
    edited 2010-12-03 09:21
    Figured it out! the source goes to negative of battery
    :)

    Danuiuc
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2010-12-04 05:29
    That IRF520 is a good choice for the kind of power you want.
    You really need to have some idea of how many amps the motor requires in order to size a transistor or MOSfet.

    But be very careful to get the polarity right. Since their is an internal diode that protects the MOSfet from voltage spikes generated by motors , accidentally installed a reverse in polarity can burn up the MOSfet's internal diode and maybe the whole thing. At least that happened to me with a 2N7000.
Sign In or Register to comment.