Surface and bulk properties of TiO2 in relation to sensor applications