# Optocoupler/relay type for isolating two DC circuits

I have recently started experimenting with an Arduino and would like to control a seperate circuit (for example, a small and cheap digital video camera powered by battery) from my arduino.

Basically my plan is to solder two wires to either side of a tact switch on the target device's PCB. Since I am new to the world of electronics and do not wish to risk any possible damage to my Arduino, I would like to isolate the two circuits from one another.

I have done some research to figure out how to switch one circuit from the other and the options I have come across are relays and optocouplers. I think I prefer the idea of using an optocoupler because they are small and completely separate the two circuits. I can also order some free samples to try them out.

My understanding of optocouplers is that I would not need to connect the ground of the arduino to the ground of my target device (operating on it's own battery source). Is this correct?

Also, considering I plan on using this to control only low voltage DC circuits, what would be a good choice of optocoupler? I plan on ordering several so that I can use them for various breadboard experiments where needed.

Thanks

-
 I have a similar question regarding the use of an Arduino board to measure voltage of a DC-powersupply without sharing grounds. So there should be a galvanic separation between the circuitry of the Arduino and the 48VDC-powersupply. A friend of mine told me to use the LM321 (Voltage to frequency converter) but it can't handle a voltage in excess of 40 VDC. The next problem is, that if the LM321 circuitry uses the same powersupply as the supply it needs to probe, the frequency-value doesn't change when the voltage drops. So how am I going to monitor the 48VDC powersupply with an Arduino, withou – Miech Mar 15 at 20:52 @Miech welcome to the StackExchange community! This site is not a forum, and if you have a question you should use the button on the homepage. Comments (like this) can be used to ask or provide more information about questions and answers. – clabacchio♦ Mar 15 at 22:00

If the circuit on the target device does not require too much current to trigger, using an optocoupler will probably work fine. Here's the pinout of a fairly typical optocoupler - 4N35:

Arduino gets connected to the pins on the left side, the target device is connected to the pins on the right side. You are correct - the two devices should not share a common ground.

On the Arduino side, wiring and controlling the optocoupler is as simple as wiring and flashing a LED. You just need to place a current-limiting resistor in series with either the anode or the cathode. For example: PIN -> R_limit -> Anode ... Cathode -> GND. Resistor values between 330 ohm and 1k ohm should be OK.

At the target device, the collector pin is connected to the node with higher voltage and the emitter pin is connected to the node with lower voltage. When the optocoupler is activated, the transistor at its output starts conducting, effectively closing the circuit.

-
You don't mention a pull-up resistor for the transistor. And why should resistor values between 330 ohm and 1k ohm be OK? Did you calculate it, which is something you have to do for optocouplers? The word is CTR. – stevenvh Jun 25 '12 at 15:13
Just some practical values, which are likely to work, without delving into too much calculations. R=330 ohm gives a forward current of ~10mA and an output current of similar value. The optocoupler is to bypass an existing push-button. If the target circuit needed a pull-up, it would already have one in place, I'd presume. – DimKo Jun 25 '12 at 16:50
If you use the 1k you have 4 mA LED current, and then CTR is only 40 %, so it will only sink 1.6 mA. There probably is a pull-up, but that may be a high value, and the transistor's leakage current may cause a too high voltage drop on low supply voltages. – stevenvh Jun 25 '12 at 16:59
"you don't expect me to formally and fully prove that the setup will work 100%, do you?" Actually, yes. It's a three component circuit and OP obviously isn't acquainted with optocouplers, so you might as well tell him how to use them properly. I did the same here. It doesn't hurt. – stevenvh Jun 25 '12 at 17:28
What's improper in my answer? Judging from an extensive experience as a novice in electronics, I'd say that most of the time when dealing with a new component, it's more important to first get it working in a simple way, without being overwhelmed by tons and tons of parameters, graphs and curves. The OP has already done some research, he can further dig in the details, little by little, if/when he needs to. – DimKo Jun 25 '12 at 17:43

Optocouplers are not designed to both conduct significant current and (while doing so) drop a very low voltage. I suggest you opt for a relay. There are several topics here on driving a relay from a microcontroller pin, or you can use an existing relay shield.

-

Optoisolators are fine for switching low current, low voltage DC circuits. However, if you're thinking of supplying the power for the camera or other device via the optocoupler, I think you'd be better with a relay - it will provide isolation between the circuits and the output is just a mechanical switch with an easily understandable current/voltage rating.

In any case, I think you should read up on what "isolation" means, if you're interconnecting any kind of mains powered equipment, even if they have a low voltage output. Both relays and optoisolators have limits on how much isolation they can safely provide.

-
 I only plan on switching a button on the camera, which is DC. Basically I want to simulate the action of pressing a button on the camera by closing the circuit. – user1092697 Jun 25 '12 at 3:07

For switching a button on a camera I would opt for the relay: just like a button it can switch anything and has a low on-resistance. You don't have to worry if $V_{CE(SAT)}$ is low enough, collector dark current too high, and CTR high enough, things which need attention when using an optocoupler.

can be controlled directly from the Arduino's output (needs only 5 mA).

-