An electrochemical sensor based on Zinc oxide nanoparticles (ZnONPs) modified carbon paste electrode was designed for the toxic diuron pesticide detection. The ZnONPs were synthesized through the hydrothermal route and their structural properties were investigated via scanning electron microscopy (SEM) and X‐ray diffraction powder (XRD). The designed ZnONPs‐modified carbon paste electrode (ZnONPs‐CPE) was characterized using cyclic voltammetry and electrochemical impedance spectroscopy. The sensor showed significantly enhanced sensitivity on the diuron oxidation peak current, compared to the bare carbon paste electrode. Qualitative and quantitative analysis were performed using cyclic voltammetry (CV) and square wave voltammetry (SWV). Experimental parameters such as pH, amount of ZnONPs and frequency were evaluated and the optimized conditions were obtained with 0.1 M phosphate buffer solution at pH=8, a frequency of 50 Hz and a quantity of 5 mg of ZnONPs. Under these conditions, linear responses ranging from 1.3 to 7.7 μM and 8.6 to 30 μM of diuron were obtained, with correlation coefficients of R2=0.994 and 0.996 respectively. Detection and quantification limits of 0.22 μM and 0.84 μM (S/N=3) were respectively achieved based on the 3σ method. The interference of some ions on the oxidation peak of diuron on ZnONPs‐CPE was also evaluated and no interference was observed, therefore demonstrating the selectivity of the sensor. The proposed sensor, designed with ecofriendly materials, is sensitive, selective and was effectively used for diuron determination in soils and water samples with recoveries ranging from 98 % to 101.5 %.