Read IFM reflection sensor data

Hello,

I am trying to use a IFM O6H200 sensor: O6H200 - Diffuse reflection sensor with background suppression - ifm with Arduino.

Right now I have the sensor connected to a 12V external power supply (Brown+ and Blue- cables) and the Black output cable of the sensor connected to the PIN 8 in Arduino.
My Arduino is connected via USB. I am trying with the help of the BUILTIN_LED to test the feedback from the sensor, but so far I had no success.

Do you have any example code I can borrow please?
Am I doing anything wrong with the connections?

Thanks

There are several ways to connect that sensor, as explained in the documentation on the manufacturer's web site.

I would use the PNP connection, with a voltage divider made of a 10K and 5K resistor (for 12V sensor power) to reduce the output voltage to a range suitable for an Arduino digital input. The voltage divider would be the rectangular box in the diagram below. Be sure to connect the sensor and Arduino grounds.

Capture
Capture

It the PNP output was activated with

the Black output cable of the sensor connected to the PIN 8 in Arduino.

that may have destroyed the Arduino input pin.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.