An optical mask is aligned over the substrate and the sample is exposed to UV light. The mask is designed to isolate a single nanotube and simultaneously create an electrode pattern for later measurements.