The adsorption characteristics of CO adsorbed on pristine 4,12,2-graphyne (4,12,2-G) and Fe-doped 4,12,2-graphyne (Fe-4,12,2-G) are studied by first-principles calculations. The calculations show that CO is only physically adsorbed on pristine 4,12,2-G. Fe atom can be doped into 4,12,2-G stably and leads to band gap opening. After doping, the interaction between Fe-4,12,2-G and CO is significantly enhanced and chemisorption occurs. The maximum adsorption energy reaches - 1.606 eV. Meanwhile, the charge transfer between them increases from 0.009 e to 0.196 e. Moreover, the electric field can effectively regulate the adsorption ability of Fe-4,12,2-G system, which is expected to achieve the capture and release of CO. Our studies help to promote the application of two-dimensional carbon materials in gas sensing and provide new ideas for reversible CO sensor research.