Take the 2-minute tour ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

I need to design a MOSFET control circuit which is driven from an FPGA through an optocoupler. Following are the conditions required to be met in my design:

  1. When the power is up initially and the FPGA is not programmed, the MOSFET should be ON.

  2. When the FPGA is driving HIGH (3.3V), the MOSFET should be ON.

  3. When the FPGA is driving LOW (0V), the MOSFET should be OFF.

The FPGA IO is being driven at LVCMOS 3.3V levels. The output load requirement on 12V is approximately 1.5A. Here is the circuit which I came up with:

schematic

simulate this circuit – Schematic created using CircuitLab

Please note that the above created circuit cannot be simulated. Though this circuit can meet both conditions 2 & 3, it doesn't satisfy condition 1. Is there a way in which I can modify the same circuit and make it compliant to all 3 conditions?

share|improve this question
    
@Mandar: What's with all the shouting? No need to be rude here. He has already said the FPGA output line switches between 0 and 3.3 volts, and we can see from the schematic that the grounds of the FPGA and the 12 V supply are tied together. Seems pretty clear to me. –  Olin Lathrop May 14 at 12:21
    
@Olin, that was originally an "answer" converted to a comment for obvious reasons. –  PeterJ May 14 at 12:26
    
@Peter: Yes, I know that. I was one of the people that flagged it. However, that has nothing to do with what I asked. Shouting for no reason is still rude, whether in a comment or in a answer that should have been a comment. –  Olin Lathrop May 14 at 12:31
add comment

2 Answers 2

up vote 5 down vote accepted

There is no need for a opto-coupler here. In your circuit, it is not performing isolation since both sides are tied to the same ground. It is therefore just acting like a slow-responding transistor with very limited gain. Replace U2 with a NPN transistor or "logic level" N channel MOSFET.

Personally, I'd use the NPN transistor in this case. Just about any small signal NPN will do. I use 2N4401 (actually MMBT4401, the SOT-23 version, but that's more cumbersome to write) for such jellybean applications, but many many others would work fine too. Connect the emitter to ground, the base to the right side of R1, and the collector to the FET gate. Yes, it really is that simple.

Since a bare transistor will have more gain than the opto-isolator, you can increase R1. 1 mA base drive is more than enough in this case. Let's say the B-E drop of the NPN transistor is 700 mV. That leaves 2.6 V accross R1 when the transistor is supposed to be on. (2.6 V)/(1 mA) = 2.6 kΩ. That will be slower to turn off, but the FET turnoff time will be dominated by R2 acting against the FET's gate capacitance anyway.

This isn't a high speed switching application, right? If it were, you would need to make the FET turn off more deliberately than with just a 10 kΩ pullup. Your circuit is fine if the FET is just occasionally turning power on and off to some other circuit or device, not switching at more than 100 Hz or so.

Added:

I just noticed that you want the 12 V power to be on when the FPGA is "unconfigured", whatever that really means. I'll take it to mean that the P1 output will be floating at that time. In that case add a pullup resistor to the P1 output. With the NPN transistor as describe above, you don't really need much current thru its base to turn on the FET. Even a 10 kΩ pullup would be enough to keep the NPN transistor on, but high enough to not cause significant current when the FPGA is actively driving the line low to shut off the 12 V supply.

Here is the overall solution I am proposing:

share|improve this answer
    
That is a better way to drive the MOSFET in the circuit. Thanks! Mine is a slow-speed switching application. Also, when I wrote "unconfigured", I actually meant that the FPGA is not programmed. I now realize that I hadn't mentioned it clearly and have made edits above. Is it possible for me to add isolation to the circuit taking into consideration that my FPGA power rails are also derived from the same 12V rail? –  Avin May 14 at 12:39
1  
@Avin: Isolation makes no sense in this case since the 3.3V and 12V supplies share the same ground. Isolate what from what? I don't see what you are trying to achieve by this isolation, even if it were possible. –  Olin Lathrop May 14 at 12:47
    
The DC-DC converter which derives 3.3V from 12V has got a separate input GND plane and an output GND plane. So if I have to protect my FPGA IO from any voltage surges or spikes happening on the 12V rail, can I isolate them by connecting the emitter of the optocoupler to the input GND plane? –  Avin May 14 at 12:55
    
@Avin: I still don't see any need for isolation. –  Olin Lathrop May 14 at 13:05
add comment

Assuming the FPGA pins float when it is unconfigured, try this:

schematic

simulate this circuit – Schematic created using CircuitLab

When the pin P1 is floating, the optoisolator is "off" and the MOSFET M1 is on (gate is pulled to -12V with respect to the source.

When the pin P1 is high, the same as above.

When the pin P2 is pulled low, the optoisolator turns on, and the gate is pulled to within a few hundred mV of the source, turning M1 off.

Of course, the optoisolator provides isolation, so the grounds need not be common between the two sides, which protects the FPGA and can avoid concern about how the heavy return current through the 12V load flows (assuming you do keep it separate).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.