The sensor traces amounts of ammonia and another chemical released by food as it spoils.
And it can be read by your smartphone - if there's no ammonia, it responds.
But if there is ammonia, no response.
The sensors could be placed on food wrappers, replacing expiration dates.
The U.S. wastes nearly a third of its food supply every year.