When I worked in coffee shops and restaurants in the days of my youth, the phrase “Could you smell this milk and tell me if it’s bad?” was right up there with “Would you go check the rat traps?” When refrigerators broke down, the entire staff would mysteriously come down with the same cold — one that was totally not contagious but that definitely left them incapable of smelling anything.

Those epidemics may end if a group of engineers at the University of California, Berkeley and Taiwan’s National Chiao Tung University have their way. They’ve invented a way for your milk to tell you — via wireless — that it is going bad. Never let it be said that science isn’t serious about solving your everyday problems.

The group in question was studying how to use a 3D printer to print electrical and wireless components. In their quest, the engineers decided that the coolest test case of 3D printing electronics would be to print a circuit and a wireless sensor, and that the best test of the wireless sensor would involve spoiled milk.

Reader support helps sustain our work. Donate today to keep our climate news free. All donations DOUBLED!

The materials that work best in 3D printers tend to not be great for circuits, but the group got around that by 3D printing a mold that liquid metal could be poured into. Then the researchers used the components to build a so-called “smart cap” that could measure the tiny changes in electrical signals that are a sign of a whole lot of bacteria getting busy with the business of making more bacteria.

Grist thanks its sponsors. Become one.

The scientists took a container of milk, put a smart cap on it, shook it up, and left it outside for three days. The results, while only the tale of one milk carton (and its control milk carton, in a nearby refrigerator), were successful: The smart cap blabbed reliably to the scientists about the bacteria party going on inside the hot carton.

These researchers aren’t the only players in the “using sensors to detect food spoilage” scene. There’s the Finnish team working on spoiled fruit, and a team at Tufts working on edible fruit stickers that double as spoilage monitors. There’s the crew at MIT working on meat spoilage, and the U.S. Army, which is working on a portable food safety sensor.

At Grist, we’ve written about how food expiration dates are garbage. We’ve also written about how, if we figured out how to stop wasting food, we could feed everyone on the planet.

Grist thanks its sponsors. Become one.

What if supermarket produce could report the progress of its own ripeness to corporate HQ? What if food on the edge of its shelf life could tell a food bank to come pick it up? What if the head of broccoli buried under the leftovers in the back of your refrigerator could text you that it needs to be eaten for dinner, tonight? Liwei Lin, a professor in the Mechanical Engineering Department at Berkeley and one of the study’s authors, reports that the smart cap is reusable, which is a critical part of the whole sustainability aspect. This research, while still very pie-in-the-sky, is the kind that could wind up creating real environmental payoffs.