The use of natural materials, a renewable resource, instead of chemicals as carbon precursors for simple synthesis of fluorescent carbon dots (FCDs) remains a significant challenge. Here, we report the preparation of FCDs with a photoluminescence (PL) quantum yield (QY) of 10.58% from peanut shells via one-pot pyrolysis treatment optimized by using a central composite experiment design. Optimum pyrolysis conditions were found to be 400 °C temperature, 4 h duration, and 70 g peanut shell weight. The as-prepared FCDs possess unique excitation-dependent behavior, good water dispersibility and high photostability. The results of Fourier transform infrared (FTIR) spectroscopy to analyze the pyrolytic process indicated the complete combustion of peanut shells happened at 3 and 4 h at 400 °C. The PL intensity of the FCDs was not always proportional to the corresponding QY value in our work due to the different amount of carbon-rich residues after the pyrolysis process. Fluorescence-quenching trials were conducted to analyze their sensitivity and selectivity in Cu2+ detection. The detection limit was found to be 4.8 μM. Our pyrolysis treatment of peanut shells for preparing FCDs is not only a green and facile method but also a means of recycling peanut shells.