Described is a room-temperature hydrogen sensor comprised of a TiO2-nanotube array able to recover substantially from sensor poisoning through ultraviolet (UV) photocatalytic oxidation of the contaminating agent; in this case, various grades of motor oil. The TiO2 nanotubes comprising the sensor are a mixture of both anatase and rutile phases, having nominal dimensions of 22-nm inner diameter, 13.5-nm wall thickness, and 400-nm length, coated with a 10-nm-thick noncontinuous palladium layer. At 24 °C, in response to 1000 ppm of hydrogen, the sensors show a fully reversible change in electrical resistance of approximately 175,000%. Cyclic voltammograms using a 1 N KOH electrolyte under 170 mW/cm2 UV illumination show, for both a clean and an oil-contaminated sensor, anodic current densities of approximately 28 mA/cm2 at 2.5 V. The open circuit oxidation potential shows a shift from 0.5 V to −0.97 V upon UV illumination.