2
\$\begingroup\$

I have a circuit that requires to switch on/off the load using arduino control signal. The load uses 5V DC and upto 3A current. MOSFET or relay must be used to switch the load supply on/off. Input to my circuit is continuous 5V DC.

Which should I use either a relay or MOSFET?

I have used IRF540 MOSFET which works but after it switches on the load voltage is only 3V, which is very less power to the load.

If I have to use a MOSFET what type of MOSFET is preferrable?

\$\endgroup\$
6
  • 2
    \$\begingroup\$ You're not providing enough voltage to the gate of the IRF540. That FET should be suitable for this situation, just drive it with an appropriate voltage. \$\endgroup\$
    – Hearth
    May 12 '21 at 2:46
  • \$\begingroup\$ It is OK to try out IRL540N, which is logical level trigger (5V, TTL), but not the very old IRF540N, which is 7+V trigger (Vgs(th) > 7V). \$\endgroup\$
    – tlfong01
    May 12 '21 at 2:58
  • \$\begingroup\$ The IRL540N is still an n-FET. Won’t work. \$\endgroup\$ May 12 '21 at 5:41
  • \$\begingroup\$ You can use any n-Mosfet in its stead which has a low enough turn-on gate threshold voltage and sufficient drain current rating. The Mosfet must be between the load and ground, keep 5V permanently on the high side of the load. \$\endgroup\$
    – tobalt
    May 12 '21 at 5:50
  • \$\begingroup\$ @hacktastical Of course an n Mosfet will work..I think you misunderstood a part of the question. This is a completely standard low side switch n-Fet application. Yes one could build a p-Fet high side switch instead but that would be more awkward and unusual. \$\endgroup\$
    – tobalt
    May 12 '21 at 5:52
4
\$\begingroup\$

If you want to use a MOSFET, my preference, you need to chose one suitable for the application. This includes current, voltage, load, etc. With the Arduino you need a Logic Level preferably a UIS rated mosfet. The MOSFET must be properly enhanced (see graph on data sheet) to determine the Vgs voltage required to do this. Keep your load and allowable voltage drop in mind. Be sure the grounds are connected. When it is on measure the voltage between the source and drain, it should be less than 0.2 volts, if more you are not properly driving it. The IRF540 is not designed for logic level inputs. Its threshold can be as high as 4 volts. With the Arduino it is wise to put a pull down or pull up resistor to guarantee the output state while it is in reset and your code takes over. This will prevent output glitches.

\$\endgroup\$
3
\$\begingroup\$

The IRF540 is an n-channel device. This requires the gate to be brought higher than the source to turn on. What’s happening instead is that the FET is following the gate voltage, minus the threshold voltage. So if the n-FET gate is at 5V, and threshold is 2V, then it won’t conduct if the drain is higher than (5V-2V), or 3V. So it swings to that and pinches off.

Instead, use a p-FET, which switches on when the gate is lower than the source. Gate at GND, FET is fully on, gate at 5V, FET is fully off. The AO3401A is a 4A device that would work fine for this, but any ‘logic level’ p-FET rated for the current you need would work.

If you decide you need a relay (maybe you want dry contacts?) consider that you’ll still probably need a FET to drive its coil. This is more easily done if you drive the low side with an n-FET, but a p-FET on the high side works too. Either way, don’t forget the catch diode: without it, the coil flyback will kill your FET.

\$\endgroup\$
8
  • \$\begingroup\$ But what if the logic pin can't even reach 5V. Then the pFet will be never fully depleted (still off though). It's more usual to put an n-Fet between ground and load. But use one with low enough threshold \$\endgroup\$
    – tobalt
    May 12 '21 at 4:24
  • 1
    \$\begingroup\$ The threshold voltage for the FET will give some margin on the high side. The AO3401A has a low threshold of only -0.9V typical. If that is an issue, a pull-up to 5V will overcome that. \$\endgroup\$ May 12 '21 at 4:29
  • 1
    \$\begingroup\$ How will a pull-up solve this ? That would only work if the logic pin is an open-drain output. If it is e.g. a 3.3V push-pull output, you can't drive it higher than 3.3V with a pull-up and the pFet will be always on. \$\endgroup\$
    – tobalt
    May 12 '21 at 5:44
  • \$\begingroup\$ A p-FET with a less aggressive (higher) threshold (e.g, -2.5V) would also work. \$\endgroup\$ May 12 '21 at 5:45
  • \$\begingroup\$ If the output is push-pull CMOS it will swing to the 5V rail if there’s no other loading on the pin sinking current. If it’s TTL it won’t, but it can nevertheless be pulled up to 5V as if it were open-collector. \$\endgroup\$ May 12 '21 at 5:49
2
\$\begingroup\$

Use a MOSFET if you want something small and cheap, and you do not require the control circuit to be isolated from the circuit you are switching. Also if you want fast, bounce-free switching.

If you require the circuits to be physically isolated from each other, and contact bounce and slow switching are not a issue, relays are hard to beat. For instance, in large installations, where separate systems that don't have a common signal ground need a simple way to exchange control information, "closed loop" signalling with relays can be a good option. (Opto couplers might be another.)

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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