With the widespread application of sewage biological treatment technology, a large amount of sewage sludge is generated during the sewage treatment process, which not only poses a threat to the environment but also results in wastage of C and N resources. In this study, the nitrogen self-doped fluorescent carbon dots (N-CDs) with an average particle size of 3.43 nm were synthesized green through a two-stage hydrothermal method. It was found that N-CDs can detect Fe3+ through internal filtration effect (IFE), with a linear detection range of 0–250 μM and a detection limit of 2.207 μM. Furthermore, N-CDs can also serve as a “turn off–on” probe for monitoring Hg2+, with a linear detection range of 2–10 μM and a detection limit of 0.989 μM. Interestingly, oxygen-containing groups were shown to be sensitive to Hg2+, which has been demonstrated for the first time. Moreover, the practical application of N-CDs as a double ion sensor in the detection of Fe3+ and Hg2+ has achieved good results for real power plant wastewater.