The harmful effects of nanoplastics (NPs) on both human health and the ecosystem have gained global attention. This study develops a photoelectrochemical-electrochemical (PEC-EC) dual-mode portable sensor based on CdS/CeO2 heterojunction for the rapid detection of polystyrene nanoplastics (PS NPs) in aquatic environments. The interaction and aggregation between protein and PS NPs, facilitated by hydrophobic properties, influence electron transfer, thereby enabling the detection of PS NPs. Integration of the sensor with a portable EC workstation controlled by a smartphone streamlines the detection process, yielding rapid and clear results, and enhancing convenience for detection. The sensor exhibits the advantages of high sensitivity, good repeatability, and exceptional portability. A wide detection linear range of 0.5–800 μg/mL accompanied by the detection limit of 0.38 ng/mL can be achieved. The relative standard deviation of the sensor for the inter-day (intra-day) precision are determined ranging from 0.4 % to 2.97 % (0.94 % to 4.65 %) in real water samples. Furthermore, the sensor features a self-checking function, establishing it as a dual-mode system that introduces a novel approach for smart detection of PS NPs, with substantial potential for assessing PS NPs pollution in aquatic environments.