Sitting down to eat a meal you didn't prepare yourself can be risky when you have a food allergy, so how are you supposed to know if it's safe to eat?

UCLA's Henry Samueli School of Engineering and Applied Science may have come up with a solution in the form of an analyzer which connects to your smartphone and detects any possible allergens in your food.

Using the iTube to detect the presence of nuts, eggs, gluten, or other allergens first requires a sample to be ground up and mixed with water and an extraction solvent for a few minutes, followed by a series of other chemicals in a step-by-step process. The resulting mixture is then visually analyzed by a custom app using the smartphone's camera which can actually determine the concentration of the allergen in the food, not just whether or not it's present.

All-in-all the test takes about 20 minutes to complete with the current version of the hardware. And while its performance will certainly be improved over time, if you have dangerous food allergies that's not a terribly long time to wait if it guarantees you won't suffer a terrible reaction.