Food waste is scandalous. The Save Food Initiative says that on average, one-third of the food produced each year is wasted. That comes to about 660 pounds of food per person per year in the developed countries, discarded and never eaten by anybody. Much of it occurs because consumers misunderstand use-by dates and shelf life information on food packaging. This mistake causes them to throw out food products that are still fit to consume.

Researchers at Massachusetts Institute of Technology (MIT) propose to do something about it with a sensor that can take the guesswork out of deciding whether meat or fish is “bad” or still safe to eat. The chemistry behind the way it works is complicated, but basically, the sensor uses modified carbon nanotubes to detect the presence of compounds that indicate decay.

These compounds—“putrescine” and “cadaverine”—couldn’t be more aptly named. But, if no hint of them is being displayed in the label or the package bearing the sensor, there’s no need to be nervous about the condition of the food. The developers at MIT have devised a similar application for fruit and vegetables: a sensor that, when attached to boxes of produce and scanned with a handheld device, gives a correct read on ripeness and thus lets grocers get a better idea of when to put items on sale before they start to “turn.”

The MIT team also believe it’s possible to use the same technology in NFC (near field communications) tags that can be read by smart phones turned into sniffers for ripeness and decay. If and when commercialized, the sensors and tags could be the basis of a new type of “smart packaging” aimed straight at the heart of the problem of food waste at both the retail and the consumer levels.

It surely would be a better approach than erring on the side of caution when 805 million of the world’s people—one in nine—go chronically hungry while the rest toss perfectly good packaged food away.