Hey all i am just wondering if my drawing below is correct in order to have an arduino detect an on or off led on another board using a optocoupler?
My thoughts of the above drawing is that when the led is on it will trigger the relay inside and send 5v to the arduino digital pin to read. 0v if the relay inside is not connected.
I also would possibly need to tell the arduino digital pin that its an input pullup like this:
please advise if this is correct or not.

My thoughts of the above drawing is that when the led is on it will trigger the relay inside and send 5v to the arduino digital pin to read. 0v if the relay inside is not connected.
I also would possibly need to tell the arduino digital pin that its an input pullup like this:
Code:
pinMode(pin, INPUT_PULLUP);