I am a complete newbie in electronics so kindly be gentle.
I need to know how to wire an optocoupler 6N136. This is intended to isolate between a parallel port output of 5v to a relay of 24v coil. Based on the data sheet, these are how I understand roughly the following:
Pin 2 - Voltage input to the LED
Pin 3 - Ov of the voltage input to the LED
Pin 5 - GND of Vcc
Pin 6 - Vo (output?)
Pin 7 - Vb (base?)
Pin 8 - Vcc
If I input, say 5v/0v (from parallel port output pin) to Pin 2/3, and 24v/0v (from relay coil's supply) to Pin 8/5, where do I get the output voltage? Between Pin 8 and Pin 6?
Do I need to put a resistor load between Pin 8 & 6 (what value)? Do I need to put as well a capacitor between Pin 8 & 5 (what value)?
What should be the value of resistor before Pin 2 (or is it Pin 4)? Is it preferable to put in a diode in reverse before Pin 2 (or, is it Pin 3)?
If I want to do a complete reversal of the above like isolating a 24v (from a hall effect sensor switch) going to a parallel port's input pin, can I use this same opto 6N136? If not, what can you suggest?
Thanks in advance for all the help and assistance you can provide.
How much current does your relay require, or can you reference a datasheet?
EDIT: Can you activate the relay from a logic low from your parallel port, or does it have to be high? The problem with low activation is that the relay will be activated when the computer is off or disconnected, although this might be a feature.
The max allowed output voltage of the 6N136 is only 20V so it cannot be used to drive a 24V relay.
The most sensitive 24V relay I found needs 5.3mA but the minimum output current from a 6N136 is only 4.75mA so it might not work anyway. Most relays need much more current.
The emitter is a 1.5V LED that needs to have its max continuous current limited to 25mA with a series resistor.
How much current does your relay require, or can you reference a datasheet?
EDIT: Can you activate the relay from a logic low from your parallel port, or does it have to be high? The problem with low activation is that the relay will be activated when the computer is off or disconnected, although this might be a feature.
The max allowed output voltage of the 6N136 is only 20V so it cannot be used to drive a 24V relay.
The most sensitive 24V relay I found needs 5.3mA but the minimum output current from a 6N136 is only 4.75mA so it might not work anyway. Most relays need much more current.
The emitter is a 1.5V LED that needs to have its max continuous current limited to 25mA with a series resistor.
I double-checked the data sheet and you are indeed correct that the max output volt is 20v. My confusion came from looking at the supply voltage of max 30v.
Anyhow, can someone guide me how to use this 6N136 within its limitation. Meaning, can I use a 5vdc or 24vdc to drive the emitter LED and say, output max of 20vdc? (Or, what is the maximum voltage I can use to drive the emitter with appropriate resistors?)
My biggest confusion right now is where to get the output. Is it between the Pin 6 (Vo) and Pin 5 (GND), or is it between Pin 8 (Vcc) and Pin 6 (Vo)?
Also, do I need to supply or connect Pin 7 (Vb)?
A circuit diagram detailing the values of the resistors and capacitors needed for the emitter and detector will be highly appreciated.
The relay's coil needs 24VDC at a certain amount of current. You need to know how much current. The datasheet might say the resistance of the coil then Ohm's Law will calculate the current.
Like I said earlier, the max allowed output voltage for the 6N136 is only 20V and its minimum output current is only 4.75mA. It can't be used to directly drive a relay.
An ordinary transistor can easily drive the relay. The parallel port can drive the base of the transistor through a series current-limiting resistor.
The relay's coil needs 24VDC at a certain amount of current. You need to know how much current. The datasheet might say the resistance of the coil then Ohm's Law will calculate the current.
Like I said earlier, the max allowed output voltage for the 6N136 is only 20V and its minimum output current is only 4.75mA. It can't be used to directly drive a relay.
An ordinary transistor can easily drive the relay. The parallel port can drive the base of the transistor through a series current-limiting resistor.
I assumed you needed an optoisolator to keep the computer GND separate from the relay GND. If you drive a transistor from the parallel port, you have to tie the grounds together.
Anyhow, can someone guide me how to use this 6N136 within its limitation. Meaning, can I use a 5vdc or 24vdc to drive the emitter LED and say, output max of 20vdc? (Or, what is the maximum voltage I can use to drive the emitter with appropriate resistors?)
The emitter is an LED that needs up to 25mA max. A current-limiting resistor in series with one of its pins is calculated by using Ohm's Law. It limits its own voltage to from 1.5V to 1.8V.
My biggest confusion right now is where to get the output. Is it between the Pin 6 (Vo) and Pin 5 (GND), or is it between Pin 8 (Vcc) and Pin 6 (Vo)?
It is a transistor with its emitter grounded. The load connects to its collector pin 6 and to the external positive supply voltage of 20V or less. The cathode of the photo-diode pin 8 must be positive a few volts or also at the positive supply or up to 10V higher.
Do not connect to the base of the transistor pin 7.
The output high voltage of a parallel port is not 5.0V. It might be only 2.4V which is the minimum for a TTL logic high output signal. Its minimum logic high current is only 2.6mA which is much too low to drive a 6N136 unless its load is nearly nothing.
I assumed you needed an optoisolator to keep the computer GND separate from the relay GND. If you drive a transistor from the parallel port, you have to tie the grounds together.
Actually, the output from the parallel port goes thru a breakout board with an opto and hence, no worry of having the computer GND common with the relay GND.
I was thinking along the line of using the opto 6N136 to interface the 5vdc to 24vdc of the relay. It seems this will not work as per what I am reading here.
The other idea as suggested is to use a transistor which I am working on.
The emitter is an LED that needs up to 25mA max. A current-limiting resistor in series with one of its pins is calculated by using Ohm's Law. It limits its own voltage to from 1.5V to 1.8V.
It is a transistor with its emitter grounded. The load connects to its collector pin 6 and to the external positive supply voltage of 20V or less. The cathode of the photo-diode pin 8 must be positive a few volts or also at the positive supply or up to 10V higher.
Do not connect to the base of the transistor pin 7.
The output high voltage of a parallel port is not 5.0V. It might be only 2.4V which is the minimum for a TTL logic high output signal. Its minimum logic high current is only 2.6mA which is much too low to drive a 6N136 unless its load is nearly nothing.
You must know the resistance of the relay coil or your driving transistor might blow up.
Simply measure its resistance with a multimeter. Then calculate the value of a suitable base resistor.
Why use a 2N3904 without knowing if it will work? Its gain drops above about 100mA. A 2N4401 might be best because it still has lots of gain up to about 250mA.
A reverse-connected diode must be connected across the relay coil to arrest the hundreds of volts it tries to generate when it turns off.
You must know the resistance of the relay coil or your driving transistor might blow up.
Simply measure its resistance with a multimeter. Then calculate the value of a suitable base resistor.
Why use a 2N3904 without knowing if it will work? Its gain drops above about 100mA. A 2N4401 might be best because it still has lots of gain up to about 250mA.
A reverse-connected diode must be connected across the relay coil to arrest the hundreds of volts it tries to generate when it turns off.
No. You do not understand how a transistor works.
The relay coil is at the collector of the transistor so it gets nearly 24V across it. If it is at the emitter of the transistor then the relay coil will get only about 2V and won't work.
1) The collector current is 24V/750 ohms= 32mA.
2) The 2N3904 saturates well when its base current is about 1/20th of its collector current so its base current and the current in the base resistor is 32mA/20= 1.6mA.
3) The output high voltage of the parallel port is 2.4V or more when it has a 2.6mA load, so with a 1.6ma load its voltage might be 2.8V.
4) The base voltage of the 2N3904 when it is saturated with a collector current of 32ma is about 0.8V.
5) The 2.8V from the parallel port minus the 0.8V base-emitter voltage of the transistor is 2.0V which is across the base resistor.
6) The value of the base resistor is 2.0V/1.6mA= 1.25K so a 1.2k or 1k resistor is fine.
No. You do not understand how a transistor works.
The relay coil is at the collector of the transistor so it gets nearly 24V across it. If it is at the emitter of the transistor then the relay coil will get only about 2V and won't work.
1) The collector current is 24V/750 ohms= 32mA.
2) The 2N3904 saturates well when its base current is about 1/20th of its collector current so its base current and the current in the base resistor is 32mA/20= 1.6mA.
3) The output high voltage of the parallel port is 2.4V or more when it has a 2.6mA load, so with a 1.6ma load its voltage might be 2.8V.
4) The base voltage of the 2N3904 when it is saturated with a collector current of 32ma is about 0.8V.
5) The 2.8V from the parallel port minus the 0.8V base-emitter voltage of the transistor is 2.0V which is across the base resistor.
6) The value of the base resistor is 2.0V/1.6mA= 1.25K so a 1.2k or 1k resistor is fine.