A fluorescence switching sensor is first applied to sensitive detection of sinapine based on CDs. The sensor is realized based on the high quenching and affinity of Cu2+ toward CDs and sinapine. This sensor offers a simple, highly sensitive and selective method for the sinapine detection.