I use a n channel mosfet for this type of thing. Sensor signal to gate with a pull down resistor.

PIC pin pulled high, mosfet takes it low when sensor is triggered.
No need to worry about the 25V. Just use a common ground.

More parts but works well.