You can do this without a voltage divider as well, either by using a Zener, an LED across the input with a resistor in series with the sensor, or place a Schottky diode from the input to the 3.3 V rail.
Here are examples:
simulate this circuit – Schematic created using CircuitLab