Electronic – Optocoupler Question

opto-isolatorraspberry pi

I'm currently trying to create a system to open my apartment's door (using the buzzer) using my raspberry pi, and thought that using an optocoupler would be the best solution – although I'm a complete novice.

The only optocoupler that I've been able to find locally is this one, however I'm pretty lost on whether or not this would be suitable for my project, and if so I'm not sure what kind of resistor I would need to buy to be able to use it.

The Raspberry Pi has a 3.3V source voltage, and I was using this site to try to calculate what ohm resistor I'd need, but I sadly don't see the forward voltage on the specifications of this product.

tl;dr: Is this optocoupler suitable? If so, how many ohms would the resistor I buy need to be?

Thanks for your help, and sorry for the probably trivial question.

Best Answer

If you download the datasheet from the site you linked to (Downloads tab, fifth one over), you'll see that in the Input section of the Electrical Characteristics table on page 2, the forward voltage V\$_{F}\$ of 1.5V is specified at a current of 5 mA I\$_{F}\$. 50 mA is from the Absolute Maximum Rating, you don't want to use that. So the resistor value you want is:

$$\frac{(3.3V - 1.5V)}{5mA} = 360Ω$$

not 39Ω as you assumed in a comment to another answer.

The Raspberry Pi GPIO pins can sink or source up to 16 mA (the output is configurable from 2 to 16 mA). I covered that in an answer to another question.