How to connect this optocoupler to an Arduino to trigger a Canon Camera?

Hi,

So I am trying to trigger a Canon camera with an Arduino Mega. The camera has a little port where two wires need to be connected to take a picture. This part is simple. Just short the wires, and the shutter is triggered. I am trying to short these two cables with a 6n137 Optocoupler. I have 10 of them, so I might as well use them if they work for this.

I do not understand the shematic in the data sheet. I am an engineer. I can get stuff to work from tutorials, but I find it hard to come up with the circuit for this myself and I did not find any tutorials using this optocoupler.

How do I connect this optocoupler to the Arduino? So far, all pins are available.

Do I need a resistor or a diode anywhere?

For the code, do I just need to digitalwrite a pin to 1 or 0 to switch the optocoupler? Like a normal relay?

Thanks a lot and feel free to ask me any engineering questions or design tips. Thats something that I can help with. : )

For the code, do I just need to digitalwrite a pin to 1 or 0 to switch the optocoupler? Like a normal relay?

Yes.

How do I connect this optocoupler to the Arduino? ..... Do I need a resistor or a diode anywhere?

Connect it like you would connecting an LED, with a series resistor 220R should do. Do this with the pins that show they connect the LED in the chip.

What you have to do next is to measure the voltage on those two pins. If the voltage is greater than 7V then you can't use that opto isolator and you need one with a higher output voltage rating. Normal optical isolators have a transistor rather than a gate. Connect the ground ( pin 5 ) to the negitave voltage from your camera and the gate output (pin 6 ) to the pin showing a positive voltage. Connect pin 8 to a 5V positive voltage and pin 5 to the ground of this 5V.

This is not the best component to use for this job as you need another voltage source of 5V on the camera's side. You would not need this with a transistor output or even an SCR output.

Thank you very much. I will follow your strategy and try. Why a separate 5v source? Why can I not use the 5v from the Arduino? Shall I use a buck converter from my power supply to get 5v or what?

Would the cameras circuit not run on 5v anyway?

No most unlikely.

Why a separate source?

Because if you use the same source as the Arduino side you in effect negate any isolation an opto isolater gives you.

I checked the camera. It supplies 3.3V. Could that be enough?

Sorry no. Look at page 3 of the data sheet you posted it says:- Supply voltage VCC 4.5( minimum) 5.5(maximum) V