Problem using White light contrast scanner Leuze

I have an optical sensor npn with 24 volt power and want to turn it on arduino uno. knowing that entries are 5 volt Arduino as I can connect to the arduino? I'm using this sensor

very grateful

You can certainly switch this sensor on and off using the Arduino, as long as you use a transistor to do so. I would suggest a high side PNP/NPN combination, see attached. However, the data lines appear to be high voltage as well, and you will need voltage level translators to accommodate the levels to the Arduino.

Do you have the data sheet in English? My Spanish is OK, but I’m not completely confident in my interpretation. There appear to be two I/O pins, digital output (SIO) and COM input (for teach mode, 38.5 kbaud), with logic levels in the range of 10-30 V.

The circuit below should work OK for 24 V, but I haven’t gone through all the calculations to verify that.


what does this gadget actually do ? "White light contrast", what does that actually mean ? It doesn't seem to be related to the normal meaning of "contrast" , in English, in relation to photography. The cartoon make it look like a colour sensor.

@JohnLincoln thanks for posting the English data sheet, but it is for a slightly different model (KRTL versus KRTW).

However, both have the same specifications for the output function:

Output/function …/2… pin 4: GND if mark detected …/4… pin 4: UB if mark detected …/6… pin 4: IO-Link SIO mode, UB if mark detected …/6… pin 4: IO-Link COM2 mode, see configuration file IODD

I haven't been able to figure out what .../2... etc. means but the second and third options, "UB if mark detected" suggests that that output is active high (UB being the power supply voltage). If so, at the very least a voltage divider will be needed to bring the output level down to 0-5 V.

By the way, the "high side switch" that I posted should work for data input to the module as well. Connect the base of the NPN transistor (no base resistor needed with this circuit) to TX on the Arduino and set the Arduino to 38.5 Kbaud serial.

thank you all for the help.

In my connection I use the following pins: Blue = - 24volts brown = + 24volts black = output signal

I believe I'll have to make a reducer 24 voltage to 12 volts to power the arduino and also make the reduction circuit voltage will be connected to the black wire. the output of this voltage reducer I'll call in a arduino input (pin 8) to know when the sensor is active. This correct my connection? Voces recommend using two transistors - one PNP and the other NPN - to make this circuit?

very grateful

If by

Blue = -24 volts

you mean the negative terminal of the 24 volt power supply, then that would be OK.
You will most likely need a resistive voltage divider on the output of the sensor to reduce the voltage range to within 0-5 V. See attached for a suggestion. Be sure to attached the grounds of the Arduino power supply and the 24 volt power supply together.


very grateful for the help.

I will make the circuit here, I'll try and put the result here in the forum.

Thanks again.