I've made a small circuit using the Optocoupler diagram to use a 4N35 optocoupler to switch the remote control of a 35mm slide projector. The circuit I have made works when I test it with an LED using the 5V from the Arduino, but when I connect the DIN plug that leads to the projector (20V), it doesn't trigger the slide advance. I've checked the voltage when the circuit triggers, and it does seem to be switching, so the opto circuit seems to be working - it just isn't triggering the projector. When I manually join the leads on the DIN plug, the projector advances just fine, so it's not a fault with the projector.
I thought that the 4N35 would do exactly the same job as a relay - but in this case it doesn't. What am I doing wrong?
Thanks in advance for helping out.
(post edited to correct component number)
I thought that the 4N23 would do exactly the same job as a relay
No it is a transistor not a relay.
What am I doing wrong?
Thinking it works like a relay.
Measure the voltage across the slide projector's two wires. The negative most one should be connected to the emitter and the positive most one to the collector.
Now put the meter on current and measure what it draws when they are shorted ( the current meter is the short ). Is this less than the current rating of the opto isolator's transistor?
Now look at the data sheet, what current do you have to have flowing down the LED to achieve the current transfer you want?
Thanks for the info. I'm terribly sorry, but I've made a super-huge mistake in the original posting - I got the number of the component wrong. It's not a 4N23, it's a 4N35 Optocoupler.
How embarrassing. Hopefully the question will make a little more sense now.
Actually, I think the slide projector might be AC. My notes from my 1983 senior project state that a Kodak Carosel uses a 25V AC signal to switch. I used a relay, but you may be able to use a TRIAC based optocoupler like the MOC3010. The optocoupler cannot handle the current to switch it.
KeithRB:
Actually, I think the slide projector might be AC. My notes from my 1983 senior project state that a Kodak Carosel uses a 25V AC signal to switch. I used a relay, but you may be able to use a TRIAC based optocoupler like the MOC3010. The optocoupler cannot handle the current to switch it.
In situations like this, where you are interfacing with an existing circuit, I think a relay is usually the right choice. A relay is much more likely to work in a variety of circumstances where an optocoupler will fail. I am a big fan of the CPC1218 (normally-open) and CPC1219 (normally-closed) solid state relays, because they avoid all of the mechanical problems that can occur with reed switches. As long as your load signal is less than 600 mA--and, surely it is--I think one of them will work for you.
If, for example, you were needing to pass a high-frequency signal through the optocoupler, a relay wouldn't be the right choice. If you needed to linearly pass an analog signal through, a relay wouldn't be the right choice. But for simply replacing a manual switch with a computer-controlled switch: relay every time.
Thanks everyone for this detailed and useful advice. I'm not certain whether it's running AC or not, as my multimeter only measures DC currents, but the current does seem to fluctuate, which might be part of the reason the optocoupler isn't doing the trick. The advice to use a relay instead has been duly noted!
Just so I can get my head around it for the future, for what sorts of real-world applications should you choose an optocoupler instead of a relay?
michaelday:
Just so I can get my head around it for the future, for what sorts of real-world applications should you choose an optocoupler instead of a relay?
Optocouplers typically have higher switching speeds than relays. This is true for basic, "commodity" optocouplers, but you can also buy high-speed optocouplers that are designed for e.g. data transmission. If you needed high switching speed, such as if you were passing through a high-frequency PWM signal or you were passing a high-speed data signal, an optocoupler would be appropriate.
Low-end optocouplers are cheaper than relays, so if you can use an optocoupler, you might choose to do it to save money.
Relays and most optocouplers are non-linear. They are designed to be either fully on or off. So there is this transition period where the voltage is high enough on the control side that the device is starting to open up, but is not yet fully open, but there is no reliable relationship between the control-side voltage and the load-side voltage. What if you have an analog signal that you need to pass through? Like, you want 0-5v on the control side to map to a corresponding percentage of 0-Vcc on the load side. For example, maybe you are doing some kind of audio amplification for which you need isolation. Or maybe you need to drive an analog circuit via a DAC, but the analog circuit and the DAC must be isolated from each other. In that case, you can get a linear optoisolator. Linear relays don't exist; they're designed to be fully on or fully off.
You can get optoisolators with base leg pins that let you tune the speed/responsiveness of the chip. As far as I know, relays don't do this.
On the flip-side, relays are generally simpler and more robust than optocouplers. Relays can also usually handle higher currents.
Bear in mind that the distinctions between the two start to blur a little when you start using solid-state relays instead of mechanical relays like reed switches or solenoids. Solid-state relays are basically optocouplers that have been designed to act like mechanical relays. But inside, they're still optocouplers.
One of the nice features of the CPC1218 and CPC1219 relays that I mentioned before is that they have a built-in current-limiting resistor. This is because they are designed to be a drop-in replacement for a certain popular type of reed switch, and the reed switch didn't need a current-limiting resistor. Anyway, this is nice because I cannot tell you how many times I have accidentally blown up an optoisolator by accidentally overloading the control side pins because I forgot to install a current-limiting resistor, or I accidentally shorted the pins with a test lead, or I accidentally plugged in power to the wrong place in the circuit. With a self-contained relay, none of that would have happened.
Me too I wanted to complete my last "Project 15 : Hacking Buttons" of the Arduino Projects Book by trying to
substitute the closure of a switch by an optocoupler of the type 4N35.
As a second circuitry device I chose a little lamp supplied by its battery packages. I cut out the wires from the push button and, following the Optocoupler diagram , i connected the 1st pin of the opto to arduino 2 pin through a 220 ohm resistor, opto 2nd pin to arduino ground, opto 4 pin to the negative of the lamp batteries and the 5th opto pin as shown in the attachment. Under the lamp bulb cover there are 4 AA batteries of 1.5V each one.
I first tried with success the same diagram with a more simple LED supplied by a 9V battery apart.
But since on the contrary the lamp does not light on, what is wrong in my scheme now ?
sorry but i'm a newbie
Hang on, do we even know the voltage this slide-projector uses for its remote switch?
What if its mains? Without any data to the contrary you should have made that assumption and
not touched that remote (except with insulated multimeter probes to measure the voltage)...
If you do know the voltage, or even the model of slide projector, that would be useful to post...
You're using the 4N35 as a power switch, the collector current is rated 50mA, how much current is needed by the "light bulb"?
Also, if you're only putting 17mA in, don't expect much more out.