The focus of this study is on investigating the reaction mechanisms of various gas molecules on TiO2 surfaces. This study utilizes the DFT method-based first- principle calculation by employing quantum chemistry software such as VASP and Gaussian. The basic idea behind this dye-sensitized solar cells study is to use dye as the TiO2 substrate film. The key role in the electron transfer between the dye film and TiO2 is the functional group RCOO for dye-sensitized solar cells. It is important to understand the adsorption characteristics and physical properties (e.g. its band structure) of various TiO2 anchoring groups. This study investigates the dissociative adsorption mechanism of the N- or B- doped TiO2 which use HN3, NH3, or BClx (x=1~3) as the precursor.