Scientists have developed a keychain-like device that lets people test their food for common allergens and gives out results in just 10 minutes, according to a study published in ACS Nano.

Cutting short a process that takes bulky lab equipment and lots of time, researchers at Harvard Medical School have successfully created iEat (integrated exogenous antigen testing) detector – a portable device that you can carry in your pocket and test food items for allergens whenever and wherever you want.

The working of this device is pretty much neat. You just have to put a bit of food on to the "antigen extraction device" – a single-use slide – and plug into iEat, which will do necessary chemical destruction and analysis to detect whether any allergens are present. It will complete the process and send out test results to your phone within 10 minutes, which is not very fast but good enough to prevent a trip to the emergency room.

The handheld device, which is still in prototype stage, can successfully detect five allergens, one each from wheat, peanuts, hazelnuts, milk and egg whites. The best part is the whole thing, which can detect even smaller amounts of allergens than most laboratories, costs just $40 (£ 30.30).

The researchers tested the device in a restaurant and found some surprising examples of cross-contamination. For instance, gluten was detected in gluten-free salad and egg protein in beer. They also say the device could be configured to detect "additional compounds, including other allergens and non-food contaminants such as pesticides".

Food allergies have been a common cause of trouble for kids and adults. Usually, cross- contamination from offending food affects freshly prepared or packaged meals and triggers an immediate reaction, ruining a restaurant outing. In the worst case scenario, some antigens also trigger an anaphylactic shock, which has been classified as a serious medical emergency and can often prove life-threatening in some cases.