1
\$\begingroup\$

I am currently planning a small project where I use a Raspberry Pi as a smart home server to switch loads (mainly door openers & lights).

The usual way would be to use a mechanical relay with ratings of 16A & min 230V. I also considered using a solid state relay.

I then had the idea to use a p-channel MOSFET. They are widely available and can switch the required currents & voltages (after consulting the datasheet for electrical specifications and providing proper heat dissipation, of course).

I especially appreciate the absence of the huge currents introduced by the relay coil and the higher switching speed that would make this circuit usable for dimming applications.

Is it possible to use MOSFETs in this kind of application or is its function limited or even forbidden by (German) regulations or the laws of physics?

I would really appreciate your opinion/help on this.

Here is the device I am planning to use : IXTH16P60P

\$\endgroup\$
2
  • 2
    \$\begingroup\$ Pretty sure that's a big nope, use an SSR. You can probably build an SSR out of mosfets if you're good, but they only block current one way. You might want to look into home automation panels as it might be the cheapest way to get a combination of safety and ease of install. SSRs have drawbacks too. Sometimes a relay is better. \$\endgroup\$
    – K H
    Feb 1 at 9:28
  • 1
    \$\begingroup\$ Comment on other comments and answers: Be aware that a SSR or TRIAC or MOSFET does NOT provide galvanic isolation and the output should be treated as live at all times. \$\endgroup\$
    – Russell McMahon
    Feb 1 at 11:36
2
\$\begingroup\$

Yes it is possible.

However, for mains voltage they're almost never used because it is just impractical as you need much more than just "a MOSFET" to be able to switch a mains powered device.

A MOSFET can only switch DC so for mains AC you also need a bridge rectifier.

MOSFETs tend to be more sensitive to voltage spikes which are often present on mains voltage lines. So chances are that your MOSFET will break sooner than you like.

For mains voltage switching most often a relay is used, either electro-mechanical or solid state. The advantage there is that the control signal can be isolated from mains voltage which is a huge safety advantage.

For non-isolated applications mostly TRIACs are used. These are also used in mains voltage dimmers.

I also especially appreciate the absence of the huge currents introduced by the relay coil..

In a proper design, this current isn't huge and should not be an issue. All the "wifi sockets" you can buy these days use a relay and the current isn't an issue.

and the higher switching speed that would make this circuit able for dimming applications.

Yes but no, you don't need such a high switching speed for dimming, OK higher than a relay can offer but a TRIAC can do dimming as well. High speed switching (you're probably thinking of PWM) isn't easy to do on mains voltage. It can be done but is complex, high voltage and best left to experienced engineers.

\$\endgroup\$
1
\$\begingroup\$

The reason you use a relay is because it allows for Bi-directional switching, same way a normal mechanical switch does because it removes the part where current is supposed to pass. Mosfet could be used to switch AC, but it's rather complex and redundant. a single one is not useful at all since it still passes current from it's source to drain for N-channel mosfets and the other way for P-channel ones. this can be seen in the way it's shown in schematics (the body diode next to it).

What you want to use is a TRIAC, widely used for switching main's rated devices (like "single" phase motor speed control applications and dimmers used to control the lightings in houses). However, your control device is not to be connected to the triac directly, you should drive it with a optocoupler (look at MOC3021 and other MOCs). make sure the continues current exceeds the normal current you would require for your devices and also include a snubber or a voltage limiting mechanism (like TVS diodes) to supress voltages of switching inductive loads.

It's worthh mentioning controlling TRIACS takes some playing around, but if it's a simple on/off application it should be fine. to reduce the current produced from disconnecting inductive loads, there are optocouplers with zero-cross detection circuitry included, which you could use. If it is a dimming situation, you need zero-cross detection. this would add extra cost to your design (one extra optocoupler). you can use the output of the zero-cross circuit as a trigger for your uC as a phase calculation for your PWM (like if 100% brightness, turn on the TRIAC immediately after getting triggered, if at 50% turn on the TRIAC after 5ms in a 50Hz system).

All in all, if you want dimming, look at TRIACs and built modules available in the market if you don't have prior experience, but if dimming is not a necessity, use your relays and supress the current from the coil using a free wheeling diode. However, as Bimpelrekkie mentioned, if the design is good you should not have a problem.

Note: Not only a small mistake in high voltage handling could kill all your electronics (high voltage connected to your low voltage side) but more importantly it's lethal and VERY VERY dangerous without prior training and experience, and I strongly suggest you avoid handling mains if you are not properly equipped with the knowledge and background

\$\endgroup\$
1
\$\begingroup\$

Power mosfets can be used for AC mains .A back to back connection of two N channel devices can do the AC without a power wasting bridge rectifier.The AC current to be switched must pass through both devices .This means that the expected on resistance will be about twice that of the fet you select .650 Volt fets are recommended for reliability when running 230VAC single phase mains .Really low on resistances are expensive at these high voltages .So if you select a cheap easy to buy 100milliohm device your total resistance will be about 200milliohms .If your load current is 5AmpsRMS then your mosfets will waste about 5 watts .A much cheaper triac will waste about 1 Volt which equates to about 5 watts at the same load current of 5 amps .Sure the mosfet can be switched off on the gate unlike the triac but the triac is more robust so needs less protection .Sure the mosfet can be done but most of the time it is not done unless there is some special reason .

\$\endgroup\$
1
  • 1
    \$\begingroup\$ The gate driver would also have to be isolated. \$\endgroup\$
    – Hearth
    Feb 2 at 4:02

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.