Impedance measurements of meso-porous TiO2 electrodes in contact with aq. and nonaq. electrolytes have been performed in the dark and under UV illumination. In the dark the differential capacitance was found to be dominated by the back contact. Bandgap excitation of the TiO2 film turned on a capacitance assocd. with the meso-porous semiconductor layer. This is interpreted in terms of trapping of photogenerated holes in surface states leading to unpinning of the energy bands. The unpinning of the energy bands during UV illumination was confirmed by a dye-sensitization expt.