There are sensors used at airports called RVR sensors which measure the fog or visibility, they are'nt going to be cheap, but the principle generally is some sort of IR beam and photodetector arrangement a set distance apart, not sure how successful it would be if it was home built but may be...