We report the design and synthesis of a halochromic polythiophene derivative, whose conformation can be alternated between random coil and rodlike phase by adjusting the pH of the solution. Distinct solution color changes associated with the pH-induced conformational transitions can be used to construct a colorimetric probe for sensing carbon dioxide. This probe can be recovered by bubbling nitrogen gas into carbon dioxide-treated solutions for over 20 cycles.