Pages: [1]   Go Down
Author Topic: Using optocouplers  (Read 6288 times)
0 Members and 1 Guest are viewing this topic.
NJ, US
Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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...

Code:
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
}


* Screen Shot 2013-01-21 at 2.25.27 AM.png (140.55 KB, 483x742 - viewed 1061 times.)
Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 108
Posts: 5144
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Croatia
Online Online
God Member
*****
Karma: 13
Posts: 506
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

NJ, US
Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
Logged

NJ, US
Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Shpaget:

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

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 108
Posts: 5144
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Croatia
Online Online
God Member
*****
Karma: 13
Posts: 506
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

NJ, US
Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 ( http://fritzing.org/projects/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 http://fritzing.org/projects/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!
Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 108
Posts: 5144
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Quote
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?
Logged

Pages: [1]   Go Up
Jump to: