I am trying to use this industrial color sensor to detect different colored objects using the Raspberry Pi.
I programmed in the colors and the display on the sensor shows that it is able to correctly identify them.
The sensor is programmable to allow you to set each output as PNP, NPN, or Push-Pull.
Assuming I am running the sensor off of a 12v wall wart (Sensor Operating Voltage is 10-30 VDC). What is the best way to interface the NPN/PNP switching outputs with the 3.3v GPIO pins on the Pi?
I was planning on using an optoisolator to protect the Raspberry Pi pin from the 12v power.
What's the preferred way of connecting an NPN/PNP output to a 3.3v GPIO pin?
Here is the wiring diagram from the sensor manual.