A carbon dioxide (CO2) gas sensor based on non-dispersive infrared (NDIR) technology has been developed and is suitable for use in portable devices for high-precision CO2 detection. The NDIR gas sensor comprises a MEMS infrared emitter, a MEMS thermopile detector with an integrated optical filter, and a compact gas cell with high optical coupling efficiency. A dual-ellipsoid mirror optical system was designed, and based on optical simulation analysis, the structure of the dual-ellipsoid reflective gas chamber was designed and optimized, achieving a coupling efficiency of up to 54%. Optical and thermal simulations were conducted to design the sensor structure, considering thermal management and light analysis. By optimizing the gas cell structure and conditioning circuit, we effectively reduced the sensor’s baseline noise, enhancing the overall reliability and stability of the system. The sensor’s dimensions were 20 mm × 10 mm × 4 mm (L × W × H), only 15% of the size of traditional NDIR gas sensors with equivalent detection resolution. The developed sensor offers high sensitivity and low noise, with a sensitivity of 15 μV/ppm, a detection limit of 90 ppm, and a resolution of 30 ppm. The total power consumption of the whole sensor system is 6.5 mW, with a maximum power consumption of only 90 mW.