# Optocoupler Question

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.

• Welcome to StackExchange, Daniel. Telling us that you're trying to open your door with an optocoupler doesn't help us much. A schematic diagram would. There's a schematic button on the editor toolbar. Please update your question with a schematic. – Transistor Jan 4 '16 at 13:37
• No schematic, no part number, the link is dead. -1. – Dmitry Grigoryev Oct 29 '18 at 9:21

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.

You can backwards calculate the forward voltage. You are given the dissipated power and current. $P=IV$ $V = P/I$ $70mW/50mA=1.4V$ The forward voltage is about 1.4V.

• Thank you so much! I asked them on the online help and they said the forward voltage is 40V, so I was pretty dumbfounded! – Daniel Crane Jan 4 '16 at 13:39
• @DanielCrane They were probably referring to the transistor section and not the diode section. – vini_i Jan 4 '16 at 13:42
• Oh I see, thanks for your advice. Just to confirm, in this case I'd need a 39-ohm resistor? – Daniel Crane Jan 4 '16 at 13:44
• @DanielCrane Theoretically yes that is the correct value. That being said I don't think that the Raspberry Pi can tolerate that kind of current on one of it's pins. – vini_i Jan 4 '16 at 13:57
• 50 mA is from the Absolute Maximum Rating table. – tcrosley Jan 4 '16 at 14:12