I have a proximity sensor without nameplate. I have done some tests that made me think it is a PNP (normally open).

Is my assumption correct? Is there another method to find out?

Test setup:
Supply sensor brown (24 V), blue (0 V), black is output. Voltmeter is connected with red always on output. The black voltmeter wire is used to test blue and brown.

Note: By "triggered" I mean an object is brought near the sensor and its LED is ON.


  1. Without any load resistor:
  • Not triggered: V(black-brown) = -1.5 V; V(black-blue) = 0.04 V
  • Triggered: V(black-brown) = -0.7 V; V(black-blue) = 23.4 V
  1. Assume PNP: I added a 10k resistor between output and GND
  • Not triggered: V(black-brown) = -24 V; V(black-blue) = 0 V
  • Triggered: V(black-brown) = -0.6 V; V(black-blue) = 23.4 V
  1. Assume NPN: I added a 10 kΩ resistor between output and Vcc
  • Not triggered: V(black-brown) = 0.04 V; V(black-blue) = 23.6 V
  • Triggered: V(black-brown) = -0.8 V; V(black-blue) = 23.3 V
  • 4
    \$\begingroup\$ That looks like an open-collector/open-drain device of either pnp or p-channel construction, yes. Whether it's a BJT or FET, or even a relay, doesn't ultimately matter though. \$\endgroup\$
    – Hearth
    Jan 16, 2021 at 17:12
  • \$\begingroup\$ normally open or normally closed ? \$\endgroup\$
    – Eng Sam
    Jan 16, 2021 at 17:18
  • \$\begingroup\$ Edit : I have read more about the subject and i seems since the LED is On when an object is in proximity then it is NO . \$\endgroup\$
    – Eng Sam
    Jan 16, 2021 at 17:26
  • \$\begingroup\$ Stranger color choice. Did you considered black -24V, brown +24V, blue output? Why 24V, not 12? \$\endgroup\$
    – user263983
    Jan 16, 2021 at 17:44
  • 3
    \$\begingroup\$ @user263983: The industrial sensor standard for many years has been 24 V DC (nominal - often 12 - 30 V) with brown = +24 V; blue = 0 V; black = output 1; white = output 2 (if required). See How do I wire my industrial sensors?. \$\endgroup\$
    – Transistor
    Jan 16, 2021 at 17:59

2 Answers 2


I came across a similar question a while back, and created a solution for it. See here: Circuit to detect in which port sensor inserted

tl; dr: Tie the output (black wire) to a midpoint voltage divider. A not-triggered sensor output will be at half voltage. Now close the optical path (trigger the sensor):

  • If the sensor pulls it up, it's PNP
  • If it pulls it down, it's NPN

Here’s the circuit: enter image description here

The linked solution uses a set of comparators to check for each case to provide a 'universal' solution that supports PNP or NPN type. You could also just use a voltmeter to figure out which type it is and which resistor connection to use, pull up for NPN or pull down for PNP.

Optical proximity sensors like this use a phototransistor + LED. When the phototransistor sees the LED light, it 'closes' (turns on).

Whether it's 'normally open' or 'normally closed' depends on the sensor.

  • A reflective sensor turns on when the object reflects the beam
  • A transmissive sensor turns off when the object blocks the beam

Your description is for a reflective sensor.


It is a PNP. A 10K ohm resistor is almost like an open for most of these current levels meaning that using your voltmeter to check vs using a 10kohm resistor plus a voltmeter might as well be the same.

  • 3
    \$\begingroup\$ That resistor is essential for an open-collector or open-drain output, though. You need to have that to pull the output low when the transistor is off. \$\endgroup\$
    – Hearth
    Jan 16, 2021 at 17:44
  • \$\begingroup\$ I mean that if you were to put a 10kohm resistor across a 1.5V AA battery it would still read 1.5V across the resistor because of how low the current through it is. 1.5V/10k ohm = 150 micro amps. This is probably similar to the amount of current getting pulled through the voltmeter at 24V. \$\endgroup\$
    – EEmatsci
    Jan 16, 2021 at 18:12
  • \$\begingroup\$ You could put your voltmeter in current mode and check then(make sure to swap the leads). In current mode your voltmeter will act as though the leads are close to 0 ohms. Then any difference between BJT or MOSFET internals are eliminated. Or use a smaller resistor, something like 100 ohms. \$\endgroup\$
    – EEmatsci
    Jan 16, 2021 at 18:22
  • 1
    \$\begingroup\$ "A 10K ohm resistor is almost like an open" . that is not right at all . and the measurements vary with and without resistor . Second thing please donot give wrong advice if you donot know what you are saying , putting 100 ohm ressitor as you said causes the sensor to burn . because the current passing through the Pnp transistor is 24/100= 0.24A , which is more than 10x the current rating of such sensors . \$\endgroup\$
    – Eng Sam
    Jan 18, 2021 at 10:57
  • \$\begingroup\$ Was I right, or was I right? It not what was it? \$\endgroup\$
    – EEmatsci
    Jan 29, 2021 at 5:42

Your Answer

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

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