I am currently working to install an NPN photoelectric sensor (retro-reflective dark on: https://www.automationdirect.com/adc/shopping/catalog/sensors_-z-_encoders/photoelectric_sensors/18mm_round_-_nonmetal/polarized_retroreflective_(ss_-z-fa-z-_fb_series)/fbp-dn-0e) however it is not working as expected and was hoping someone here could clarify what is happening. To my understanding an NPN transistor works as so (RL is 9k ohms). Here the transistor is activated. enter image description here

What is happening is the current Ib is 0.016A when the transistor(sensor) is on and 0.12A when the transistor is off. Ie is 0.018A when the transistor is on and 0.012 when off. Ic is essentially zero at all times. The impedance reading between the collector and emmiter is 38.5M ohms at all times, and the impedance reading when taken across RL (base and collector) is overload and then when the sensor is activated the resistance of 9k ohms is read.

My question is although the logic is working as expected, the currents (Ie, Ib and Ic) are not. I was under the impression the transistor acted essentially as a switch between emitter and collector, however most of the current flow is through the base and the emitter, and the impedance between the collector and emitter is not dropping below 38.5M ohms. Can anyone clarify anything for me? Or is it likely I have screwed up the circuit or am taking incorrect measurements. Thank you.

  • 1
    \$\begingroup\$ It's common practice to limit the base current by inserting a resistor in series with the base and whatever source you're driving it with. \$\endgroup\$
    – brhans
    Commented Aug 21, 2019 at 18:49
  • \$\begingroup\$ Using resistor (tried multiple sizes from 3k-15k ) stops the logic from working entirely. The signal stays in the on position at all times (24V) \$\endgroup\$
    – FuzMunkey
    Commented Aug 21, 2019 at 19:14
  • 1
    \$\begingroup\$ Ignore that - it's irrelevant. What you have there is not an NPN transistor. With 'industrial' sensors like that, the term NPN typically means that the output is 'open-collector' and 'active-low', which effectively means that when it's 'on' there is effectively a switch between the output pin and the negative supply pin which is switched on. You need to hook your load up as shown in this diagram. Forget all about transistors, because that isn't one. \$\endgroup\$
    – brhans
    Commented Aug 21, 2019 at 19:32
  • \$\begingroup\$ Thank you, I was treating the problem as a transistor problem, however I did not look at the problem as a sensor simulating transistor logic. Thanks for assisting this scrub \$\endgroup\$
    – FuzMunkey
    Commented Aug 21, 2019 at 20:03

2 Answers 2


enter image description here

Figure 1. From the datasheet on the linked site.

The diagram is telling us to power the sensor on 1 (+) and 3 (-) and connect the load between 1 and 4.


simulate this circuit – Schematic created using CircuitLab

Figure 2. The internals of the sensor.

These sensors are far more complex that you seem to have imagined.

  • The type you have chosen is a retro-reflective type. That means that it has both a transmitter and a sensor.
  • The sensor is digital. The output will be either on or off and not somewhere in between. That means it has to have some threshold logic to determine when to switch.
  • The threshold logic will switch an NPN output transistor which will connect the output lead to ground when on. (Hence 'NPN' type.)
  • There will also be some hysteresis built-in so that once the on threshold has been exceeded that the light level will have to fall significantly before it turns off.
  • Several precautions will be taken to ensure that the sensor is not sensitive to ambient light so that it doesn't turn on and off when someone switches the lights or a cloud moves across the sun. These include:
    • Using infra-red light for the transmitter (not always).
    • Polarizing the transmitted light and using a polarizing filter on the receiver.
    • Modulating the transmitted light (the simplest is pulsing it on and off at, say, 1 kHz) and monitoring the reflected light for the modulation and detecting the change from on to off.

Most industrial control systems now use PNP sensors which switch the positive rather than the negative. This makes trouble-shooting more intuitive.

Note also that we have a symbol for transistors. There is no need to draw a diagram of PN junctions!


NPN photo detectors usually leave the base open, or tied with a very large resistor to the emitter. Normally the light hitting the transistor excites the base-emitter, causing base current to flow. The collector draws more current, due to the transistors current gain. So then a resistor in the collector, biased positive (VCC) relative to the emitter allows the collector voltage to vary between VCC (no light) to VceSat (much light).

I don't exactly understand your circuit. I assume that the emitter is the left N and the collector is the right N. Perhaps the voltage source is what you think is happening when light hits the transistor? When light hits the transistor the model should be a current source connected across the B-E, injecting a current proportional to the light power. Then an external voltage source with neg to the emitter and a resistor between pos and the collector biases the transistor and allows the collector voltage to change with light intensity.

A resistor across the base-emitter makes the transistor less sensitive to light as the photo induced current gets shunted by the resistor.

Your drawing has no relationship to the specification drawing for these sensors. I don't think they have exposed the base for you to connect to. I believe that in this case normally open means no current flow when no light. Normally closed means current flows when no light. NPN means that the load is externally connected to a positive voltage, and the other side of the load connected to the collector of a transistor. Emitter to neg side of the supply. In diagram 1 of the data sheet collector would be black and emitter blue. Brown, which is connected to the VCC side of the load is probably there so the sensor vendor can place a snubber circuit (Probably a diode and a maybe a small capacitor) in parallel across the load so as to protect the device from inductive kick-back if the load is a inductive, such as a relay coil.

Usually these sensors have so much gain that almost any light saturates the detector and causes the load voltage to swing from VCC to nearly ground. Often the photo detector and another transistor are Darlington connected to get the product of two transistors current gain.


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.