Using optocouplers

Can someone please guide me a bit as to how to use the 4N35 optocoupler? I just need the very basic use and I can figure out how I'll use it in my other project (trying to stick it in between a camera flash and the circuit with no luck)

For example, using the blinking LED sketch that we are all probably familiar with (diagram attached)... How can I stick the optoisolator between the LED and the rest of the circuit? How would that get wired and would the sketch change at all?

My understanding is that this optoisolator is simply an IR LED on pins 1+2 PLUS an IR detector on pins 4 (emitter),5 (collector),6 (base) with no connection on pin 3. So when the LED part gets lit up, it activated the detector part - right? I can't for the life of me figure out how to "power" the IR LED side (pins 1,2) and have it activate the detector (pins 4, 5, 6) which would in turn close the circuit and get a regular yellow LED to light up on the other side...

Am I missing something fundamentally simple here? I understand that the yellow LED on the "other" side would have to have its own power, right?

I apologize in advance if these are completely ridiculous questions that have been answered somewhere else, but I am trying to figure out how to use optoisolators in another project and understanding this would help me there...

void setup()
{
  pinMode(5, OUTPUT);
}

void loop()
{
  digitalWrite(5, HIGH);   // Turn on the LED
  delay(1000);              // Wait for one second
  digitalWrite(5, LOW);    // Turn off the LED
  delay(1000);              // Wait for one second
}

Your desired circuit is described here: http://fritzing.org/projects/optocoupler/.

Yes, an optoisolator is an LED on one side and a transistor on the other.
Hook up an arduino pin with resistor to pin 1 of the opto, gnd to pin 2.
If your flash has two pins that when shorted activate the flash, then hook up those two pins to pins 4 and 5 of the opto. The polarity of those two pins on the flash matters for function, but is not dangerous if you connect it wrong, so if it doesn't work, switch places.

I tested this on 4N26 opto and YN460 flash, but 4N35 has the same order of pins. As for flash... If it is of newer design and uses low power on those pins, you should be ok. If it is of older design that uses high voltage and current, you might burn the opto.

Pylon - I tried that one before posting and didn't work. Tried 3 separate optocouplers, thinking I might have a bad one or two, but still nothing...

Shpaget:

That's exactly what I did! Flash will not fire. Its a Canon 580EX II.

rockandrollnerd:
Shpaget:

That's exactly what I did! Flash will not fire. Its a Canon 580EX II.

The polarity of the two output pins from the opto that you wire to the Canon may make it not work if backwards of the voltage polarity the Canon places on the contacts. So try reversing the polarity.

Lefty

pylon:
Your desired circuit is described here: http://fritzing.org/projects/optocoupler/.

In that circuit the output side is an LED. Have you tried with an LED too or just with your flash as the load? Start with the easy stuff and go more complex when you were successful.

If reversing polarity doesn't work make sure flash is in manual mode.

Thanks everyone for your help. Apparently the culprit was a faulty PC sync flash cable. Wasn't easy to pinpoint for a couple reasons:

  • it would work when flash was connected to the breadboard without the opto
  • when I tried that circuit ( Optocoupler ) I used a standard yellow LED with a 330 Ohm resistor and the LED would actually blink but it was so dim I couldn't even see it. The fact that I have a pretty bright working light over everything only made the blinking impossible to see.

I do however still have a question that has come up from this. Why is it that the LED in this circuit Optocoupler is sooooo dim when connected with a 9V battery and an optocoupler 4N35, 330 Ohm resistor, yet without the opto it is very bright. Does the opto's transistor side "use up" so much current that there's very little left for the LED? Or is it something else completely?

Just trying to understand what is really happening in this kind of circuit.

Thanks for all your help again everyone! Much appreciated!

From that page: http://fritzing.org/projects/optocoupler/:

You can also apply voltage to pin 4 (base) of the optocoupler to raise the gain (just like with a normal transistor).

Have you tried that?