NASA is set to launch an incredible new atomic clock into orbit on a Falcon Heavy Monday (June 24) in a technology demonstration mission that could transform the way humans explore space.

The Deep Space Atomic Clock, developed by NASA's Jet Propulsion Laboratory, is a space-ready upgrade to the atomic clocks we use here on Earth and to the clocks that already fly on satellites like those that provide GPS.

Ideally, this new atomic clock will make spacecraft navigation to distant objects in space — on the journey to Mars, for example — more autonomous, NASA said in a statement. The precision in measurement of the spacecraft's position that scientists hope to get with the Deep Space Atomic Clock will allow spacecraft traveling in deep space to act on their own, without much communication with Earth. It'd be a huge improvement to how spacecraft are currently navigated, NASA said.

Related: This Is What 2 Dozen Satellites Look Like Packed for Launch on a SpaceX Falcon Heavy

But how does it work?

Astronomers already use clocks to navigate in space. They send a signal to the spacecraft, which sends it back to Earth. The time of that round trip tells scientists the spacecraft's distance from Earth. That's because the signal is traveling at the speed of light, so armed with the time it took to go to the spacecraft and back, finding distance is but a simple calculation away. By sending multiple signals over time, scientists can calculate a spacecraft's trajectory — both where it was and where it's going.

But in order to know a spacecraft's location within a small margin of error, astronomers need very precise clocks that can measure billionths of a second, according to NASA. They also need clocks that are extremely stable. "Stability" here refers to how consistently a clock measures a unit of time. While you'd think that clocks always measure the same length of time as a "second," clocks have a tendency to drift and slowly mark longer and longer times as a "second." For measuring the locations of spacecrafts in distant space, astronomers need their atomic clocks to be consistent to better than a billionth of a second over days and weeks.

Modern clocks, from those we wear on our wrists to those used on satellites, most often keep time using a quartz crystal oscillator. These take advantage of the fact that quartz crystals vibrate at a precise frequency when voltage is applied to them, NASA said in the statement. The vibrations act like the pendulum in a grandfather clock.

But, by the standards of space navigation, quartz crystal clocks aren't very stable at all. After six weeks, they may be off by a full millisecond, which translates at the speed of light to 185 miles (300 kilometers). That much error would have a huge impact on measuring the position of a fast-moving spacecraft, NASA said.

Atomic clocks combine quartz crystal oscillators with certain types of atoms to create better stability. NASA's Deep Space Atomic Clock will use mercury atoms and be off by less than a nanosecond after four days and less than a microsecond after 10 years. It would take 10 million years for the clock to be wrong by a whole second, according to NASA.

Related: A NASA Atomic Clock on SpaceX's Next Falcon Heavy Will Pioneer Deep-Space Travel Tech

It may not be surprising to learn that atomic clocks take advantage of the structure of atoms, which are composed of a nucleus of protons and neutrons surrounded by electrons. The atoms of each element have a distinct structure, with a different number of protons in the nucleus. While the number of electrons each type of atom has can vary, the electrons occupy distinct energy levels, and a jolt of exactly the right amount of energy can cause an electron to jump to a higher energy level around the nucleus.

The energy required to make an electron do this jump is unique to each element and consistent to all atoms of that element. "The fact that the energy difference between these orbits is such a precise and stable value is really the key ingredient for atomic clocks," Eric Burt, an atomic clock physicist at JPL, said in the statement. "It's the reason atomic clocks can reach a performance level beyond mechanical clocks."

In essence, atomic clocks can correct themselves. In an atomic clock, the frequency of the quartz oscillator is transformed into the frequency that is applied to a collection of atoms from a specific element. If the frequency is correct, it will cause many electrons in the atoms to jump energy levels. But if it's not, fewer electrons will jump. That tells the clock that the quartz oscillator is off-frequency and how much to correct it. On the Deep Space Atomic Clock, this correction is calculated and applied to the quartz oscillator every few seconds.

But that's not all that makes the Deep Space Atomic Clock special. This clock doesn't just use mercury atoms, it also uses charged mercury ions.

Because ions are atoms that have electric charge, they can be contained in an electromagnetic "trap." This keeps the atoms from interacting with the walls of a vacuum chamber, a common problem with the neutral atoms used in regular atomic clocks. When they interact with the vacuum walls, environmental changes such as temperature can cause changes in the atoms themselves, and lead to frequency errors.

The Deep Space Atomic Clock won't be subject to such environmental changes, according to NASA, and so will be 50 times more stable than the clocks used on GPS satellites. After the clock launches Monday, scientists will be able to begin testing the clock's precision as it spends days, then months in orbit.

The Deep Space Atomic Clock will launch from Kennedy Space Center in Florida on a SpaceX Falcon Heavy rocket as one of two dozen payloads. The 4-hour launch window opens at 11:30 p.m. EDT (0330 June 25 GMT); visit Space.com tomorrow for complete coverage of the launch.

Follow Kasandra @KassieBrabaw. Follow us on Twitter @Spacedotcom and on Facebook.

SIGN UP FOR THE MACH NEWSLETTER AND FOLLOW NBC NEWS MACH ON TWITTER, FACEBOOK, AND INSTAGRAM.