Carbon dots (CDs) have excellent optical properties, low toxicity and easy preparation, which have led to them being widely used in biomedicine, sensing and optical devices. However, although great progress has been made in the preparation of CDs, the detailed exploration of their photoluminescence (PL) mechanism is still under debate due to their complex structures and surface functionalities. Here, we proposed a single change in the pH of the synthesis condition, which had no effect on the CDs intrinsic core states and avoided the mutual influence of multiple PL origins. The m-phenylenediamine (m−PD) served as a carbon source, whose protonation degree determined the surface state of the resulting CDs and the accompanying fluorescence characteristics. The as-obtained CDs materials can be applied in the chemical sensor and anti-counterfeiting fields in a targeted manner. Therefore, our work not only contributes to the explanation of the CDs PL mechanism, but also obtains a series of CDs materials with controllable PL properties.