This invention relates to the field of electrochromic thin film technology, and more particularly to a dithiophene derivative, its preparation method, and its application, as well as an electrochromic thin film and its preparation method. This invention involves reacting dithiophene with
tributyltin chloride to generate
tin-modified dithiophene, reacting dithiophene with isopropanol
pinacol boronic acid ester to generate
boron-modified dithiophene, and then reacting the
tin-modified or
boron-modified dithiophene with 1,4-diiodo-2,5-bis-(6-hexynyl)-
benzene to generate 1,4-dithiophene-2,5-bis-(6-hexynyl)-
benzene. This product is then reacted with dimethylboron
hydride generated from
lithium aluminum hydride and
dimethoxyethane to finally obtain the dithiophene derivative. This derivative can be applied in electrochromic thin films. This invention successfully prepares an electrochromic thin film with fast response and
fluoride ion detection capability by electrochemically polymerizing the dithiophene derivative.