The first sign of trouble came when the Eagle was five minutes into its descent, 33,500ft above the Moon's surface. A shrill alarm rang through the cramped, seatless cabin in which two astronauts stood facing the stars. An error message flashed up on their primitive computer's tiny read-out: "1202". Neither Neil Armstrong nor Buzz Aldrin knew what it meant. It was left to Steve Bales, a 26-year-old technician at Mission Control in Houston to decide they should keep going. The error, he was fairly sure, would fix itself, and he repeatedly called "Go!" as the alarm sounded four more times.

Armstrong later said it was the computer glitch that kept him from dealing with a much more serious problem: when the descent had begun, before they rolled so they were face up, the Apollo 11 astronauts had noticed they were passing landmarks four seconds early. After the lunar module rocked forward, to point the engine nozzle straight down to feather their descent, they should have been able to see their smooth, flat landing site in the Sea of Tranquillity below. But Armstrong recognised nothing when he looked out of his window; the autopilot had taken them four miles beyond their target. "We were landing just short of a large crater with very large rocks covering a high percentage of the surface," he recalled.

Ten minutes after beginning their descent from orbit, at an altitude of 500ft, Armstrong switched to manual control. His heart rate leapt from 77bpm to 156bpm as he set the engine to hover and sought a safe place to touch down. To his right, Aldrin called out their altitude, rate of descent and forward speed, his hand never far from the button that would explosively abort the landing. Then he added a number: "90 seconds" – the time until their landing fuel ran out. Finally, among the rubble ejected from the crater by a meteor impact millions of years ago, the mission commander saw a gap. Tilting the lunar module, they drifted to port.

Download the new Independent Premium app Sharing the full story, not just the headlines

At Mission Control, Gene Kranz, the flight director, turned to Charlie Duke, the astronaut charged with communicating with the crew. "Better remind them there ain't no damn gas stations on the Moon," he said. Duke's warning was more concise: "30 seconds." Aldrin's tense voice crackled back: "Light's on," referring to the low fuel signal. "Thirty feet... Kicking up some dust... Faint shadow... Contact light." They were down, with just enough fuel left for 16 seconds of flight – less than the time it took you to read this paragraph.

For a 10-year-old boy, nervously fidgeting around his living-room, confirmation came from Armstrong: "Houston, Tranquillity Base here. The Eagle has landed." It was 8.17pm GMT on 20 July 1969. I remember whooping and jumping on and off the sofa in a scene much like the one at Mission Control. The 12-minute descent had been an agony of suspense. There had been no pictures of the descent to watch, and between the distortion of the communications and the technical jargon, the astronaut's funny accents had conveyed no meaning.

I knew nothing then about how close my heroes had come to disaster. The computer alarm was later blamed on a radar dish which had been left switched on, overloading the tiny computer. (Your mobile phone is about a million times more powerful.) The navigational error was caused by "masscons" – the Moon, like the Earth, is less than perfectly spherical, so its gravity fluctuates as you fly over it. Mass concentrations had pulled the Eagle into a slightly lower orbit, speeding it up, and it was already going at more than one mile a second.

What I did know about Apollo 11 was still pretty impressive for a 10-year-old. I knew, for example, that the 363ft Saturn V rocket was one foot shorter than the dome on St Paul's Cathedral. I knew the velocity required to escape the Earth's gravity (seven miles per second), the distance to the Moon (239,000 miles) and the time lag as radio signals travelled there and back (three seconds). Years before the word was invented, I was a geek – a space geek. I knew that the age I was growing up in was neither Modern nor Atomic, nor Post-War. It was the Space Age, and the arrival of men on the Moon, even if they were, disappointingly, not British, was its defining moment. By the time I was an adult, I knew lunar trips would be as routine as taking a jumbo jet from London to New York.

So the past 40 years have been a bit of a letdown, a point I tactfully made to David Scott, commander of Apollo 15, when he visited London last month to open a new ride at the Science Museum. Where was Moon Base One, I demanded. Why couldn't I just buy a ticket on the internet for a discount break on a space station? "We made it look too easy," said Scott, the seventh of 12 men to walk on the Moon. "Put it in perspective," he said, comparing the Apollo missions to the gradual discovery of the Americas. "Columbus has just returned but Cabot and Magellan have not yet made their voyages. And Cook hasn't even been born." He's right about Captain James Cook, but John Cabot and Ferdinand Magellan both sailed within 40 years of Columbus.

I'm not about to argue. Aged 77, Scott is still a commanding figure, tall with a distinguished head of grey hair. He flew with Armstrong in Gemini 8 and was the command module pilot in Apollo 9. On his lapel he wears a gold astronaut's pin, a shooting star rising to orbit on three streaks. He must have heard the same questions 1,000 times, yet he answers patiently. Moon rocks feel as though they're made from Styrofoam, he tells one young lad. To me, he describes flying the lunar module as "like trying to run on an ice-covered pond and turn without skates. It's more difficult than any plane I ever flew," he says. "You 'zone' like an Olympic athlete. You're totally focused." Then the former test pilot thinks of a better metaphor: "It's like riding a pogo stick on a trampoline."

Daily coronavirus briefing No hype, just the advice and analysis you need Enter your email address Continue Continue Please enter an email address Email address is invalid Fill out this field Email address is invalid Email already exists. Log in to update your newsletter preferences Register with your social account or click here to log in I would like to receive morning headlines Monday - Friday plus breaking news alerts by email Update newsletter preferences

Our nearest neighbour was hurtling around Earth once every 27 days, seven hours and 43 minutes long before man evolved. It governs the tides, illuminates the night and provides a convenient measure of time between the day and the year. The Greeks believed in Hecate, a three-faced goddess who transformed into Artemis as the satellite waxed and then into Selene when it was full. Plutarch told of cave-dwelling Moon demons. Johannes Kepler wrote that its craters were built by Moon creatures. And as recently as the 1920s, the American astronomer William Pickering thought it might have insects. The superstitious believed sleeping in moonbeams would drive one crazy and werewolves transformed from men into monsters by its light. In A Midsummer Night's Dream, Shakespeare called the crescent moon "a silver bow new-bent in heaven"; Shelley described it in "The Cloud" as "that orbed maiden with white fire laden". So enamoured were poets and lyricists, particularly bad ones, that by the early 20th century, rhymes with "spoon" and "June" were the worst of clichés.

The first recorded story of a trip to the Moon was a satirical piece by the Syrian writer Lucian of Samosata during the 2nd century AD, who had his hero sucked up in a water spout. In the 1600s, Cyrano de Bergerac imagined being lifted to the Moon by bottles of dew. Two centuries later, Jules Verne fired his crew off from a huge cannon, while in 1901 HG Wells invented anti-gravity. And in 1950, Hergé, Tintin's author, launched the young reporter and Captain Haddock in a ship that looked suspiciously like a German V2 rocket. They were all wrong – but Hergé came closest.

Wernher von Braun conducted his first rocket experiment in 1924 by attaching fireworks to his sister's red wagon and setting it off in a busy Berlin street. The police arrested him. By the time he reached university, his love of astronomy and things that go bang was firmly established. He joined the Verein für Raumschiffahrt, an amateur spaceflight society, and was writing his doctorate when the Nazis came to power in 1933.

Von Braun's connection with the Nazis is controversial. He built weapons for Hitler, notably the V2, joined the SS and employed slave labourers at his factories. (More people died building the V2s than were killed when they landed on London.) But he was also suspected of being a Communist and was arrested for defeatism. He was one of those obsessed people who believe their work is more important than anything around them. His comment when the first V2 exploded in London is revealing: "The rocket worked perfectly except for landing on the wrong planet."

At the end of the Second World War, Von Braun and his team arranged to be captured by the Americans and were sent to the US under Operation Paperclip. Eventually, he would build every major US rocket up to the Saturn V. But at first, Washington was uninterested. Then the Soviet space programme scored a series of triumphs: the first artificial satellite (1957), the first animal in space (1957), the first unmanned Moon mission (1959), the first man in space (1961) and the first woman (1963). The space race had begun, and America was losing.

It doesn't take a cynic to appreciate the significance of Cold War politics on the Apollo programme. The ascendancy of the free market is clear now, but in the 1960s, central planning still seemed viable. The space race looked like a reasonable way to determine which system, capitalist or Communist, was superior, though so many factors were involved, including blind luck, that it could have gone either way.

President Dwight Eisenhower had been caught napping by Sputnik, a fact John Kennedy used in his 1960 campaign. But once in power, Kennedy seemed distracted by the Communist threat. Influential advisers argued that the US should cede space to the Soviets and get on with earthly business. Many space scientists wanted to concentrate on unmanned exploration, which offered richer rewards at lower cost. Yet Kennedy's hand was forced by the April 1961 flight of Yuri Gagarin in Vostok 1 and the Bay of Pigs fiasco five days later. The president had promised an army of Cuban exiles air support for their invasion, but failed to deliver. Survivors bitterly denounced his treachery, and his standing with the American public hit a record low. Desperate for a distraction, he called on vice president Lyndon Johnson. "Do we have a chance of beating the Soviets by putting up a laboratory in space?" he asked. "Or by a trip around the Moon, or by a rocket to go to the Moon and back with a man?" The mission didn't matter; all that counted was beating the Russians. In a speech to Congress a month later, Kennedy announced: "This nation should commit itself to achieving the goal, before this decade is out, of landing a man on the Moon and returning him back safely to the Earth." America was back in the running.

'Apollo 1' sat atop a Saturn 1B rocket at Cape Kennedy on 27 January 1967 while its three member-crew went through a tedious five-hour systems check. The atmosphere inside the command module was pressurised pure oxygen. Political pressure was also high; president Johnson wanted an Apollo success to boost his re-election chances. But the command module had been plagued by 20,000 failures, and condemned as "sloppy and unsafe" by a quality-control inspector. Early in the test, the astronauts complained of a sour odour, and static was breaking into their communications. At 6.31pm, something sparked. "I've got a fire in the cockpit," reported mission commander Gus Grissom. "Fire!" shouted Roger Chafee. Then came a garbled, "Get us out!" possibly from Ed White.

In the pure-oxygen atmosphere, almost everything was inflammable. Metal pipes bubbled and dripped, joints melted, cooling lines burst, spraying burning fluid like a blowtorch. The foam cushions on the floor burst into a wall of flame between the crew and the exit. The hatch took 90 seconds to open in ideal circumstances. The crew of Apollo 1 died in 8.5 seconds.

The fatal fire could have brought the programme to a halt, or slowed it so much that the Soviets won. For the first time, public debate turned to whether the huge sums ($25bn in 1965 dollars, about £100bn today) being spent on a Moon shot were worthwhile. An internal investigation was never able to find the point of ignition, listing 10 possible sources. Poor management, carelessness, negligence and failure to consider safety were highlighted. Management at Nasa and the command-module contractor, North American, now part of Boeing, were overhauled. Half-a-billion dollars was spent on redesigning Apollo. Chris Kraft, one of the flight directors, said later: "It was unforgiveable that we allowed that accident to happen. [But] had it not happened, we probably would not have got to the Moon when we did."

The Russians had not been idle meanwhile, but they had been unlucky. Their first plan was to launch a "direct ascent" mission, with a single vehicle going all the way to the Moon and back. But their massive N-1 rocket was delayed. Under a second plan, "Earth orbit rendezvous", several smaller rockets would dock in orbit, then head to the Moon. But the first ship in the flotilla, Soyuz 1, crashed, killing cosmonaut Vladimir Komarov. A compromise mission, Zond, was devised to send a reduced crew to orbit the Moon and return without landing. Moscow dithered, however, and Nasa swapped its mission plans for Apollos 8 and 9, getting a crew into lunar orbit first. In 1968, Americans were treated to a Christmas Eve broadcast from the Moon. Mission commander Frank Borman looked back at the Earth, calling it "a grand oasis in the vastness of space".

Nasa's plan was to employ a technique known as "lunar orbit rendezvous", in which a two-part lunar module goes to the surface, and the top section blasts off to rejoin the orbiting command module, transferring the astronauts and samples. The command module then heads for Earth. After Apollo 9 practised docking manoeuvres between lander and command module above the Earth, Apollo 10 returned to the Moon, dropping its lander to within nine miles of the surface. (That command module is in the Science Museum in London.)

In February 1969, the Soviet N-1 rocket was at last ready, but it exploded on its first unmanned flight. The Russians were all but beaten. They made one last attempt – a smaller, unmanned mission that would return rock samples to Earth – but it, too, crashed. Only the Americans were left in the race.

Half-a-million people crowded the roads and waterways around Cape Kennedy to watch the launch on 16 July of Apollo 11 and an estimated half-a-billion saw it on television. "It was awe-inspiring," recalls Dr Allan Needell, curator of the space-history division at the Smithsonian's National Air and Space Museum in Washington. "There was a lot of tension in the US over civil rights and the war in Vietnam back then. Apollo 11 overcame some of that strife and conflict. There was a great sense of human accomplishment." Even a small band of protesters who felt Nasa's money could be better spent reducing poverty ended up appreciating Nasa's point of view after being given ringside seats to the launch of Armstrong, Aldrin and the command-module pilot, Michael Collins.

Neil Armstrong never quite matched the image of the first man to walk on the Moon. "How long must it take," he demanded in 1976, "before I cease to be known as a spaceman?" Unlike many other astronauts, he never jumped on Nasa's publicity bandwagon. "He was a bit of a recluse even before the mission," says Dr Needell. "He's a respected member of the astronaut corps, very knowledgeable. But he has never readily accepted the role of public icon."

If Armstrong were to be remembered for anything else, it would be as an aeronautical engineer. The son of a state civil servant posted to Wapakoneta, Ohio, he enrolled in the Navy to fund his education at Purdue University. His experience as a pilot in the Korean War helped further his understanding of aircraft, but only after he graduated did he think of becoming a test pilot, and from there of joining the astronaut programme.

Nasa is said to have been divided about whether Armstrong or Aldrin should be the first to set foot on the Moon. In the end, the mission commander got the honour... then flubbed his lines. He intended to say, "One small step for [a] man, one giant leap for mankind," but left out the definite article, turning it into a tautology. Aldrin's most memorable quote came shortly after he joined Armstrong on the surface: "Magnificent desolation."

For the two spacemen, the point of the mission was to get to the Moon and return safely. Science was not their top priority, nor was putting up flags or taking pictures. But they did collect samples, and more were added on the five subsequent missions. In all, some 382kg of Moon rocks were returned to Earth. Two fragments are housed in the Natural History Museum in London: a blackened chunk of anorthosite breccia, a calcium-rich feldspar, brought back by Apollo 16, and a volcanic basalt gathered by the Apollo 17 astronauts.

What started out as a political, Cold War race ended up adding substantially to human knowledge, says Tom Watters, senior scientist at the Center for Earth and Planetary Studies at the National Air and Space Museum. Before Apollo, the Moon was thought to have originated either as a passing planetoid captured by Earth's gravity or by condensing out of the same primordial dust cloud as the Earth. Thanks to evidence including the Apollo rocks, the consensus today is that a Mars-size planet slammed into the early Earth, throwing up a cloud of debris that coalesced into the Moon.

A new space race is shaping up, though the competition will be far less intense than it was 40 years ago. The US plans a return to the Moon, while China, India and Japan are each preparing for manned missions. If they succeed, they will add substantially to our knowledge. Dr Watters is hopeful, for example, that additional seismometers will help locate the sources of the small quakes detected by instruments left by the Apollo missions. It is not yet clear whether these are from unseen impacts or tectonic processes. And little is known about the far side of the Moon.

For the 10-year-old space geek in me, this flurry of activity also holds out hope. One day, probably too late for me admittedly, someone will build a permanent Moon Base One. And then the Space Age will really start to reach for the stars.

Buzz Aldrin's memoir 'Magnificent Desolation' (Bloomsbury, £16.99) is out now. The British Film Institute (www.bfi.org.uk) and Science Museum (www.sciencemuseum.org.uk) are holding One Giant Leap, a series of feature films, documentaries and artworks this month, including the exhibition Gravity Sucks