The effects are all too familiar: a fancy dinner, some fine wine and then, a few hours later, a racing heart and a pounding headache. But a device developed by University of California, Berkeley, researchers could help avoid the dreaded "red wine headache." Chemists working with NASA-funded technology designed to find life on Mars have created a device they say can easily detect chemicals that many scientists believe can turn wine and other beloved indulgences into ingredients for agony. The chemicals, called biogenic amines, occur naturally in a wide variety of aged, pickled and fermented foods prized by gourmet palates, including wine, chocolate, cheese, olives, nuts and cured meats. "The food you eat is so unbelievably coupled with your body's chemistry," said Richard Mathies, who described his new technology in an article published Thursday in the journal Analytical Chemistry. Scientists have nominated several culprits for "red wine headache," including amines like tyramine and histamine, though no conclusions have been reached. Still, many specialists warn headache sufferers away from foods rich in amines, which can also trigger sudden episodes of high blood pressure, heart palpitations and elevated adrenaline levels. The detector could prove useful to those with amine sensitivity, said Beverly McCabe, a clinical dietitian and co-author of "Handbook of Food-Drug Interactions," a book cited by the article for its descriptions of the effects of amines on the brain. The prototype - the size of a small briefcase - uses a drop of wine to determine amine levels in five minutes, Mathies said. A startup company he co-founded is working to create a smaller device the size of a personal digital assistant that people could take to restaurants and test their favorite wines. The researchers found the highest amine levels in red wine and sake and the lowest in beer. For now, the device only works with liquids. Mathies suggests the device could be used to put amine levels on wine labels. "We're aware of the consumer demand for information. But that has to be tempered by the manner in which wine is made," said Wendell Lee, general counsel for the Wine Institute, a California industry trade group.