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

MOSFET vs Optocoupler

  1. Sep 26, 2010 #1
    Hi all, I have a couple scenarios, and need to decide on which component best suits my need:

    I have two solenoids that I need to drive with 12V, based on a 5V uC signal. Simple on/off switch. I'm very new to using MOSFETs, so I'm not sure if you can drive 12V with a 5V signal (which would have a Vbe ~ 6.5V in a BJT, and would blow it up). Do I need a relay/optocoupler here, or will a Power MOSFET be able to handle it? max 1A, 12V.

    Also, I have a PWM signal that is potentially noisy, anywhere between 15-250Hz. I'm pretty sure an optocoupler would be most appropriate here? How would a MOSFET compare?
  2. jcsd
  3. Sep 26, 2010 #2


    User Avatar
    Science Advisor

    You can develop base current from 5 volts (by putting a suitable resistor in series) and this will be able to turn on a transistor which can then switch your solenoid.

    If drive current was limited, you could use a two stage amplifier like this:

    [PLAIN]http://dl.dropbox.com/u/4222062/Solenoid%20control.JPG [Broken]

    What would you be using the PWM for? Solenoids need to be on or off, but not half way on or off.
    Last edited by a moderator: May 4, 2017
  4. Sep 27, 2010 #3
    I'm not sure I entirely understand. What's the collector and emitter voltages on the NPN transistor, and the base voltage on the PNP?

    The PWM signal is something separate from the solenoids. It's an RPM signal that I need to count pulses from, in a noisy car environment.
  5. Sep 27, 2010 #4


    User Avatar
    Science Advisor

    I have modified the diagram above to include the voltages. These are from a simulation.

    The NPN transistor controls the base current of the PNP transistor.

    This is so that the control current from the computer can be small.
  6. Sep 27, 2010 #5
    Ok, I see. So you have a large voltage drop across the 470 ohm resistor (it's in series after all :P), which gives you a Vbe of only .6V, which is normal. The base current of the PNP is a function of the base current on the NPN, the gain, and the size of the resistor on the NPN collector/PNP Base, right?

    So you've proven to me that a circuit can be relatively easily created with BJT's, but isn't it still easier to simply use a power MOSFET? Or would I have to use an optoisolator to isolate the 12V circuit from the 5V?


    Also, what do you use to make your circuit diagrams? I just did this one in paint, but it was a pain :/
    Last edited: Sep 27, 2010
  7. Sep 27, 2010 #6


    User Avatar
    Science Advisor

    It probably would be OK to drive a Mosfet from 5V from a computer although some Mosfets need more input voltage than that to switch. You could find one that did work OK.

    I wouldn't feed 5 V to a computer like that diagram shows, though.

    The problem comes when you turn the computer off and there is still 5 volts coming into it from outside via your 10 K resistor. It may be OK or it may blow up a computer chip.

    The output of a computer chip should be 5 volts and this would be OK on its own. Just drive the Mosfet via a resistor. Maybe 1 K.

    I use Paint too. Your diagram was fine, but you could enlarge the image and clean up some of the wires where they overhang each other. If you select the eraser tool and then push control-minus, you can make the eraser very small. This lets you get into small spaces.
    If you use control + you can get it back to normal size or as big as the screen.

    If you want to put writing on the screen, write it on a blank area somewhere and the position it with the dotted rectangle thing. This lets you position it more exactly.

    The editor in LTSpice is easier to use and gives good diagrams fairly easily.
    [PLAIN]http://dl.dropbox.com/u/4222062/solenoid%20driver.JPG [Broken]
    Last edited by a moderator: May 4, 2017
  8. Sep 27, 2010 #7
    Hmm. Ok. Well, thanks again for your help :)

    Oh, one last question. With MOSFETs, does it matter much if you put the load on the Drain or Source side?
  9. Sep 27, 2010 #8


    User Avatar
    Science Advisor

    Yes it does matter. Put it in the drain.

    If you put it in the source, the drive voltage needs to be nearly as high as the supply voltage.
  10. Sep 27, 2010 #9
    Why is that, exactly? I haven't been able to find a simple explanation of how gate and drain voltages compare to source voltage.
  11. Sep 27, 2010 #10


    User Avatar
    Science Advisor

    If most of the supply voltage is across a load between source and ground,

    and the gate has to be 3 or 4 volts higher voltage than the source,

    can you see that you need a LOT of voltage on the gate and this has to come from the drive circuit?
  12. Sep 27, 2010 #11
    Oooohhhh. So the ON voltage is relative to the source?! This makes more sense now!! Thanks a ton :)
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook