Hi Max, You are right, analog part is same as Spirit Pi...has good results.... The only modification is usage of a RPi Pico board witch will replace ESP32 board. Also, the principle of detection is different. Please check the flowchart of the application and try co corelate with the code. There is no interrupt usage, no time measurement and comparision. The basic is to read a voltage value witch is coming from a OpAmp at a fixed moment, and compare this value with the value that is obtained in calibration...