Connecting optocoupler to GPIO

Hello,
I have a question about how to connect optocoupler.

opto

I am bringing 12V to PIN 1 on optocoupler. PIN 2 and pin 3 are connected to the ground and PIN4 is connected to pull up (5V) and to the arduino GPIO.
My question is how big of a resistor (in series with pin 1) do I need to not destroy the LED inside the optocoupler.

Optocoupler: QTM357 QT-Brightek

I cant seem to understand nor find the max current allowed through the diode. Could someone help me out ?
Currently I am using 1.2kOhm resistor but I dont think it's enough since I destroyed the led inside of opto.

Hello,

Please choose the forum category carefully when you post ➜ Could you take a few moments to Learn How To Use The Forum. It will help you get the best out of the forum in the future.

Thank you.

PS/ I moved your post out of the Uncategorized category

which optocoupler do you have ? 12V might destroy the "LED"

I'm a bit foggy atm so I ask, can you measure the forward voltage between pins 1 and 2? Otherwise go with Vf for an IR or red led.

Isn't resistance == (V - Vf) / current? Current < 5mA is desireable.

I've done this once before but that was almost 30 years ago, wired a Hall switch on 12V line to a parallel port.

I have provided the info of optocoupler in my question
QTM357 QT-Brightek

Typical Vf is 1.24V so I need voltage drop of almost 11V. With my calculations (If=10mA datasheet) that would mean I need a resistor of about 1.1 kOhm so I used 1.2kOhm (just in case), Does that make sense?

10mA is likely guaranteed to work and I get 1076 Ohms, 1.1k looks good to me.

1 Like

I would think about 3mA (3.3k resistor) would be plenty. What value pullup resistor on the UNO side?

I put 100kOhm ... Should have been 10k, I have to fix that. I still get 4.86V on the GPIO, which is fine

It's not the voltage you need to limit but the current.
The less you need, the better. Arduino pins have a total max source + sink capacity of 200mA. You don't really want to use half of that.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.