Maker Pro
Maker Pro

MOSFET 12VDC Relay?

crutschow

May 7, 2021
839
Joined
May 7, 2021
Messages
839
I guess R3 limits current, while R4 ensures that Q1 receives proper voltage?
Yes, R3 limits the base current, which is required for a BJT.
R4 is mainly to absorb any base leakage current and insure it stays fully off, especially if the device experiences higher temperatures.
 

adamq

Dec 17, 2013
78
Joined
Dec 17, 2013
Messages
78
Yes, R3 limits the base current, which is required for a BJT.
R4 is mainly to absorb any base leakage current and insure it stays fully off, especially if the device experiences higher temperatures.
Gotcha.

I'm expecting it shouldn't get too hot but one never knows.

Since it's being used in the marine environment, I'd like to add tinned blade connectors and encase the whole thing in epoxy.
 

crutschow

May 7, 2021
839
Joined
May 7, 2021
Messages
839
Since it's being used in the marine environment, I'd like to add tinned blade connectors and encase the whole thing in epoxy.
That's fine.
Just make sure the epoxy is compatible with electronic parts and won't corrode them.
 

crutschow

May 7, 2021
839
Joined
May 7, 2021
Messages
839
I forgot to include a protection diode in case the load has some inductance to absorb any negative transient when it is turned off.

Revised schematic below:

upload_2021-5-7_11-31-12.png
 

adamq

Dec 17, 2013
78
Joined
Dec 17, 2013
Messages
78
Alright... this is what I've come up with including the optocoupler.

relay_mosfet.png

I should have downloaded KiCad a long time ago.
 

crutschow

May 7, 2021
839
Joined
May 7, 2021
Messages
839
this is what I've come up with including the optocoupler.
With the optocoupler, you likely don't need Q7.
Just connect the opto output emitter (pin 3) to ground and the collector (pin 4) to M1's gate (with R1 of course).

But depending upon the gain the of opto, you may need to reduce the value of R2 or increase the value of R1, to fully saturate the opto output transistor when its ON.
Many optos have a transfer gain of less than 1.
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
Q1 takes on the function of the switch in my circuit.
Where did I miss the requirement for a positive control voltage to turn on the output?
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
Why the optocoupler? Replace Q? by the switch and resistor as shown in my post #16.
 

adamq

Dec 17, 2013
78
Joined
Dec 17, 2013
Messages
78
Why the optocoupler? Replace Q? by the switch and resistor as shown in my post #16.

Just for an extra layer of safety.

The signal wire is fused at the switch, but might be only 20ga.The load conductors are fused as well, but for 10ga loads.

I prefer the two to be isolated because it's a harsh environment.
 

adamq

Dec 17, 2013
78
Joined
Dec 17, 2013
Messages
78
Why should a NPN transistor work but not the switch?

Hey Harrold. I appreciate your help on this.

I believe your idea won't work because the switch is located physically far away from the circuitry. Because it's a retrofit solution it is challenging.

The 12V "signal" comes via a single conductor up to 30ft away. It is not a pair of wires and there there is no ground at the switch. There is also no room for circuitry at the switch.

In your example, I believe the switch must be between the two resistors to activate the gate. It definitely works just not for this application.
 

adamq

Dec 17, 2013
78
Joined
Dec 17, 2013
Messages
78
...depending upon the gain the of opto, you may need to reduce the value of R2 or increase the value of R1, to fully saturate the opto output transistor when its ON.

You may be right.

As an example, the data sheet of the LTV-817, CTR is 50% at 5mA min. It's 100% at 10mA, or 50mW. 600% is maximum. Those are at 5V.

At 12V, I'm unsure how it is affected, but I expect it is based on the brightness (power) of the octocoupler LED.

So, I would expect 12V@5mA (60mW) should give the same capacity as 5V@10mA (50mW).

In that case, perhaps a 2.4k resistor is appropriate for the input. That would give ~5mA at 12V.

Thoughts?
 

crutschow

May 7, 2021
839
Joined
May 7, 2021
Messages
839
At 12V, I'm unsure how it is affected, but I expect it is based on the brightness (power) of the octocoupler LED.
Yes.
It's determined by the input current, not the voltage.
So you select the input resistor to give the desired input current.
The resistance would be the signal voltage minus the diode input voltage (typically about 1.3V) divided by the desired current.

But you only need the input current that fully turns on the output transistor with the output load current (I would use about twice that from the transfer gain calculation).
I'm not familiar with simulators but it seems to work?
I simulate just about all circuits before I built them.
It doesn't always give the exact results of the real circuit, but it gives you a heads-up in case you made a significant error in your design, before you build it.

The simulated circuit works fine.
Note the output voltage from the MOSFET follows the input voltage to the opto.
 
Last edited:

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
I believe your idea won't work because the switch is located physically far away from the circuitry.
If the long wire from the switch to the MOSFET catches noise that interferes with the operation of the MOSFET, so will the same noise interfere with the operation of a driving transistor and thus finally the MOSFET.
To reduce the influence of noise on the MOSFET simply add a filter capacitor between gate and source, e.g. 10 nF or 100 NF. The exact value is not relevant as switching will be slow anyway (the relay that is going to be replaced is much slower).
The circuit by @crutschow will work. However, the value of R3 is to high. At 12 V for the control signal and ~ 1.6 V for the LED, the current through the LED will be on the order of 1 mA. You can buy low current optocouplers, but the majority is designed for 5 mA or 10 mA LED current. I suggest 1 kΩ for R3 to improve reliability. A higher current will also reduce the susceptibility of the circuit to noise. To further improve stability, add a filter capacitor as mentioned above, but this time not to the MOSFET but across theLED of the optocoupler. R3 and the capacitor will form a low pass filter that additionally reduces noise. Since the LED has a comparatively low impedance (compared to the MOSFET), you can chose a higher value for the capacitor, e.g. 1 µF ... 10 µF, whatever is in your parts bin.
 
Last edited:

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
In your example, I believe the switch must be between the two resistors to activate the gate. It definitely works just not for this application.
You believe wrongly. It definitely will work.
 
Top