Why use Optcoupler + Mosfet

convertermosfetopto-isolatorpower supplywiring

I saw this project: http://diyhacking.com/arduino-lamp-dimmer/ which I'm interessted to(except that I will have to use some 24V, still enough to hurt the Raspberry Pi).

There is several things that I'm not sure to understand:

  • The optocoupler is used to isolate the 5V from the 230V(24V in my case), ok
  • The MOSFET is used to normaly used to command an higher voltage with a lower voltage.

So what I don't understand is why we need the MOSFET since the optocoupler already receive some 230V(24V)?

Thank you

Best Answer

It adds another layer of protection even with 24V. If you screw up, screwdriver or test probe slips and shorts two connections together (or the wrong ground connection opens up) you're much less less likely to ruin your micro board. Your choice, there's not a human safety reason if the 24V has proper galvanic isolation as well as a common ground.

Since the 4N35 is so very painfully slow, using it degrades the switching of the MOSFET. This could be dealt with by using a somewhat better part and/or squaring up the signal on the other side of the barrier, but I think this is a major downside.

Real product designs would probably not use the opto unless there was some reason to keep a noisy 24V supply completely separate. In development, it's not uncommon to temporarily add isolation from mains or high power supplies. Or maybe just add some 10K resistors and a buffer.

It tends to ruin your day if excessive voltage finds its way into the wrong place and destroys the test object and your computer motherboard at the same time!