33
\$\begingroup\$

I'm thinking about using 4N25 optocoupler - it has a separate lead for base of phototransistor. How do I use it? I suppose I can't leave it floating?

enter image description here

\$\endgroup\$

5 Answers 5

40
\$\begingroup\$

The base terminal of certain phototransistor optocouplers is exposed to address specific design requirements, such as below. If those requirements do not exist, a part without the base pin might be a better choice - the latter are typically 4 or 6 pin parts as opposed to (usually) 8-pin parts incorporating the base pin: Usually cheaper, less space needed on the board, and less routing too.

  1. Faster switching on trailing edge of pulsed signal: For this purpose, a resistor is connected between base and emitter (or ground), of value calculated as per specific transistor and required switching time.
    For a quick & dirty general value, just stick in a 220k to 470k resistor there.

  2. Impulse noise immunity (or reduction) at output: This is required when input current suffers brief spikes or sharp extraneous rise / fall, such as due to poor power regulation. A capacitor is connected between base and emitter of the phototransistor. This acts in effect like a low pass filter, adding some smoothing to the input signal, and bypassing sharp spikes. It does reduce signal sensitivity and introduce a delay, though.
    For a quick and dirty value, use a 0.1 nF capacitor, though it is worth trying higher and lower capacitances, depending on adverse effects if any.

  3. Current transfer ratio matching: This third function applies when multiple optocouplers are used in parallel for a design. There will always be some difference in performance between parts, even from a single batch. If matching them up is critical to the application, various approaches to provide appropriate bias to the base are used.
    No quick and dirty approach in this case.

To conclude: No, the base should not be left floating, or it will act as an antenna, picking up EMI noise and superimposing it on the output.

\$\endgroup\$
4
  • \$\begingroup\$ The IC shown in question is a 6 pin part and not "(usually) 8-pin parts" so that benefit of baseless optocoupler is not there. Good detailed answer otherwise. \$\endgroup\$ Commented Nov 9, 2012 at 6:19
  • \$\begingroup\$ A normal optocoupler could also have just 4 pins, just say 4 vs 6 instead of 6 vs 8. \$\endgroup\$
    – Falk
    Commented Jun 3, 2020 at 11:18
  • \$\begingroup\$ How do you calculate the resistor values in case 1, and why is 220k to 470k a good general value? \$\endgroup\$ Commented Aug 26, 2020 at 12:41
  • 1
    \$\begingroup\$ Having just suffered much pain in the form of occasional noise because the base was left floating, it's important not to overlook this answer. 220kOhms to GND fixed it. \$\endgroup\$
    – NateS
    Commented Sep 4, 2023 at 23:42
11
\$\begingroup\$

There is not much difference than the standard BJT design and an optotransistor. The base can be left floating but it will severely reduce the turn off speed since any internal base capacitance cannot be discharges(which is why they gave you a direct connection to to the base. Optocouplers do not have this connection).

The base picking up spurious EM emissions is not a huge issue with BJT's unless the CTR is very high or in critical applications. You can generally use any optotransistor as an optocoupler. If you want faster speeds you should tie the base to ground through an appropriately sized resistor so that the internal capacitance can discharge in time.

In any case, just treat any optotransistor as a normal BJT circuit, but that the input to the optocoupler has a very high impedance to the base when off(that is, no light = "floating" base). Generally this means you have to have a pull up or down resistor to provide a relatively low path to ground to either prevent spurious results from EM or to allow for discharge of capacitance in a timely manner.

\$\endgroup\$
3
\$\begingroup\$

If you have access to the base, you can use the base-emitter junction as a photodiode; iirc this is faster than using a phototransistor.

The current transfer characteristic is also much more linear (although for analog stuff it won't come close to servo optocoupler)

\$\endgroup\$
1
\$\begingroup\$

It could also be handy for testing maybe? You might have the LV side of the equipment at your bench, while the HV side is really inaccessible in the factory. So tickle the base with 5V on/off to simulate the HV side which is missing in the lab.

\$\endgroup\$
1
  • 2
    \$\begingroup\$ While this is a possible use it doesn't really address the main question of how to use one in general and whether it can be left floating. \$\endgroup\$
    – PeterJ
    Commented May 25, 2014 at 13:40
1
\$\begingroup\$

I've used photo-transistors very successfully in high-interference environments (the SUN, for example), having DC_negative_feedback to servo-out the large steady state currents, and sustain the collector in a VDD/2 biasing condition.

Thus for beta=100 photo-transistor, with 10Kohm resistor from collector to +5v, with 0.25mA thru the collector to cause 2.5 volts drop across the collector load, I'd pick two resistors to drop the (+2.5 - 0.6) = 1.9 volts and provide the 0.25mA/100 = 2.5 microAmps. Given 2.5uA is 400,000 ohms per volt, we need about 750,000 ohms total, and two resistors of value 390,000 are about right.

The key is to place a LARGE capacitor at the midpoint of the two base-collector biasing resistors. 1UF gives about 1Hertz F3dB, but you have to remember this is in a feedback loop, and the 1Hertz is modified (speeded up) by the loop gain.

Again, this is a great way to really reduce the impact of sunlight, and provide some attenuation of 60Hz flicker from incandescents.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.