10-30v to 3.3v Level Shifting
Something like this will work: 







simulate this circuit &ndash; Schematic created using CircuitLab

The output is low if the input is high. You may not need R1 if you can enable a built-in pullup resistor in the MCU.