Automated Ostwald viscometers relying on static optical sensors frequently experience missed or false triggers due to voltage baseline drift caused by fluid turbidity, wall fouling, or micro-bubbles. This study presents a discrete differential algorithm ( ) integrated with an exponential moving average (EMA) filter and adaptive baseline tracking on a low-cost photointerrupter setup. The phototransistor signal is digitized via an external 16-bit ADS1115 ADC ( ). The differential threshold is set at , established from a five-sigma ( ) margin above the instrument's baseline noise ( , peak ), combined with a voltage step and a 3-sample ( ) debounce confirmation. Dynamic flow tests at recorded mean efflux times of ( ) for 7 cycles of distilled water, ( ) for 5 cycles of 30% glycerin, and ( ) for 18 consecutive cycles of 2% bovine gelatin. The measured glycerin-to-water efflux time ratio ( ) agreed with the theoretical kinematic viscosity ratio ( ) derived from Hagen-Poiseuille law. Comparative benchmarking across 29 raw recorded cycles demonstrated that the proposed algorithm achieved an valid trigger rate ( ), whereas a conventional fixed-threshold comparator without recalibration yielded only ( ). The algorithm successfully filtered micro-bubble anomalies and maintained timing repeatability despite progressive baseline drift from gelatin wall residues, eliminating manual sensitivity recalibration.
Copyrights © 2026