Police may soon start using electronic guns that can track how, when and where the weapons are used, which could lead to greater accountability in investigations of police shootings.

The firearms technology company Yardarm Technologies has developed a new product that can record crucial information about when, where and how police officers use their firearms. This technology could be a welcome tool amid growing criticism of heavy-handed police tactics in the U.S., which were exemplified by the controversy around the police shooting of 18-year-old Michael Brown in Ferguson, Missouri, in August.

Yardarm’s new system can recognize and record things such as when the weapon is unholstered, when a magazine is inserted, when the first bullet enters the chamber and when and (roughly) where the weapon is fired, company spokesman Jim Schaff told The Huffington Post. Soon, Yardarm plans to give the gun the ability to know the direction and angle of each shot, Schaff said.

Why is it important to know this information? The system can provide an objective record of an incident in which a police officer used his weapon, Schaff said, which could be helpful in an investigation. He added that it "goes both ways" -- the data could also be used to exonerate an officer accused of misconduct, or to prosecute a criminal in a court of law.

“We’re there to show what happened, to make an accurate reporting of the event, so that it can be used as necessary after the fact,” Schaff said.

Earlier this month, the Santa Cruz County Sheriff’s Department and the Carrollton, Texas, Police Department began equipping some of their officers’ Glocks with the new technology, Yardarm stated in a press release Friday.

“We’re looking forward to what we believe law enforcement is heading towards,” Carrollton Police Sgt. Wes Rutherford told HuffPost. “We thought we might be interested in purchasing this in the future.”

Schaff added that the technology can be also be used to keep police officers safer. When an officer draws his weapon, for example, the gun will send an alert to the police command center and to nearby officers, alerting them to a potentially dangerous situation.

Yardarm does not manufacture an actual gun, but a two-inch long device that fits into the grip of an existing gun. That device detects the gun’s every movement through high-powered motion sensors known as accelerometers.

“It’s the same kind of sensor your iPhone uses to change the screen from vertical to horizontal when you turn the phone to the side,” Schaff said. “But ours is way more powerful.”

Currently, for the sensor to work, an officer must be carrying a smartphone. That’s because the device sends a signal through the officer’s phone and then on to Yardarm’s data servers in Washington and Texas, where the information is stored for future use.

The SENSOR can also detect, to a limited extent, where each shot is fired in relation to the shots that were previously fired. “If you fire a shot and then moved laterally ten feet and fired another, we’d know that you moved,” Schaff said. “But three feet? Maybe not.”

Rutherford noted that the sensor could be helpful in an event where an officer uses his gun on a civilian. “Whenever we investigate an officer-involved shooting, we look for every particular avenue that we can, to obtain the objective information, in order to piece together the whole puzzle of what happened,” he said. “So it could absolutely help, yes.”

Dashboard cameras, which became popular in the 1990s, have also proven useful for providing an objective record of problematic encounters between civilians and police: Camera footage often helps cut through the he-said-she-said chatter that inevitably accompanies allegations of police misconduct.

But there is a welter of issues with police recording themselves on the job, including privacy concerns and the nation’s complicated patchwork of consent laws. Another problem is that video footage isn’t always as reliable as we think. “Sometimes there can be multiple gunshots and it will sound like one, because they cover each other up,” said David Harris, a law professor at the University of Pittsburgh and a police accountability expert.

And even though dashboard cameras have been around for years, they still aren’t used in some places in the United States. Body-worn cameras, a much newer concept, are hardly used at all, though more cities are starting to consider them.

For as long as police officers have carried guns, advocates have bemoaned the lack of data and accountability regarding police shootings. To date, there is still no official data on how many people are shot by cops in the United States every year.

Gun tracking technology like Yardarm's would add to the amount of data available to law enforcement officers and courts about controversial officer-involved shootings. Knowing where and when each shot is fired could bring greater transparency to investigations of these episodes.

In Brown's case, the version of events recounted by Darren Wilson, the officer who shot him, has at times been at odds with accounts from witnesses. But it’s not clear that the sequence of events would be any less hazy if Wilson had been using Yardarm’s technology.

“Cameras and sensors on weapons would represent a quantum leap forward in policing and accountability,” said Kirsten John Foy, a civil rights advocate who is also the Northeast Regional Director of the Rev. Al Sharpton’s National Action Network. “But technology has its limitations as well. You can’t understand a person’s intent, a person’s mindset, or the circumstances which that officer felt made it necessary to use deadly force. It won’t record those things."

"So I think we have to be mindful that policing is not just a science, it’s also an art form," he added. "And there are other factors that have to be taken into account.”

This isn't the first time Yardarm Technologies has attempted to develop a firearm to help address public safety issues. After the 2012 shooting at Sandy Hook Elementary School in Newtown, Connecticut, Yardarm set out to create a consumer "smart gun" that could be remotely disabled using an app. But the company abandoned that plan when it realized how politically controversial the idea was. Compared to the consumer market, Yardarm encountered much less resistance marketing its technologies to law enforcement, Schaff told HuffPost earlier this year.