To address the issue of poor gas sensitivity in existing mining semiconductor CO sensor materials like PANI at room temperature, this study employed an ice-water bath in conjunction with an in-situ polymerization method to incorporate 2D sheet-like Ti3AlC2 and nano-CeO2 materials with oxygen vacancies into PANI. As a result, nanometer-sized PANI/Ti3AlC2/CeO2 ternary composite nanomaterial was synthesized. The morphology, synthesis mechanism, and thermal stability of the ternary composite material were investigated using scanning electron microscopy-energy dispersive analysis (SEM-EDS), transmission electron microscopy analysis (TEM), spectral analysis, and thermogravimetric methods. Furthermore, the CO gas sensing mechanism of the ternary composite material was also examined. The study discovered that the nano-PANI/Ti3AlC2/CeO2 ternary composite nanomaterial, when deposited on the Au interdigital electrode of the IDE substrate, exhibits superior gas transmission of 400 ppm CO compared to gas sensors based on nano-PANI, nano-PANI/Ti3AlC2, and nano-PANI/CeO2. The sensing response was enhanced by 1.75 times, 1.4 times, and 1.2 times, respectively. This improvement in sensing mechanism can be attributed to the pn heterojunction and interfacial interaction forces between the components. Hence, the nano-PANI/Ti3AlC2/CeO2 ternary composite nanomaterial holds potential as a high-performance CO detection sensing material at room temperature. Additionally, it can serve as a theoretical basis for further research on low-power, integrable sensor materials in coal mines.