4N26 and 4N37 are cheap optocoupler that are good for most of the power electronics applications. They are six pin ic with optical isolation. The output is inverted because the output transistor works as a switch. The frequency limit of this ic is explained in this post. The following is the working circuit of optocoupler 4N26 and 4N37.
In PV grid connected inverter, in order to inject the current at unity power factor we need to know the polarity of the grid . To do so various solutions exists. Among these solutions is the use of optocoupler. I have verified the use of 4N26/4N37 for the said purpose. The circuit is very simple and its working is given below.