I've only just read this post thought I'd share a distance sensor I was planing on using its an omron ee-spy302 it is a phototransistor senses up to 4mm and has a very wide input voltage range (5v to 24v) they are quite expensive if you get them from mouser, farnell, RS etc. however you can find them for a couple of quid on ebay if you get them shipped from china, I have a couple but haven't got round to using them yet.. I'm not a fan of the resistor divider I think I'll use a relay and optocoupler to interface with my control board!