When I was getting help with my last circuit people gave me the advice to add some resistors. So I finally got this result.
The stats to the part are the following:
M1: RF-130 CH
U1: 4n35 Optoisolator
Q1: BC547 Transistor
I figured out that R3 should be about 70 Ohm due to the forward voltage of the U1 diode being 0.8V and the forward current being 60mA. With R = U/I this brings me to R = (5-0.8) / 0.06 ==> 70 Ohm I just wanted to post this in order to make sure I didn't do any mistake here.
Now comes the harder part as I do not know exactly how to calculate the other resistors. I just wanted to ask if anyone could give me like a general idea where to start calculating all of the missing values.
Thanks for your help.