Interpretation of wiring diagram

Hi

I have would like to test an optical sensor I got.
Below are the characteristics and there is also a diagram.

Voltage input: 10 - 30 DC
Power consumption: < 35mA
Output type: PNP
Signal voltage: Approx VS. - 2.0 V/0 V
Output current: < 100 mA

Could you please aide me?

Thanks!

Without the part number of the device, I suggest the following

The device will probably have 3 wires, blue, black and possibly white. The specifications sheet will tell you which wire is the +ve supply (between 10 and 30v), ground and output.

To test the sensor, connect the supply and earth and put a resistor and LED from the output to earth.
When something triggers the sensor, the LED will light.

Your sensor has a pnp output that switches the supply to the output terminal. This means that the output cannot be connected directly to the Arduino as the voltage will be too high.

The best sensor for Arduino would be npn transistor output. These switch an open collector npn transistor to ground. Simply tie the IO pin high and use the sensor to pull it low.

If this does not answer your question, we need the part number of the sensor to read the specifications.

Weedpharma

Edit after seeing circuit on logging in.

The brown is the positive, blue is ground. It has two outputs, one will be low when triggered while the other will be high. Untriggered will be the opposite.

My comment re connection to Arduino remains as triggered or untriggered the voltage is too high.

Hi weedpharma

I have a bunch of these, so I rather use those than buy new ones, also my machinery has fixtures for those.
https://www.mysick.com/partnerPortal/TopFrameset.aspx?AutoSelect=SK_Products

Reading the sensor output directly into Arduino was exactly my concern…
Not sure how to understand the Signal voltage: Approx VS. - 2.0 V/0 V ?

Guess I’ll try to hookup a 24V input and put a multimeter on the output to se various reading.

Thanks!

Sorry bad link - It's a Sick WT9L-P330

Vs-2/0. Means that the output will either be 2 volts less than the positive supply or ground.

It can be used with Arduino BUT needs interface circuit to do so.

The triggered output could be used to feed the base of an NPN transistor through a 10k resistor, the collector would then be connected to the IO pin that is tied to 5v.

Weedpharma

PNP outputs on sensors like that are "open collector", which means that they generally need a load resistor to ground to develop a usable signal. You can use a 1K to 10K ohm resistor from Q or Qbar to ground. The output voltage will be either (Vs - 2) volts or about 0 volts, depending on whether the sensor is activated.

Edit: if the sensor power supply is higher than 5 volts, the output resistor can be replaced with an appropriate voltage divider for input to an Arduino. For example, if the supply voltage is 10V, use two 10K resistors as the load and connect the Arduino input to the junction between them. Connect all grounds together.

Thanks!

Though wouldn’t it be better to use an optocoupler to isolate the circuits?
(got some Sharp PC4N35V)

Something like…
Pin 1 (anode) to -Q (via a 270K resistor)
Pin 2 (kathode) to Q
Pin 5 Collector to a 5V Arduino pin
Pin 6 Emitter to a Arduino input pin

kr Taras

An opto would be fine. You will need to tie the IO pin to 5v (10k) and the opto collector connected so as to ground the IO pin. Put the opto diode cathode to ground and feed the anode via a 1k resistor from Q.

Weedpharma

jremington:
Edit: if the sensor power supply is higher than 5 volts, the output resistor can be replaced with an appropriate voltage divider for input to an Arduino. For example, if the supply voltage is 10V, use two 10K resistors as the load and connect the Arduino input to the junction between them. Connect all grounds together.

According to the datasheet Supply voltage is specified as 10v - 30v, so it looks like 5v was never an option.

The voltage divider using two resistors has potential danger of applying excessive voltage to the IO if the the ground connection is broken.

The opto or NPN transistor are safer options in a situation where you are only wanting a level change and not needing to measure the voltage.

Weedpharma

Five years ago, taras wrote:
Pin 1 (anode) to -Q (via a 270K resistor)
Pin 2 (kathode) to Q
Pin 5 Collector to a 5V Arduino pin
Pin 6 Emitter to a Arduino input pin

According to the datasheet, the PC4N35V uses these pins:
Pin 1 Anode
Pin 2 Cathode
Pin 4 Emitter
Pin 5 Collector
Pin 6 Base
so, it seems taras mixed up pin 4 and 6.

As I am a complete novice to electronics, I don't know whether I should connect pin 4 or pin 6 to the Arduino input pin.
I assume the connections between PC4N35V and Arduino are straight forward without any implicit use of resistors.
Also, I wonder if there need only be two connections on the output side of PC4N35V.
Thanks for any enlightment on this subject.