Circuit
Make 5 V from a 12 V supply
A sensor input needs a $5\ \text{V}$ reference, and all you have is a $12\ \text{V}$ supply. Two resistors in series share the voltage in proportion to their resistance: this is a voltage divider. โฆ