Reactive dye alizarin red and ortho-phenylenediamine as raw materials, a novel carbon-based nanoparticle with dual-emission at 419 nm and 550 nm (DE-CNPs) was successfully synthesized through a hydrothermal process. The DE-CNPs exhibited distinct anti-quenching against extreme pH environments, and the integrated fluorescence color performed obvious pH dependence due to the alternating dominating of duel emissions. Besides qualified as a pH probe, the DE-CNPs were found further with high sensitivity and certain specificity for detecting metal ions in acid, base, or salt solutions. Typically, in a neutral aqueous solution, the initial yellow fluorescence transferred to blue for Cu2+/Pb2+/Cr3+, to white for Ag+/Fe3+, and to red for Al3+. Furthermore, gelatin was used as a restrictive matrix, and the DE-CNPs were embedded into the hydrogel network through physical crosslinking technology. Compared with nanoparticles, the hydrogel assembly (DE-CNPs@Gel) not only reserved original responding characteristics for detecting pH and metal ions, but also possessed better dispersity and processability as a practical candidate for the quality monitoring of water and soil.