Controlling a Opto-Relay using Arduino *Help Required*

Hello Arduino community,
I have an arduino Uno and i'm trying to use it with a CPC1017N Opto-relay to turn a cree led on or off but I'm having trouble with the tiny chip:

I can't seem to make it work somehow, feel a bit stupid.

Does anyone know how these things work?

Here's a picture of my circuit:

-Does this look usable/workable?
-Do I need to use a resistor in this circuit to prevent damage to the relay chip?
-Or can I just forget the resistor and connect arduino 5v directly without damaging?
-How do I work out the correct resistor value according to the datasheet of the cpc1017n, I don't really get what's happening? Is it just like Ohm's Law or something similar like: 5v - 'chip voltage drop' /resistor ohm = correct ma current? I don't get it totally.
-How do I find out the operating current of the cpc1017n? Also max current?

Ugh so confusing, but I feel it's probably easy. I might have even broke my opto-chip, but I have a couple of spares to try again.

here's the basic operation of the opto-relay (CPC1017N):

Many thanks in advance for reading and hopefully replying. :frowning:

Do I need to use a resistor in this circuit to prevent damage to the relay chip?

Yes.

-How do I work out the correct resistor value according to the datasheet of the cpc1017n,

It is an LED and you want a current of between 1 and 3mA. With a typical forward voltage drop of 1.2V that gives you
5 - 1.2 = 3.8V so for that to have 2mA flowing you have to have a resistor of 3.8 / 0.002 = 1K9

-How do I find out the operating current of the cpc1017n? Also max current?

The data sheet says maximum is 100mA with a resistance of 16R

It is an LED and you want a current of between 1 and 3mA. With a typical forward voltage drop of 1.2V

Thanks for helping me figure this out. How did you figure out 1-3ma? Is this just standard values for an led? Or is it in the datasheet? Is the voltage drop value of 1.2v also in there?

I think if the 1-3ma value is correct then It seems true that I might have damaged the led inside the first chip I have :frowning: as I used a 200ohm resistor instead of the 19k it states here. Oops.

Oh I get it a bit more now, looking at the datasheet 'LED current to operate'. doh!

It might have been a typing error in your last reply but it's 1k9 which is 1.9 kohm not 19 kohm

thankyou for preventing me from further chip destruction :o

Well 19K would not have destroyed your chip, it just would not have worked.

In some places, xKy means x.yK ohms(or x,yK ohms in locales where a comma is used to separate units and tenths).

Also, in some places xRy means x.y ohms (or x,y ohms).

As you can see, the K or R notation does away with the need for a decimal point (or comma). The decimal point and the comma often get lost in printing, copying, or faxing anyway. A K or R is much harder to lose.

This is not the way that I learned it in the USA, but some other places do it this way. Thus, 1K9 really means 1900 ohms and NOT 19000 ohms.

Just a point that this was not the way I learned it in the UK. When I left academic life in 1998 and went into industry it was what I found that they did.
Back in 1968 when last I worked in industry they did not use this sort of notation.