In order to explore the variation of CO2 concentration and soil respiration in soil profile, the nondispersive infrared (NDIR) spectroscopy technique was applied to continually estimate the soil CO2 concentration in different soil layers (the humus horizon, A-, B-, C-horizon) in situ. The main instrument used in this experiment was silicon-based nondispersive infrared sensor, which could work in severe environment. We collected the Measurement value by NDIR spectroscopy technique throughout 2013. The values of soil carbon flux in different soil layers were calculated based on the model of gradient method and calibrated by measuring with an automated soil CO2 efflux system (LI-8100). The results showed that: a vertical gradient for the carbon dioxide concentration in soil profile was found, and the concentration was highest in the deepest soil horizon. Moreover, A linear correlation between the soil CO2 effluxes was calculated based on model and measurement, and the model prediction correlation coefficient was 0.9069, 0.7185, 0.8382, and 0.9030 in the H-, A-, B-, and C-horizon, respectively. The roots of mean square error (RMSE) were 0.2067, 0.1041, 0.0156, and 0.0096 in the H-, A-, B-, and C-horizon, respectively. These results suggest that the gradient method based on the NDIR spectroscopy technique can be successfully used to measure soil CO2 efflux in different soil layers, which reveal that diffusion and convection transport CO2 between the soil layers. It is a promising sensor for detecting CO2 concentration in soil profile, providing the basic data for calculating the global carbon in soil profile.