A new device can tell whether a food product contains ingredients that can cause allergy. The device attaches itself to a phone and uses an application to test whether the food is safe to eat.

The device has been developed by researchers from University of California, Los Angeles.

The device, called iTube, weighs just two ounces and uses a common cell phone to detect allergens in food samples, according to a news release from UCLA. The device uses the cell phone's built-in camera, along with an accompanying smart-phone application to run the test.

About 8 percent of children and 2 percent of adults in the U.S. suffer from food allergy. Symptoms of food allergy can range from mild to severe. A severe allergic reaction can even cause death.

Although, processed foods have labels with information about the ingredients used in the product, sometimes allergy-causing ingredients may find a way into the product at the time of manufacturing or transportation.

The device doesn't just say whether or not the food has an ingredient that can cause allergy, but also tells its concentration.

To detect allergens, food samples are ground up and mixed in a test tube with hot water and extraction solvent. This mixture is allowed to cool for some time. The mixture is then mixed with a series of other reactive agents. When the concentration is ready, it is measured optically for allergen concentration via the iTube platform, using the phone's camera and the app that's running on the phone. The kit then converts the images from the camera into allergen concentration measurements detected in the food sample.

The device can detect a variety of allergens including peanuts, almonds, eggs, gluten and hazelnuts.

"We envision that this cell phone-based allergen testing platform could be very valuable, especially for parents, as well as for schools, restaurants and other public settings. Once successfully deployed in these settings, the big amount of data - as a function of both location and time - that this platform will continuously generate would indeed be priceless for consumers, food manufacturers, policymakers and researchers, among others," said Aydogan Ozcan from UCLA in a news release.

The study is published in the journal Lab on a Chip.