The goal of this research was to create a novel solution for in-flow milk control, automated alerting, and IoT data collection that can be implemented cost-efficiently on small farms to replace manual sample control with portable devices. The offered solution can control milk in-flow, working with any small size milking machine, to provide three main indicators: overmilking phase alert, milk temperature, subclinical mastitis probability indicator, and it has the capability for data collection. We developed a prototype using off-the-shelf available IoT technology, tested it on the farm with a portable milking machine, and verified the results with manual detector data. The test results demonstrated that the designed prototype provided reliable overmilking phase detection, reproducible milk temperature readings, and the subclinical mastitis condition diagnostic data were consistent with Draminski manual detector data