Cadarache: In the dusty highlands of Provence in southern France, workers have excavated a vast rectangular pit 17 metres (56 feet) down into the unforgiving rocks. From my raised vantage point, I can see bright yellow mechanical diggers and trucks buzzing around the edge of the pit, looking toy-like in the huge construction site. Above us, the fireball Sun dries the air at an unrelenting 37C.

These are embryonic stages to what is perhaps humankind's most ambitious scientific and engineering project: to replicate the Sun here on Earth.

When construction is complete, the pit will host a 73-metre-high machine (240 feet) that will attempt to create boundless energy by smashing hydrogen nuclei together, in much the same way as stars like our Sun do. Physicists have dreamed of being able to produce cheap, safe and plentiful energy through atomic fusion since the 1950s. Around the world, researchers continue to experiment with creating fusion energy using various methods. But as people within the field have said the dream has always been "30 years away" from realisation.

The need for a new energy source has never been more pressing. Global energy demand is expected to double by 2050, while the share coming from fossil fuels – currently 85% – needs to drop dramatically if we are to reduce carbon emissions and limit global warming.

Fusion, many believe, could be the answer. It works by forcing together two types, or isotopes, of hydrogen at such a high temperature that the positively charged atoms are able to overcome their mutual repulsion and fuse. The result of this fusion is an atom of helium plus a highly energetic neutron particle. Physicists aim to capture the energy released by these emitted neutrons, and use it to drive steam turbines and produce electricity.

When the reaction occurs in the core of the Sun, the giant ball of gas applies a strong gravitational pressure that helps force the hydrogen nuclei together. Here on Earth, any fusion reaction will have to take place at a tiny fraction of the scale of the Sun, without the benefit of its gravity. So to force hydrogen nuclei together on Earth, engineers need to build the reactor to withstand temperatures at least ten times that of the Sun – which means hundreds of millions of degrees.

Heated doughnuts

It's just one of the huge number of challenges facing the designers of this groundbreaking project. The concept was discussed and argued over for several decades before finally being agreed in 2007 as a multinational cooperation between the European Union, China, India, Japan, South Korea, Russia and the US – in total, 34 countries representing more than half of the world's population. Since then, the budget of 5 billion euros has trebled, the scale of the reactor has been halved, the completion date has been pushed back, and the project has somewhat lost its shine – which is somewhat ironic given the project is called Iter, meaning 'the way' in Latin.

But despite the difficulties, some progress is being made. The parts are being manufactured and tested by the participating nations, many of whom hope to develop the expertise to compete in any new fusion energy market that would be expected to follow a successful outcome at Iter.

Since they don't have access to the special conditions available in the Sun, physicists have designed a doughnut-shaped reaction chamber, called a tokamak. Hydrogen isotopes are heated to the point to which they lose electrons and form a plasma, and this is held in place for fusion but held away from the reactor walls, which could not withstand the heat. The tokamak deploys a powerful magnetic field to suspend and compress the hydrogen plasma using an electromagnet made of superconducting coils of a niobium tin alloy.

Once atomic fusion occurs, the heat produced will help to keep the core hot. But unlike a fission reaction that takes place in nuclear power stations and atomic bombs, the fusion reaction is not self perpetuating. It requires a constant input of material or else it quickly fizzles out, making the reaction far safer. And unlike what you might have seen in a recent Batman movie, the chamber cannot be transformed into a nuclear bomb. The neutrons will then be absorbed by the surrounding walls of the tokamak, transferring their energy to the walls as heat, and this in turn will be dissipated through cooling towers.

Because one of the hydrogen isotopes used, tritium, is radioactive (with a half-life of 12 years), the entire site must conform to France's strict nuclear safety laws. And to complicate matters further, the site is also moderately seismically active, meaning that the buildings are being supported on rubber pads to protect them from earthquakes.

These issues, plus the logistics of dealing with multiple nations with their own fluctuating domestic budget constraints, mean that the site won't be ready for the first experiments until 2020. Even then, they will just be testing the reactor and its equipment. The first proper fusion tests, reacting deuterium (a hydrogen isotope abundant in sea water) and tritium (which will be made from lithium), won't take place until 2028.

Power up

Those will be the key tests, though. If all goes to plan, the physicists hope to prove that they can produce ten times as much energy as the experiment requires. The plan is to use 50 megawatts (in heating the plasma and cooling the reactor), and get 500 MW out. Larger tokamaks should, theoretically, be able to deliver an even greater input to output power ratio, in the range of gigawatts.

And that is the big gamble. So far, the world's best and biggest tokamak, the JET experiment in the UK, hasn't even managed to break even, energy-wise. Its best ever result, in 1997, achieved a 16 MW output with a 25 MW input. Scale is an extremely important factor for tokamaks, though. Iter will be twice the size of JET, as well as featuring a number of design improvements.

If Iter is successful in its proof of principle mission, the first demonstration fusion plants will be built, capable of actually using and storing the energy generated for electricity production. These plants are slated to begin operation in about 2040 - around 30 years away, in fact...

Despite the seductive promise of finally getting a supply of electricity that's "too cheap to meter", the long wait to readiness and the fact that the technology remains unproven, means that many politicians are hesitant or even hostile to the expensive project. Additionally, because fusion energy won't be ready for decades, even if it works, other low-carbon energy sources must still be pursued in the short-term at least.

But if we do manage to replicate the Sun on Earth, the consequences would be spectacular. An era of genuinely cheap energy – both environmentally and financially, would have far reaching implications for everything from poverty reduction to conflict easement.

It’s exciting to think that the next generation could in some way be fusion powered – perhaps even within the lifetimes of the workman digging below me. But I can’t help but remember the 30-year rule.

Update (14/08): The original text contained factual inaccuracies regarding the fusion reaction within the reactor. This has now been rectified.

If you would like to comment on this article or anything else you have seen on Future, head over to our Facebook page or message us on Twitter.