Abstract
Fermented milk products such as amasi offer valuable nutritional and sensory benefits, but producers have traditionally used labour-intensive methods and manually monitored processes during production. This study presents an integrated Internet of Things (IoT) and machine learning (ML) framework for precision fermentation control, using low-cost sensors and real-time digital pairing. A Raspberry Pi-based platform continuously collects pH, temperature, and electrical conductivity (EC) data and transmits it to a cloud-hosted digital twin via RESTful APIs. EC was calibrated against total titratable acidity (TTA) using various ML models, with convolutional neural networks (CNN) achieving the highest global prediction accuracy (R2 = 0.9475), followed closely by feedforward neural networks (FNN) and Random Forests. We also developed a time-to-target acidity model, taking advantage of fermentation conditions and desired acidity levels, and achieved R2 = 0.98. The system maintained optimal fermentation through PID-controlled actuation of heating and stirring elements. The end-to-end pipeline was validated across seven fermentation runs, demonstrating high sensor consistency, scalable architecture, and practical deployment feasibility in resource-limited settings. This work highlights the potential of combining IoT, ML, and automated control for low-cost, real-time acidity management in artisanal dairy systems, with broader implications for precision agriculture and small-holder food innovation.