BARRY, Wales - Though he did not know it at the time, the idea came to Howard Stapleton when he was 12 and visiting a factory with his father, a manufacturing executive in London. Opening the door to a room where workers were using high-frequency welding equipment, he found he could not bear to go inside.  Jonathan Player for The New York Times  Howard Stapleton, inventor of the Mosquito, with a speaker mounted on the wall behind him, at a store in Barry, Wales, where boisterous teenagers once gathered. The device projects a very shrill and very annoying tone that only youths can hear. Then they flee.  "What noise?" the grownups asked.  Now 39, Mr. Stapleton has taken the lesson he learned that day - that children can hear sounds at higher frequencies than adults can - to fashion a novel device that he hopes will provide a solution to the eternal problem of obstreperous teenagers who hang around outside stores and cause trouble.  The device, called the Mosquito ("It's small and annoying," Mr. Stapleton said), emits a high-frequency pulsing sound that, he says, can be heard by most people younger than 20 and almost no one older than 30. The sound is designed to so irritate young people that after several minutes, they cannot stand it and go away.  So far, the Mosquito has been road-tested in only one place, at the entrance to the Spar convenience store in this town in South Wales. Like birds perched on telephone wires, surly teenagers used to plant themselves on the railings just outside the door, smoking, drinking, shouting rude words at customers and making regular disruptive forays inside.  "On the low end of the scale, it would be intimidating for customers," said Robert Gough, who, with his parents, owns the store. "On the high end, they'd be in the shop fighting, stealing and assaulting the staff."  Mr. Gough (pronounced GUFF) planned to install a sound system that would blast classical music into the parking lot, another method known to horrify hang-out youths into dispersing, but never got around to it. But last month, Mr. Stapleton gave him a Mosquito for a free trial. The results were almost instantaneous. It was as if someone had used anti-teenager spray around the entrance, the way you might spray your sofas to keep pets off. Where disaffected youths used to congregate, now there is no one.  At first, members of the usual crowd tried to gather as normal, repeatedly going inside the store with their fingers in their ears and "begging me to turn it off," Mr. Gough said. But he held firm and neatly avoided possible aggressive confrontations: "I told them it was to keep birds away because of the bird flu epidemic."  A trip to Spar here in Barry confirmed the strange truth of the phenomenon. The Mosquito is positioned just outside the door. Although this reporter could not hear anything, being too old, several young people attested to the fact that yes, there was a noise, and yes, it was extremely annoying.  "It's loud and squeaky and it just goes through you," said Jodie Evans, 15, who was shopping at the store even though she was supposed to be in school. "It gets inside you."  Miss Evans and a 12-year-old friend who did not want to be interviewed were once part of a regular gang of loiterers, said Mr. Gough's father, Philip. "That little girl used to be a right pain, shouting abuse and bad language," he said of the 12-year-old. "Now she'll just come in, do her shopping and go."  Robert Gough, who said he could hear the noise even though he is 34, described it as "a pulsating chirp," the sort you might hear if you suffered from tinnitus. By way of demonstration, he emitted a batlike squeak that was indeed bothersome.  Mr. Stapleton, a security consultant whose experience in installing store alarms and the like alerted him to the gravity of the loitering problem, studied other teenage-repellents as part of his research. Some shops, for example, use "zit lamps," which drive teenagers away by casting a blue light onto their spotty skin, accentuating any whiteheads and other blemishes.  Using his children as guinea pigs, he tried a number of different noise and frequency levels, testing a single-toned unit before settling on a pulsating tone which, he said, is more unbearable, and which can be broadcast at 75 decibels, within government auditory-safety limits. "I didn't want to make it hurt," Mr. Stapleton said. "It just has to nag at them."  The device has not yet been tested by hearing experts.  Andrew King, a professor of neurophysiology at Oxford University, said in an e-mail interview that while the ability to hear high frequencies deteriorates with age, the change happens so gradually that many non-teenagers might well hear the Mosquito's noise. "Unless the store owners wish to sell their goods only to senior citizens," he wrote, "I doubt that this would work."  Mr. Stapleton argues, though, that it doesn't matter if people in their 20's and 30's can hear the Mosquito, since they are unlikely to be hanging out in front of stores, anyway.  It is too early to predict the device's future. Since an article about it appeared in The Grocer, a British trade magazine, Mr. Stapleton has become modestly famous, answering inquiries from hundreds of people and filling orders for dozens of the devices, not only in stores but also in places like railroad yards. He appeared recently on Richard & Judy, an Oprah-esque afternoon talk show, where the device successfully vexed all but one of the members of a girls' choir.  He is considering introducing a much louder unit that can be switched on in emergencies with a panic button. It would be most useful when youths swarm into stores and begin stealing en masse, a phenomenon known in Britain as steaming. The idea would be to blast them with such an unacceptably loud, high noise - a noise inaudible to older shoppers - that they would immediately leave.  "It's very difficult to shoplift," Mr. Stapleton said, "when you have your fingers in your ears."
A store in South Wales is using a kind of dog whistle to train young people to stay away.