Go Down

Topic: help connecting Arduino UNO to n-ch MOSFET via Optocoupler (Read 8 times) previous topic - next topic

Grumpy_Mike

Quote
Isnt the FET gate same as opto's emitter, since the two are connected?
Do you mean drain by collector?

I mean:-
The emitters of the optos should be connected to ground, the -ve of your 24V source and the FET gates should be connected to the collector of the FETs.

Quote
Do you mean to the - of the 24V?

Yes.
Quote
But that makes all three optos connected, if one opens all three FETs open.

No. Each FET gate should be connected to the collector. Each emitter should be connected to the same ground.

The circuit as you drew it is just not going to work. Transistors work with current flow, there is no where for the current to flow if you connect the emitter directly to the FET's gate because a FET has such a high input impedance.

Please ignore dhenry he is our resident idiot.

jwatte

Quote
Transistors work with current flow


This is kind-of ambiguous, because every component "works with" current flow of some sort, or it wouldn't be a very useful component. I think I know what you meant, but someone new to electronics might not.

This is basic stuff. I feel it will help anyone who's not yet clear on it and reads this thread:

BJTs (NPN and PNP transistors) work such that the flow through Collector-Emitter is proportional to flow through Base times the amplification factor, with polarity depending on the type. Thus, a BJT transistor needs current flowing through the base to let current flow through the controlled path.

FETs (N-channel and P-channel transistors) work such that flow through Source-Drain is proportional to the charge built up between the gate and the source. The gate is like a capacitor, so while a small amount of current will flow into it to build up that charge, no current will flow through the gate once it's built up, and the MOSFET will still conduct. The only reason to keep the gate voltage on is to replenish leakage current from the gate. This is also why disconnected (floating) MOSFET gates may stay turned on after disconnection, or even spuriously turn on, or off, if there is not enough impedance to either gate voltage or ground.

This is also why it's OK-ish to leave a BJT base floating when you're not driving it -- no current flows, so it will not conduct. But for a FET, that's not true. You must make it so that the gate is ALWAYS connected to either a voltage, or ground. Typically, you do this through a pull-up or pull-down, depending on what you want the default condition to be.

For an opto-coupler that pulls the gate up to turn it on (N-channel FET) you need to also keep a pull-down to ground to the gate, so that the gate turns off when the opto-coupler is not transmitting current. Perhaps a 2 kOhm pull-down will be sufficient, if you're not trying to switch the FETs at too high an on/off frequency.

Grumpy_Mike

Quote
This is kind-of ambiguous, because every component "works with" current flow

No a FET as you point out works on voltage, there is no current involved in making it work. Leakage current is just that: current that leaks, it is not current that makes it work.

Terraviper-5

#28
Dec 16, 2012, 02:27 pm Last Edit: Dec 16, 2012, 02:31 pm by Terraviper-5 Reason: 1

I mean:-
The emitters of the optos should be connected to ground, the -ve of your 24V source and the FET gates should be connected to the collector of the FETs.


Oh, now I get it (I read the sentence wrong). Do you mean like this?



Quote

The circuit as you drew it is just not going to work. Transistors work with current flow, there is no where for the current to flow if you connect the emitter directly to the FET's gate because a FET has such a high input impedance.


I though that if I connect a 7.5 V power supply through the optos and to the gates of FETs, the optos will block the path when they are off, and when they are on, they will let the current through and to the gates of the FETs, which will then turn on. At first I though about using the 24V supply for this too, but then I saw the limit on the FETs : +-20V absolute max.
Probably stupid thinking, seemed logical to me though since I know very little about electronics (for now).


The gate is like a capacitor, so while a small amount of current will flow into it to build up that charge, no current will flow through the gate once it's built up, and the MOSFET will still conduct.


Ohh, so thats why the solenoids stayed on (when I reconnected the pwr, ofc) even if I turned off the power and then turned it on again.

Quote

For an opto-coupler that pulls the gate up to turn it on (N-channel FET) you need to also keep a pull-down to ground to the gate, so that the gate turns off when the opto-coupler is not transmitting current. Perhaps a 2 kOhm pull-down will be sufficient, if you're not trying to switch the FETs at too high an on/off frequency.


Im actually not sure if my optos are pullup or pulldown. I didnt know where I can get this information. grumpy_mike mentioned they are pulldown on previous page

No prob about the frequency, they will work slowly :)

So basically, I add a connection between the gate of FET and -ve of 24V source (trough 2kOhm resistor)? Wont that transmit power to all other FETs as well, so when one is open, all are open?


The transistor in an opto coupler can only pull down, so there is nothing to supply the voltage to the FETs gate.


That means they are actually inverse of what I need?

dc42

#29
Dec 16, 2012, 02:45 pm Last Edit: Dec 16, 2012, 02:47 pm by dc42 Reason: 1
Looking at your schematic in reply #7, it shows the mosfet drain and source terminals the wrong way round. But I think you must have wired them up the right way round, otherwise the solenoids would be permanently on.

What you need to do to get that circuit working is:

1. Connect a pulldown resistor between the gate terminal and the source terminal of each mosfet. 470 ohms is about the right value.

2. Do away with R4, you don't need it because you are supplying the optocouplers with only 7.5V and it will prevent enough voltage getting to the mosfets gates (once you have added the pulldown resistors). Connect the collectors of the opto isolators direct to +7.5V instead.

One problem with using opto isolators with mosfets is that opto isolators turn off quite slowly. This in turn means that the mosfets they are connected to turn off slowly, which causes them to dissipate more power. Probably not a problem if you are just turning the solenoids on and off, but a problem if you want to use PWM.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Go Up