Researchers have developed a new address that can pinpoint, in real-time, the moment at which milk spoils inside a carton. In their new study, appear in the journal Food Control, they advance that if their apparatus is chip into the caps of milk containers, it could one day alter less-accurate sell-by-dates – and save a huge abundance of milk from being wasted every year.

Milk goes off because of microbial growth that occurs over time, abounding accretion amounts of airy amoebic compounds (VOCs) – such as aldehydes and ketones – that change the liquid’s flavor and smell.  The researchers’ apparatus is premised on the idea that if we could detect these compounds as they accumulate, it would cue us on when milk has accomplished its peak.

To do this as cheaply and calmly as possible, the advisers created article called a ‘colorimetric sensor’ made from just two ingredients: Schiff’s reagent, a actuality which changes color when it detects airy amoebic compounds; and silicon dioxide, a mineral which can be ground down into nanoparticles, creating a large apparent area and a acceptable substrate.

They coated a fine layer of the silicon dioxide nanoparticles with the reagent, and then hovered the admixture over several altered samples of milk, which were stored at temperatures amid 7 ? and 19 ?. They found that as the milk accomplished its peak and began to turn – a action that predictably took longer under lower temperatures, and quicker at high temperatures – the reagent-coated nanoparticles afflicted acutely from a pink to purple hue.

To check whether this color change truly signaled that the milk was off, the advisers took alongside abstracts of bacterial growth, and the abundance of airy amoebic compounds, in the milk samples. This accepted that the color switching accumbent with absolute concentrations of bacilli and VOC levels that are known to cause accident in milk.

This meant that the color-changing apparatus could accurately reveal when milk stored at assorted temperatures was no longer fit to be consumed.

Such measures could be hugely valuable, because the Food and Agriculture Organization has estimated that globally, 20 percent of dairy products are wasted each year – and a huge chunk of that is made up of wasted milk. This occurs partly because sell-by-dates can’t accurately adumbrate when milk will absolutely go off. “The cessation date on cold or frozen articles is only authentic if it has been stored at the actual temperature the entire time,” the study’s authors explain. Variable storage, or gaps in refrigeration, might affect the accurateness of that date. In turn, this causes people to delay arresting milk because they think it’ll still be fresh for days, or it might even cause consumers to throw out milk before it’s absolutely gone off.

But having a sensor that monitors milk’s bloom in real-time – and which is easily arresting to consumers in the lid of a carton – could potentially save gallons and gallons from being glugged down the drain.

The advisers now say they’re alive on fine-tuning their invention: instead of just absolute whether milk is fresh or baby – as the accepted sensor does – they want to advance a more aesthetic tool that shows consumers how many days are left before milk goes off. If they can achieve that, and the dairy industry takes notice, it looks like we’ll be headed for a future of smart milk.

Read next: Get ready for the great Huawei-Android war of ability