The New York Police Department has started using a detection system that pinpoints the location of gunfire and sends the information to law enforcement, the latest move to modernize the nation’s largest police force, the department announced on Monday.

The system, called ShotSpotter, is used in several major cities. It works by installing sensors — basically, sensitive microphones — around an area to pick up sounds from the street that might be gunfire, and uses the sensors to locate where the shots were fired. It then sends the information to the Police Department.

As part of a pilot program, ShotSpotter sensors are being placed in seven precincts in the Bronx and 10 in Brooklyn, a total area of 15 square miles, where there have been a high number of shootings. The sensors in the Bronx began working shortly after midnight on Monday, and sent data on shots fired at 12:49 a.m. The sensors in Brooklyn will start collecting data shortly after midnight next Monday.

“Today, we are rolling out cutting edge technology to make the city safer, to make our neighborhoods safer, to keep our officers safer,” said Mayor Bill de Blasio, who appeared with William J. Bratton, the police commissioner, to announce the initiative. “This gunshot detection system is going to do a world of good in terms of going after the bad guys.”