Pete Higgins developed the UWI label in hopes of reducing the amount of wasted food, as well as help consumers save money and prevent illness.
Working with scientists from Heriot-Watt University, Mr Higgins came up with the idea after almost serving out-of-date mayonnaise to his young son.
The UWI label (pronounced "yoo-way") reacts as soon as a food jar or packaging is opened and gives a clear and simple visual warning when the product is no longer safe to consume.
Mr Higgins said: "Everyone who sees the UWI Label instantly understands it and asks why something like this doesn't already exist.
Across the world, there is growing recognition that waste is a problem which must be tackled urgently - and food waste is a huge part of that.
"With the UWI Label we are not only giving consumers a foolproof way to ensure food is safe to eat, we are giving them a simple and reliable way to manage their food better to reduce waste.
"In the UK alone it is estimated we waste 11 billion worth of food ever year. As well as the cost to the environment, that costs every family in the country 680. The UWI Label could help dramatically reduce that."
The label shows green while the product is safe to use or consume, counting down to a red warning when it is not.
Mr Higgins said the technology could also be used on a number of products with a set shelf life once opened, including industrial glues and sealants, pharmaceuticals, cosmetics, blood transfusion services and veterinary.
The label can also be used on bottles or containers of high value alcohol and spirits in order to prevent counterfeiting.
Mr Higgins said he had made "serious financial sacrifices" to develop his invention, including the sale of his camper van. But he hoped it would soon be on supermarket shelves.
The UWI labels have been shortlisted along with two other inventions by judges of the Take One Small Step competition with a 50,000 prize.
The invention was unveiled as a new survey found one in ten people knowingly eat out-of-date produce
The poll of 2,000 people for pasta firm Giovanni Rana also found that 5 per cent of people defrosted food using alternative heating appliances including an iron, hairdryer and even a sunbed. A further 13 per cent of respondents admitted accidentally food poisoning themselves and their guests as a result of their cooking.