Researchers at Stanford University have developed the Minority Report for battery fires.

Lithium ions short-circuiting and causing fires are a growing problem. In 2006, Sony recalled millions of laptops after many consumers said their devices caught fire. The culprit: metal and dust particles that had snuck into the batteries during manufacturing. Last year, the entire Boeing 787 Dreamliner fleet was grounded after a series of battery-related incidents. Given that more and more airplanes and electric cars are using lithium-ion batteries, even the fear of fires can do great damage to business bottom lines.

Yi Cui, a professor of materials science and engineering at Stanford, is keenly aware of the problem. “The likelihood of a bad thing like that happening is maybe one in a million,” he said in a release for the research. “That’s still a big problem, considering that hundreds of millions of computers and cellphones are sold each year. We want to lower the odds of a battery fire to one in a billion, or even to zero.”

The new technology works by employing a “smart separator” that detects short-circuiting before it happens. Normally, lithium-ion batteries contain a thin polymer that separates the anode from the cathode. The battery can short-circuit and ignite when that separator is damaged.

Cui and his team added a layer of copper to the separator that acts as a sensor, detecting when dendrites—potentially dangerous pile-ups of lithium metal—have reached the separator and will soon connect with the cathode, causing a short-circuit. When the dendrites contact the copper sensor, the voltage drops to zero, alerting you that your battery could soon explode unless you replace it.

If that’s too much battery talk for you, watch this helpful video: