We humans waste a whole lot of food.

According to the United Nations’ Food and Agriculture Organization, roughly one-third of food gets spoiled, which translates to about $1 trillion annually. At almost double the size of the US grocery industry, it’s safe to say we have a food waste problem.

One way to reduce food waste is to maintain optimal environmental conditions such as temperature, moisture levels, and UV exposure. If we could strike the right balance for these environmental factors during transport, in the warehouse, at retail or even in our homes, it would extend the life of our food and help to reduce waste significantly.

Normally this type of job is perfect for the Internet of Things. Today low-cost sensors are used everywhere to track a variety of conditions across the worlds of agriculture, warehousing and in grocery stores. But food is a particularly thorny challenge since it’s difficult to accurately monitor food conditions with sensors that are not consumable by humans.

But now there may be hope. That’s because a group of researchers led by Giovanni Salvatore at ETH Zurich have developed a biocompatible microsensor that can be directly applied to food and is safe to eat. The sensor is made from a combination of edible materials such as magnesium and a compostable polymer made with corn and food starch.

According to Salvatore, the sensors can be used in a variety of scenarios, including transportation of food on cargo ships. “In preparation for transport to Europe, fish from Japan could be fitted with tiny temperature sensors, allowing them to be continuously monitored to ensure they are kept at a cool enough temperature,” said Salvatore.

While these types of edible sensors hold lots of promise, we’re still a ways off from seeing them in everyday use. One issue is cost: making them is currently very expensive, compared to pennies or even fractions of pennies for traditional RFID tags. But the biggest challenge for this technology is bio-compatible sensors will still require a local transmitter to send signals to the outside world. That transmitter and power source would typically be something like a Bluetooth radio and battery, and as of today, researchers have not figured out how to make these systems digestible.

But according to Salvatore, that’s only a matter of time. Per Futurity:

Salvatore predicts that these biodegradable sensors will be part of our everyday lives within 5 to 10 years, depending on the level of interest shown by industry. By that time, the battery, processor, and transmitter would probably be integrated into the microsensor, Salvatore explains.

You can find the research paper from Salvatore and his team here and see a video produced by the team below.