Foul smells are generally good indications of food gone bad, and now MIT chemists have developed a new sensor that does all that nasty smelling work for you. The portable and inexpensive device detects gases from meat, looking for chemical signatures associated with decaying meat products.

The researchers envision the sensor being used in “smart packaging” that could help provide more accurate information than an expiration date. Timothy Swager, a lead on the project, says not only can this sensor prevent people from eating spoiled meat, it can also prevent food waste. “People are constantly throwing things out that probably aren’t bad,” he says.

So what’s the secret ingredient in these spoil sensors? Carbon nanotubes–tube-like cylinders that are really good at conducting electricity. Swager and his team chemically modified the nanotubes to contain compounds that bind with amines. The amines putrescine and cadaverine are produced in decaying meat. So if you have a rather nasty cut of pork that’s been left in the fridge for far too long, the amines it produces will bind with the compounds in the sensor. This causes the electrical resistance of the carbon nanotubes to increase. The sensor on the package measures this, and a quick scan with a smartphone will warn carnivores before they make any unhealthy mis-steaks.

Though other sensors can detect when meat is decaying, this new sensor is unique in its small size and low cost. “The advantage we have is these are the cheapest, smallest, easiest-to-manufacture sensors,” Swager says. Before too long, you might be able to try this out for yourself. The new device doesn’t require much power, so it could be used wirelessly, and Swager’s lab has already developed a platform that allows smartphones to read the sensors.