Abstract:This study systematically optimized the sample preparation conditions for the detection of heavy metals in plant using Energy Dispersive X-ray Fluorescence Spectrometry (EDXRF). Three kinds of typical plant samples differing in components, including wheat, soybean, and Sedum plumbizincicola were selected. The effects of sample particle size, pelletizing pressure, sample thickness, and detection time on the detection accuracy of cadmium (Cd) and other heavy metals by EDXRF were systematically investigated. The results showed that 100-mesh particle size significantly enhanced sample homogeneity and reduced the relative error of Cd detection in wheat and soybeans to < 5%; The optimal pelletizing pressures for wheat, soybeans and S. plumbizincicola samples were 2, 3 and 4 MPa, respectively. High pressure increased relative error in soybeans due to oil seepage; Low-Cd samples (wheat, soybeans) required a pellet thickness of 5 mm, while high-Cd of S. plumbizincicola required only 2.5 mm for minimum detection error; The required detection time was ≥ 300 s for low-Cd samples (error reduced from 30.1% at 60 s to 9.7% at 300 s) and only 60 s for S. plumbizincicola. Using the optimized detection parameters, the Cd detection limit was 0.08 mg/kg for the certified reference material GBW08503c, with a recovery rate of 95.2%. These results comply with food safety standards (GB 2762-2022). This study provides sample preparation parameters for accurately determining metal concentrations in plant using EDXRF, significantly enhancing detection accuracy and applicability.