This part is a kind of semiconductor called CNY21.
Function of this product has Optocoupler with Phototransistor Output.
Manufacturers : TEMIC Semiconductors
Image and pinout :

Some of the text within the PDF file :
U Phototransistor Output Optocoupler 4 with at .D w The single components are mounted on one leadframe in Application Circuits for safe protective separation against electrical shock according to safety class II (reinforced isolation): D For application class I - IV at mains voltage ≤ 300 V D For application class I - IV at mains voltage ≤ 600 V D For application class I - III at mains voltage ≤ 1000 V according, to VDE 0884, table 2, suitable for: m o .c CNY21N Description The CNY21N consists of a phototransistor optically coupled to a gallium arsenide infrared emitting diode in a 4-lead plastic dual inline package. h S a t e e w w the opposite position, providing a fixed distance between input and output for highest safety requirements of > 3 mm. Switch-mode power supplies [ ... ]
CNY21 PDF Datasheet Download
