http://electronics.stackexchange.com/questions/43498/how-can-i-use-a-12-v-input-on-a-digital-arduino-pin
A simple resistor divider will bring the 12 V down to the 5 V an Arduino can digest. The output voltage can be calculated as ………
Better Michael’s optocoupler is a good alternative, though a bit more expensive. You often will use an optocoupler to isolate input from output, but you can also use it to protect an input like you want here. ………….
for my money’s worth , if I don’t want any stuff ups in the future I would use the opto coupler every time – its guaranteed not to stuff the arduino because it is using the arduino’s own power source to power the input side
I would see if you can buy a dedicated opto coupler for the arduino