The palm-sized device designed by Qinetiq, the British defence firm that was once the government research laboratories, is pinned to the uniform and uses acoustic technology to calculate the exact position of the rifle fire.
Then a electronic voice passes on the "bearing and range" to the soldier allowing him to jump to safety and return fire.
The machine has already been purchased by the Americans for deployment in the New Year and the British are looking at a vehicle mounted version.
After roadside bombs, snipers have been the biggest cause of the 301 British fatalities in both wars, and army chiefs are convinced the device could save dozens of lives.
"It is all about saving guys' lives," said Don Steinman, one of the leaders of the project at Qinetiq North America who developed the device called EARS for Early Attack Reaction System.
"Knowing immediately where the shots come from means that it eliminates the confusion and allows soldiers to find cover and return fire.
"It helps to make combat scenarios, especially in urban areas, a lot less confusing. Everybody immediately knows what side of the vehicle or building to jump behind when taking fire."
The device, which costs around £2,500, works by isolating the crack of the sniper rifle thanks to four microphones, a GPS system and a powerful microprocessor.
It takes less than a tenth of a second and provides the results in audio and visual formats. It can even send a grid reference via radio to supporting artillery and aircraft.
The system, which weighs less than 6oz, is so sensitive it can tell the difference between outgoing friendly fire and incoming enemy fire and can distinguish a sniper even in a gun battle.
It also works when the soldier is travelling at up to 50 mph on a vehicle.
The device has already been road tested in Iraq and Afghanistan to claims of great success.
"The soldiers gave us feedback and we acted on it," said Mr Steinman. "The result is a powerful, rugged, and lightweight gunshot localization system that helps the individual warfighter rapidly respond to dangerous situations."
Although the range and accuracy of the device is kept secret for operational reasons Mr Steinman said they were well beyond the capabilities of a sniper.Original here