This maybe sounds obvious, but you can’t charge your spacecraft with an extra long power cord — which is why batteries are clutch for space, powering everything from electric tools and spacesuits to satellites and planetary rovers. But sending a battery into the cosmos means more than just loading it onto a rocket: batteries must be built to withstand the extreme temperatures of the space environment, and they also have to be packaged so that they don’t harm any astronauts if they accidentally explode.

Many deep-space vessels are equipped with solar panels for power, so most space batteries are used for storing energy on spacecraft to use when the Sun is out of sight. That happens when these vehicles temporarily pass between a planet and the Sun, for instance, blocking light from view. Batteries are crucial for keeping the vehicle powered until sunlight remerges. But batteries also power the life support systems on astronauts’ spacesuits, as well as tools and other portable electric items needed to repair the outside of the International Space Station.

When batteries are used in human spaceflight, NASA is especially concerned about safety

When batteries are used in human spaceflight, NASA is especially concerned about safety. That’s because lithium-ion batteries have become the power pack of choice in space, just like here on Earth. Lithium-ion is perhaps the most powerful battery type available, but it comes with a risk called thermal runaway — when defects or mishandling causes a battery to overheat and explode.

If a battery were to catch fire inside a pressurized capsule, such as the space station, the results could be devastating. Fire inside such an oxygen-rich environment would be literally explosive and “very definitely catastrophic,” Christopher Iannello, an electrical power expert in the NASA Technical Fellows Office, tells The Verge. “It’s a potential loss of life situation.”

However, NASA has figured out ways to package lithium-ion batteries so that a thermal runaway event would not be a total tragedy on the ISS. Before they’re sent to space, these batteries are carefully outfitted with various materials and technologies, designed to prevent them from spewing heat, smoke, and fire if they were to combust.

NASA didn’t always have to worry about exploding batteries. The space agency used to rely on older battery types, like nickel-metal hydride or nickel hydrogen — the main type of battery used for storing energy on the ISS. But as lithium-ion batteries started to take over on the surface of Earth, NASA and other aerospace companies started incorporating them into their vehicles as well. “You can’t really buy [nickel hydrogen] from anyone anymore, because the market has just been taken over by lithium-ion,” Eric Darcy, a battery design expert at NASA’s Johnson Space Center, tells The Verge. Nowadays, if the space agency needs a battery, it will use standard off-the-shelf lithium-ion 18650 cells — the same kind used in electric cars — and package them for space. NASA has even begun swapping out the nickel hydrogen batteries on the ISS for newer lithium-ion ones.

The advantages of lithium-ion are especially juicy for NASA because these kinds of batteries blow their predecessors away in terms of power: a commercially made lithium-ion battery cell is about three times as powerful as a nickel-metal hydride cell. Lithium-ion batteries also pack a lot of power into a relatively small and lightweight cell. That’s crucial for spaceflight, when every single pound is critical. The heavier a spacecraft, the more energy — and money — is needed to launch it into space. Having smaller batteries on space-bound vehicles saves weight and room, allowing for other, more important instruments to be added.

Lithium-ion batteries also last longer than other spaceflight batteries. The Russian Soyuz capsule, used to transport astronauts to and from the ISS, uses silver-zinc batteries that last only a few months. That’s partially why the Soyuz has to return to Earth every six months: its batteries won’t last much longer. Meanwhile, the lithium-ion batteries currently powering the life support systems on NASA’s space suits are 11 years old and have barely degraded, according to Darcy. On top of that, lithium-ion has a great cycle life, meaning they can be charged up and discharged over and over before failing. This is especially important for satellites in low orbits around Earth, which go in and out of sight of the Sun 16 times a day. And to top it all off, lithium-ion isn’t really affected by the high levels of radiation found in the space environment.

All of these benefits are a trade-off with the risk of explosion, which can’t be totally removed. Thermal runaway can occur if a battery gets too hot, so NASA does try to mitigate that risk. Also, to protect batteries from the extreme fluctuations of space, heaters are added throughout the battery’s cells to regulate their temperature.

“A critical hazard as opposed to a catastrophic hazard.”

Battery screening is also key for NASA to weed out any defects in cells that might cause thermal runaway. But all the screening in the world can’t catch every defect. Sometimes cells are manufactured with a latent flaw that only manifests over time in the battery as it’s charged up and discharged, according to Darcy.

So when a battery is being used on a human spaceflight mission, it must be packaged carefully to keep astronauts safe. Specifically, NASA wants to make sure that if one cell within a battery goes up in flames, it doesn’t spread to all the other hundreds of cells inside that same battery. “It’s about allowing the battery design to be tolerant, so that makes it a critical hazard as opposed to a catastrophic hazard,” says Darcy.

That’s why Darcy has five crucial guidelines for how to package a battery that’s going on a human spaceflight mission. First, engineers have to assume that a cell will explode in an unpredictable way. Usually lithium-ion cells are designed so that if they do catch fire, they’ll spew their contents through a designated vent of some kind. But Darcy says you must consider the possibility that a cell blows through its casing instead. To prevent that, engineers put steel tubes around the cells to contain them if they burst apart in a weird way.

Another rule is to provide enough separation between the cells inside a battery, so that if one goes up in flames, it’s not in direct contact with the other cells. Otherwise, a bad cell could easily affect its neighboring cells. Materials need to be added between the cells to act as a heat sink, stopping high temperatures from moving beyond an exploding cell. Aluminum has been shown to be a good material for that.

The third rule only applies to batteries with cells that are connected in a specific way. Battery cells can either be connected together in series or in parallel; cells in series have much higher voltage and power, while cells connected in parallel have a higher capacity and are able to deliver more power over a longer period of time. NASA’s battery configuration — series or parallel — varies by mission. But whenever cells are connected in parallel on a human spaceflight mission, that poses an extra safety risk. If a cell starts to go haywire in parallel, it will start heating internally and can potentially spread that heat to the other cells. That’s why NASA must include fusible links between these cells in parallel. These fuses act like off switches; they’ll automatically open during thermal runaway and isolate the bad egg from affecting other cells nearby.

“There’s never been — thank god — an in-flight thermal runaway event, but we have a plan for that.”

The last two rules are all about taking care of the smoke and flames coming from an exploding cell. Darcy says you want to include a chimney path in your batteries that will funnel all of the hot molten material and smoke out of the pack. If any of that material lands on a neighbor, it could cause another cell to combust. And finally, you need something to douse the flames coming out of that chimney. NASA is very concerned with fire spreading inside the ISS, as fire behaves differently in the absence of Earth’s gravity. So engineers make sure that only smoke will escape a failing battery pack.

All of these add-ons do have penalties. They add about 20 percent more weight to the battery and make it about 50 percent bigger in size, according to Darcy. This can be challenging when you need a battery for something small, like the astronauts’ pistol grip tool. However, even with all of these needs to be addressed, Darcy says there is still a net benefit to using lithium ion. “Even though we have to add some volume, add some weight to the lithium-ion in order to make it safe and acceptable for [human] missions, it’s still a significant net advantage” over other batteries, he says.

These are just the standards for human spaceflight batteries, though. When lithium-ion batteries are included in robotic missions, such as on planetary spacecraft or rovers, engineers don’t necessarily have to add all of this special packaging. The cells can be kept closer together, for instance, because an explosion won’t be a matter of life and death. However, thermal runaway could lead to the end of a mission. “It’s just accepting more risk,” says Darcy. “We do more screening than anybody else does, and we still accept that risk.”

Fortunately, the chances of a commercial lithium-ion battery exploding due to an unknown defect is less than one in 1 million, according to Darcy. But NASA won’t take any chances when its astronauts are involved. “There’s never been — thank god — an in-flight thermal runaway event, but we have a plan for that,” says Iannello.