PNP Sensor Hookup

...and finally, here are a couple of examples with input protection. One for Analog Input, and one for Digital Input (good over temperature range 0°C to 65°C):