The current study aims to train and benchmark AI models tailored for the detection of microplastic in water from scattered signals. We trained two different models, the first based on a Multi-Layer Perceptron (MLP) and the second on a Gated Recurrent Unit (GRU). A Neural Architecture Search algorithm was used to determine the optimal configuration for each of the two models. Moreover, for deployment on edge devices, a specific custom-made compiler was designed and used. The compiler is specifically designed for TinyML applications and, therefore, for resource-constrained devices. It bypasses traditional inference engines, compiling the NNs to native C code using only standard C libraries. Our approach demonstrated better performance compared to state-of-the-art frameworks such as ONNX Runtime, achieving better latency, memory usage, energy consumption, and a higher portability. This highlights the potential of our method for efficient and effective microplastic detection in environmental monitoring.