My optocoupler doesn't give more than 1.86V
Figure 1. Problems with OP's circuit.


You have no current limiting on the opto-LED. The RN35 datasheet # says that the forward voltage of the LED is 1.2 to 1.5 V at 10 mA. You are applying 3.3 V. The datasheet also says that the absolute maximum current is 60 mA. You need to add a 100 &Omega; resistor at (1). You are probably being saved by the current limiting on the output of your microcontroller but either the micro or the LED will probably be destroyed soon.





You have connected the battery backwards. Pin 5 of the opto-isolator is the transistor's collector. Current flows from collector to emitter.
If your meter reads 1.86 V across a short-circuit (as shown in your diagram) then it is broken. You should be measuring the voltage across RLY1's coil.




Figure 3. Current transfer ratio.


The current transfer ratio tells you how much current you can expect from the transistor for a given current on the LED. You can see in Figure 3 that at the nominal 10 mA LED current you can get 100% transfer ratio which means that the most you should be expecting to control with the transistor is 10 mA. I doubt your 5 V relay will switch on at 10 mA.








simulate this circuit &ndash; Schematic created using CircuitLab

Figure 4. A simple NPN switch will do the job.