Abstract:Accurate liquid fill-level detection in transparent containers faces challenges from environmental interferences such as bubbles and wall-adhering droplets. Existing single-wavelength optical sensors and machine vision systems ex-hibit limitations in stability, operational cost, and maintenance complexity. This paper proposes a dual-wavelength (850 nm/1450 nm) optical sensor that utilizes differential light absorption characteristics to distinguish liquid levels from interference artifacts. The compact design integrates a bicolor light emitting diode (LED) and photodetector (PD), enhanced by an exponentially weighted moving average (EWMA) adaptive threshold algorithm to mitigate environmental drift and component aging. Experimental validation across 240,000 industrial trials demonstrates a 99.8% recall and a 0.12% false alarm rate (FAR), representing a 94% reduction in FAR compared to 1450 nm sensors and a 32% increase in precision over fixed-threshold dual-wavelength systems. With an F1-Score of 94.7%, the architecture optimally balances defect detection precision and operational efficiency, outperforming machine vision systems in cost-effectiveness despite slightly lower precision (90.1% vs. 91.6%). The sensor’s high detection reliability, ease of installation, and cost-effectiveness make it a promising solution for industrial applications in beverage and pharmaceutical packaging.