Jump to content

Request: 6N138 optocoupler "tutorial"


Recommended Posts

Posted (edited)

Hi,

I would like to understand how the output side of a 6N138 works. Here is a 6N138 (datasheet):

large.6n138.png.7466475858c3517757a3a33e

What happens when the input side LED flashes to "1", and what happens when it goes off for "0"..? Especially I'd be interested in a step by step walkthrough on how the transistors work when the first one in the series (a phototransistor, I take it) gets a signal from the LED.

If we're taking the MBSIDv2 core schematic as a concrete reference with resistors, we have 5,6k at pin 7 going to ground, and pin 6 is connected to signal out and via a 1,2k resistor to ground. I understand that the 5,6k resistor enables the output transistor to operate faster, but what about the 1,2k at pin 7? There's different MIDI out schematics on the net with the value varying a lot (from 470R to 10k, even though the latter was on a 6N136 which might make a difference), so is it that the output current doesn't really matter (as long as it's not too big), what matters is only whether the voltage at pin 6 is high or low?

 

Edited by jjonas
Posted

but what about the 1,2k at pin 7?

I guess that you mean pin 6? This is a pull-up resistor. If the gate is closed, we get a logic-0, if it's open the resistor will pull the level to logic-1

Best Regards, Thorsten.

Posted

Hi and thanks,

the links you provide are a bit more "fundamental" than what I had in mind, dealing with atom level operation (electrons and holes) of semiconductors, while I was looking for a more "mundane" explanation. Sorry if my original mail wasn't clear enough. I know the basic operation of an NPN transistor (hfe, B-E threshold voltage etc.), more or less, but it's a bit shaky and not comprehensive, so I was looking for an explanation more along the lines of the video below. The video was very useful to watch (also for how MIDI works in general), but it didn't really get into the details of the transistor operation at the end of it tutorial.

 

 

I might be mistaken, but based on the video it seems that the second transistor (see schematic in the first post) functions just as a switch, switching between full saturation and whatever is the opposite of saturation :-) , i.e. on/off. The circuit that I have is the one below (sorry that the image is a bit dark), and my question is what function do the resistors R1 and R2 serve, and how would one go about determining the best values. (The MIDI specification gives a schematic only for PC-900 optocoupler and mentions that 6N138 or others can be used with modifications, but doesn't say what those modifications are.)

I guess R2 can be found out using an oscilloscope, to see which size enables the shortest propagation delay (like explained in the video at this point). Is the function of R1 just to limit the current flowing through the second transistor to ground when it's fully saturated, i.e. when pins 5 and 6 have zero potential difference between them..? If so, is the maximum current to be found in the 6N138 datasheet alone, or should it be also considered, as per Kirchhoff's current law, what amount of current the receiving device can take..? On the receiving end there is a 220R resistor to limit the current when the transistor is off and won't let any current through, so I guess we don't have to worry about that..? But when the second transistor is fully saturated, it will practically suck up all the current, so one might think that the current limiter R1 size is in practice defined only by how much current the transistor can take. If so, the rating should be found on the absolute maximum ratings section of the datasheet. I'm not sure what it's called, but can someone confirm it's "Output current at 25°C = 60mA"? If that is the case, then R1 value should be 83R at the very least (5V/0.06A=83,33?). I've tried R1 values for circuit below at 440R, 1k, 4.4k and 10k, and they all appear to work.


large.S1190010.JPG.3d6304f403380a9a3d9fd

 

Posted

I guess that you mean pin 6? This is a pull-up resistor. If the gate is closed, we get a logic-0, if it's open the resistor will pull the level to logic-1

Best Regards, Thorsten.

Yes, my mistake, I meant pin 6.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...