Arduino with Optocoupler

I am using the Arduino to signal an optocoupler that is part of a PCB. In the board, the signal has to go through a 680 Ohm resistor before it gets to the optocoupler. The data sheet for the optocoupler I am using can be found here. http://optoelectronics.liteon.com/en-us/api/DwonloadFileHandler.ashx?txtSpecNo=DS-70-99-0019&txtPartNo=MOC3023

I cannot everything to work right. When I hook up a AC-DC regulator to the PCB, the optocoupler works fine. I am beginning to think the Arduino does not give enough voltage or current.

Any ideas?

The voltage can be changed. I tried 6V, 7.5V, and 12V and all worked. I am not able to test the current but the regulator says 1000mA

The regulator also has voltage output at 3V and 4.5V. Everything worked with that voltage as well.

A 680 ohm resistor is too high a value to use an Arduino +5vdc output pin to drive the input led of the opto. That would only allow about 5 ma of input led current to flow. The spec sheet says minimum led current to guarantee turn on is from 10 to 30ma depending on which specific opto type you have from the series covered by the spec sheet. I would lower the resistor to 150 ohms and try that.

Do you think removing the 680 ohm resistor would work?

Well it looks like you were a step ahead of me. I am trying that now.

Do you think removing the 680 ohm resistor would work?

No, that would just damage the arduino output pin trying to drive the led with no current limit. Again try lowering the resistors value to 150 ohms.

Lefty

All I had was a 180 resistor. It still didn't work. I even tried it without a resistor with and still nothing.

Too bad. Without a wiring diagram of the arduino to pcb hook up and all power connections it's hard to go much further with what you've given us. You do have a common ground between the arduino and pcb?

Lefty

I made a quick drawing of what I have set up. Not sure if it will be helpful or not. http://www.flickr.com/photos/49748342@N06/5152600665/

http://www.flickr.com/photos/49748342@N06/5152600665/

All my optocoupler data sheets say you have the LED wired backwards. GND should go to pin 2, output to pin 1 (or output to pin 2 and +5V to pin 1.)

You all were exactly right. I had the input switch.

The PCB has 4 channels which means 4 optocouplers. Where I was getting confused and still am, Pin 1 of all 4 optocouplers (Anode) are connected together. I would have thought Pin 2 would have been connected together to make a common ground.

Thanks for the help. Hopefully I can figure the rest out.

OK, now all is figured out, but I have one question just to make sure I am not going to damage something.

Since the positive side (Pin 1) of all 4 optocoupler is common, and the negative (Pin 2) each has its own input from the Arduino I did the following. I hooked the 5V from the Arduino to the common Pin 1’s, and then hooked a Digital Output to each of the Pin 2’s. Now when I want Optocoupler 1 to activate, I send a LOW signal to that Output, and to deactivate, a HIGH signal. So the output is acting as the Ground I guess. Does this have the potential to damage anything.

So the output is acting as the Ground I guess. Does this have the potential to damage anything.

Only requirement is that you insure that you don't draw too much current from the Arduino output pin(s). 40ma is the absolute max, with 20-30ma a good recommended maximum. The series resistor to each opto input is what will determine the current draw.

Lefty

Pin 1 of all 4 optocouplers (Anode) are connected together.

That's somewhat common if you are looking at peripherals designed to connect to many different types of CPU. For a lot of micros, I/O pins are better able to "sink" current than they are to source it, and LEDs and similar will show up with their anode attached to +5V and their cathodes attached to the IO pin, where you output a 1 to turn them off, and a 0 to turn them on...

Good to know.

Thanks for the help everyone! Couldn't have done this without you all.