optocoupler 4N26 not working

Dear all

I have some troubles with an optocoupler 4N26 (Liteon - 03)

This is my setup:
Arduino pin 7 - 220 ohm resistor - opto pin 1
Arduino GND - opto pin 2

3V anode (+) - red led - 220 ohm resistor - pin 5
3V kathode (-) - pin 4

When I set the voltage of pin 7 alternating to high or low, nothing happens to the led.

I tried all kind of things:

  • when I put an extra led between pin 7 and 220 ohms is blinking, so the signal works

  • switching + and - of 3V side (and reverse led) does not help

  • using higher resistor

When I use pin 6 and 4, the led is on all the time (even if the Arduino is not powered).
When I use pin 5 and 4, the led is on all the time (even if the Arduino is not powered).

However, when I reverse the anode and kathode of the 3V and reverse the led, the led is never on, no matter if I use pin 4 and 5, 4 and 6 or 5 and 6.

Any suggestions ?
Is the optocoupler broken (and if so, how could that be) ?
Or do I miss something ?

Thanks in advance,
Diederik
Regards
Diederik

Please post a schematic diagram and/or clear photos of your wiring.

Check your math and the data sheet. The transfer rate on that part is not super good, it is only 20% at 10mA.
What voltage is the Arduino working at, that could be a problem if it is low. The schematic is needed for better answers.

Show us a good schematic of your circuit.
Show us a good image of your wiring.
Give links to components.
Posting images:
https://forum.arduino.cc/index.php?topic=519037.0

3V anode (+) - red led - 220 ohm resistor - pin 5
3V kathode (-) - pin 4

Connecting a resistor and the anode of a led to pin 5 of the opto (the COLLECTOR) and the led cathode
(NOT kathode) to pin 4 of the opto is not going to do anything at all because it is the same as connecting
a switch across the led with NO power source.

First off pin-4 of the opto needs to go to GND and the ANODE of the led (with resistor in series) needs to go to 5V and the CATHODE of the led needs to go to pin-5 of the opto.

Clearly there is some basic electronics experience missing here because connecting a led across a transistor makes no sense whatsoever.

Try Googling "Arduino opto circuit"

From your rather confused description, it seems as if you have a 220 Ohm resistor connected somehow to the phototransistor.

The emitter of the phototransistor should be connected to ground, the collector to an Arduino pin, no other component, that pin should be set to INPUT_PULLUP.

Hi

This is a diagram of my wiring (see attachement below).

What voltage is the Arduino working at, that could be a problem if it is low.

Arduino connected to computer, and pin to optocoupler is 5V.

I started with information from this site/project , but as it didn't worked and I found in an Arduino guide (the booklet that came with the package) a project with 220 ohm resistor, I changed to a 220 ohm resistor.

Give links to components.

The optocoupler I use was bought via ebay, and is called "4N26 Opto - CASE: DIP6 MAKE: Vishay Semiconductor" I think this is a datasheet from it datasheet.

Connecting a resistor and the anode of a led to pin 5 of the opto (the COLLECTOR) and the led cathode
(NOT kathode) to pin 4 of the opto is not going to do anything at all because it is the same as connecting
a switch across the led with NO power source.

I don't understand. pin 5 and 4 are connected with + and - of 3V source. (The led and resistor are off course between + and pin 5 of the opto-coupler).

First off pin-4 of the opto needs to go to GND and the

ANODE of the led (with resistor in series) needs to go to 5V and the CATHODE of the led needs to go to pin-5 of the opto.

That is what I did. I did google before, and I think my wiring is like how it should be ...

From your rather confused description, it seems as if you have a 220 Ohm resistor connected somehow to the phototransistor.

In most scheme's on the internet I do find a resistor between pin 1 of optocoupler and digital pin of arduino ...

The emitter of the phototransistor should be connected to ground, the collector to an Arduino pin, no other component, that pin should be set to INPUT_PULLUP.

Now I am confused, the collector and emittor are pins 4 and 5 ... isn't it pin 1 and 2 (that should go to Arduino board pin and ground) ?

(Sorry, but it is confusing. I am trying to understand but have little electronics knowledge).

I have found an optocoupler 4N35. When I replace the 4N26 with the 4N35 - with no other changes - the led whole thing is working.
This means that it has something to do with the 4N26 optocoupler, no ?

Regards
Diederik

schema optocoupler.png
Expand!

OK, now it begins to make sense. I - as with most of us - had assumed you were trying to get the optocoupler to control an input to an Arduino. You are apparently for some peculiar reason, trying to get it to make a LED light. This makes little sense, if you want to light the LED, you just connect it directly to the Arduino and resistor. :roll_eyes:

Diedhert:
Now I am confused, the collector and emitter are pins 4 and 5 ... isn't it pin 1 and 2 (that should go to Arduino board pin and ground) ?

OK, I was presuming the more usual project. Now I see what you are trying to do.

Diedhert:
I have found an optocoupler 4N35. When I replace the 4N26 with the 4N35 - with no other changes - the led whole thing is working.
This means that it has something to do with the 4N26 optocoupler, no ?

Yes. The point here is that the 4N25-6-7-8 are obsolete parts, the 4N35-6-7 is their direct replacement. I cannot determine from the datasheet what the difference between a 4N25 and 4N26 is, but the 4N27 and 28 were actually the "seconds" - second grade devices of that series; not quite rejects but sold anyway in case some manufacturer might use them. :astonished:

It's all about the "CTR" - the Current Transfer Ratio of the device - how much current the phototransistor will pass compared to the current driving the LED. This was very poor - low - with the 4N2x devices and much better with the 4N3x which is why that actually worked with your circuit when the 4N26 did not. Unfortunately while I say the 4N25-6-7-8 are obsolete - and they are - they are still sold! :astonished:

But why are you asking this? It is a meaningless project. You should focus on what I presume you really want to do, such as controlling a camera shutter which was discussed just a few months ago, in which case we can guide you through the design process (or just find the previous thread about it).

Read your OP , where you describe the wiring to pins 4&5.
Where you say "3V led Anode" and "3V led Kathode".
Now you are saying that was not a led but a
source. How can a source have an anode or cathode ?
Post a schematic .
Your post makes novsense.

Read your OP , where you describe the wiring to pins 4&5.
Where you say "3V led Anode" and "3V led Kathode".
Now you are saying that was not a led but a
source. How can a source have an anode or cathode ?
Post a schematic .
Your post makes novsense.

Hi, I don't want to discuss in this way.
I am a biologist (and a teacher), not an engineer.
I am just trying to figure out things by reading and trying.
I prefer to go on with people that try to help other ones.

In my OP I wrote

3V anode (+) - red led - 220 ohm resistor - pin 5
3V kathode (-) - pin 4

That is exactly what is in the scheme: the + side of 3V (which can be made by placing 2 1.5V batteries in series, you know) was connected to a led, then the led to the resistor, then to the pin 5.
The - side of the 3V went to pin 4.

I might have mixed up anode and cathode, sorry for that.

How can a source have an anode or cathode ?
Definition of anode is the side where the oxidation reaction occurs, cathode where reduction occurs. A battery is a galvanic element, and has an anode or cathode.

But now I will try to go the post above, which seem at least try to help me.

You may be a biologist but we're discussing electronics and cathode (not kathode) and anode
are thenames of the led terminals and are not
used in reference to a power source.
Where is your schematic ? (which post?)

Hi Paul B

But why are you asking this? It is a meaningless project.

I am just trying to make an automatic shutter release for my Canon DSLR (exactly as
here)

But I like to build things up. I never worked with optocouplers, so instead of connecting the whole thing with the camera for the first time - with the risk damaging the camera in case I did something wrong - I replaced the shutter release cable with a LED.
If the led lights when I am telling (programming) the Arduino to do so, I do know the optocoupler is doing what it is supposed to do.
And then I replace the led with the shutter release cable ... and build the rest (I want the camera to be triggerd when two laser beams are interrupted, but that is easy programming).

I have a look if I can find the previous thread on the shutter release.

Thanks for your patience and help.

You may be a biologist but we're discussing electronics and cathode (not kathode) and anode
are thenames of the led terminals and have nothing to do with a power source.
Where is your schematic ? (which post?)

My scheme is in the post where I refer that it is attached.
If it wasn't there, how could Paul__B has seen it ?

English is not my mother tongue, and in my native language cathode is written with a 'k'. Sorry about that. Truly sorry.
It is "the names", not "thenames". And the part '(which post?)' should be before the question mark of the previous sentence. Nice uh, if we start like that.

cathode (not kathode) and anode
are thenames of the led terminals and have nothing to do with a power source

You presume to know a lot of electronics, but what you are saying is wrong.
The terms anode and cathode are used to indicate which leg you have to connect with which pole of a source.

Current is a movement of electrons, going from - to +.
They start from the - pole, where an oxidation occurs (anode), to the + pole, where a reduction occurs (that is the cathode).

A power source, like a battery or an accu, has a plus pole and a minus pole, hence a cathode and anode. But as the led will only light if it is correctly connected, they have given the legs a name.

I never said a Led does not have an anode or a cathode, but If you keep believing a power source does not have an anode or cathode, just open any chemistry book about batteries or galvanic cells, or google.
![](http://first image on google)
and
anode and cathode of power source

But I don't want to go on like this. This makes no sense and is no help at all. I quit here.
Many thanks for those that made a positive contribution.

You can read all the textbooks you want I'm
just telling that in electronics anode and cathode
are names of semiconductor device terminals
(diode,scr, led etc.) Nobody uses those terms to desribe positive and negative power source terminals. (in 40 years I've never seen an
engineer do that) Doing that on the forum is just
going to cause confusion. It's not even used
for batteries. They are simply "+" & "-" battery
terminals. (no cathode , no anode, even if those
are the correct terms , they are not used in
electronics, probably because it would confuse
newbies to have to remember that the positive
led terminal is the anode and the positive terminal of a battery is the cathode. Do you think would be able to keep that straight ?)
Actually I was confused until I saw your schematic.

Diedhert:
English is not my mother tongue, and in my native language cathode is written with a 'k'.

I think we realised that. :grinning: Rasch was just correcting your translation. It's OK.

Diedhert:
You presume to know a lot of electronics, but what you are saying is wrong.
The terms anode and cathode are used to indicate which leg you have to connect with which pole of a source.

No, the terms are not - ever - used to indicate which pole of a power source is which. :astonished:

Diedhert:
Current is a movement of electrons, going from - to +.
They start from the - pole, where an oxidation occurs (anode), to the + pole, where a reduction occurs (that is the cathode).

A power source, like a battery or an accu, has a plus pole and a minus pole, hence a cathode and anode. But as the led will only light if it is correctly connected, they have given the legs a name.

Yes, you are referring to the function of electrodes in a cell (whereas a battery is a group of cells) and that is indeed relevant to the chemistry. But a battery is only one form of power source and once it is packaged it is referred to only by its positive and negative terminals, the terms "cathode" and "anode" are meaningless in this regard.

Similarly, the term "accu" does not exist in English, it is an abbreviation of an antique term "accumulator", now a "secondary" or storage battery. Just FYI! :grinning:

Unless you have a solar installation with a storage battery your mains power source has nothing whatsoever to do with batteries but is produced by mechanical generators, so clearly the terms "cathode" and "anode" are entirely irrelevant.


I did indeed review the original article to which you referred and had attempted to replicate. It discusses - in passing but not in detail - the significance of the CTR but sadly goes on to cite the obsolete 4N26 part. Due to the wide manufacturing variability of the CTR the part he found presumably did work for him in the test circuit, but that is always the great danger of less-than-methodical "well, it worked for me" articles you find on the Web. :roll_eyes:

It seems you have the proper part now, the 4N35. Go ahead and use it.

My reference to a previous thread here was misplaced; the main discussion I had in mind was about using the flash trigger or "shoe" of the camera to synchronise other functions although the question of how to perform remote shutter control is most certainly discussed from time to time. :grinning:

raschemmel:
Actually I was confused until I saw your schematic.

Indeed. My original situation as well. :roll_eyes:

Considering Diedhert is new to electronics I have no issue with his terms, they are correct. To save you the work of looking it up I copied the following for you.
Difference Between Anode and Cathode (Kathode). Anode and cathode are two terms that are often used interchangeably with positive and negative in batteries. ... The anode, by definition, is the electrode where electricity flows into. In contrast, the cathode is the electrode where the electricity flows out of. Either term is correct depending on the country. How many know what a "single-celled eukaryotes", I bet Diedhert does.

[quote

@gilshultz,
You completely missed the boat. The fact that those terms are defined for batteries (which are NOT semiconductors) is likely the very reason they are NOT used (by convention) in electronics which involves semiconductors where anode and cathode proliferate ever since the days of vacuum tubes. With the proliferation of leds since their invention , it is just too confusing to have to remember that if your discussing leds , cathode is the negative terminal but if your discussing batteries it's the positive terminal. The frequent use of both in the same circuit makes it much more practical to simply refer to battery terminals as + and - to avoid confusion. The point is that in electronics one should follow the standard conventions. Someone from Germany should follow the US and UK conventions on the forum rather than us overlooking it because they are unfamiliar with the convention. As a forum consultant it's your responsibility to point out the correct electronics nomenclature instead of agreeing with them and quoting a textbook about batteries which has absolutely no place on an electronic forum. If it were a Physics or Chemistry forum then I would not have said anything. The Newbies have enough to contend with without you telling them that a cathode is positive when everyone is telling them it's the negative terminal of leds and SCRs. You know very well that those terms are not used for battery terminals on the forum or anywhere else in electronics for that matter. I would be willing to bet you personally have never used them when discussing batteries.