Alexander Graham Bell, inventor of the telephone, famously (and fictitiously) said, “When one door closes, another opens.” Put another way, even a failure or a dead-end can lead to something great. For proof of Bell’s maxim, look no further than the seven inventions below, all of which took their creators by surprise.

Penicillin

The world’s first antibiotic, which has prevented millions of deaths from infection and disease, was the accidental byproduct of a messy workspace.

Alexander Fleming, a bacteriologist in London, returned from a vacation in 1928 to discover that one of the petri dishes in his lab had mold growing on it— the result of unintended contamination. On closer inspection, he saw that the area around the mold was free of bacteria. Fleming named this bacteria-killing mold juice penicillin after the species of fungus, Penicillium notatum, and published a paper about his discovery in 1929. However, he wasn’t sure if it had any practical use, as it was difficult to purify and stabilize.

A decade later, chemists at Oxford University read Fleming’s paper and took up the project of turning penicillin into viable medicine. It was first tested on a patient in 1940, and widespread use began in 1942. Today, penicillin is the most commonly-used antibiotic in the world.

WATCH VIDEO: 10 Kitchen Inventions That Changed Cooking

Smoke Detectors

Smoke detectors are so commonplace in homes and businesses that they’re easy to overlook. But their invention has saved millions of lives, and having a working smoke detector in the home decreases the risk of dying in a fire by more than half. For that, you can thank Swiss physicist Walter Jaeger. In the 1930s, Jaeger was trying to invent a sensor that could detect poison gas. Instead, his device registered the smoke from his cigarette— a discovery that led to the invention of the modern smoke detector.

Smoke crawling over smoke detector.
slobo/Getty Images
Swiss physicist Walter Jaeger developed a version of the smoke detector in the 1930s.

Beginning in the 1950s, smoke detectors were installed in industrial spaces, but their high cost prohibited widespread use in homes. Technological advancements greatly reduced the cost in the 1970s, and more than 12 million smoke detectors were sold in 1977. Today, nine in 10 homes have smoke detectors.

Velcro

Velcro tape.
EkaterinaZakharova/Getty Images
Swiss engineer George De Mestral was inspired to invent Velcro by the barbs of the cocklebur plant.

Swiss engineer George De Mestral didn’t set out to invent a fastener that would someday be ubiquitous on spacecraft. But in 1941, he returned from a walk with his dog to notice that they were both covered in the tiny barbs of the cocklebur plant. On closer inspection, De Mestral saw that the burrs were shaped like tiny hooks, which snagged on the loops of his clothing and his dog’s fur.

Fascinated, he began trying to create his own hook-and-loop fabric, an endeavor that would ultimately take him more than 10 years. In 1955, he patented Velcro— a name that combines the French words velours and crochet, which mean velvet and hook. Despite the moniker, De Mestral’s creation was made from nylon. It took awhile for the fashion world to catch on, but NASA was an early adopter, using Velcro on space suits and shuttles. In fact, they embraced it so avidly that many people believe Velcro is a NASA invention.

Today, Velcro is widely used in designing apparel, health care devices, cars, and airplanes. And after decades of research, scientists finally figured out how to make Velcro quieter in 2021.

Dynamite

Dynamite rods invented by Alfred Nobel, from the collection of The Nobel Prize Museum in Stockholm, Sweden.
Fine Art Images/Heritage Images/Getty Images
Alfred Nobel found that mixing nitroglycerine with <em>kieselguhr </em>created a paste which could be shaped into rods. In 1867 he patented this material under the name of dynamite.

Many inventors were overjoyed by their accidental discoveries, but not all of them. The unlikely path that led to dynamite horrified one of its creators, who never intended for its explosive ingredient to be used at all.

Nitroglycerin was invented by Italian chemist in 1847 Ascanio Sobrero, who combined glycerol with nitric and sulfuric acids to produce an explosive compound. It was far more powerful than gunpowder, and more volatile. Sobrero was opposed to its use, but his labmate Alfred Nobel saw potential for creating profitable explosives and weapons. In 1867, Nobel created dynamite, which stabilized nitroglycerine through the addition of silica powder— though not before blowing up his factories twice in the process.

Nobel is best remembered now for the eponymous prize that he established, which recognizes humanitarian contributions, but the wealth that endowed his prize foundation came from selling his patented weapon of war.

Sobrero’s discovery led to Nobel’s creation, something he never intended— and deeply regretted. Of his invention, Sobrero said, “When I think of all the victims killed during nitroglycerine explosions, and the terrible havoc that has been wreaked, which in all probability will continue to occur in the future, I am almost ashamed to admit to be its discoverer.”

Blood Thinner Warfarin

The history of pharmacological innovation is littered with accidental discoveries, like Viagra (intended for high blood pressure) and Valium (a failed attempt at creating fabric dyes). But warfarin, a common blood thinner, was discovered not in a lab but in a field, where livestock were dying from a mysterious disease.

In the 1920s, cattle and sheep that grazed on moldy sweet clover hay began to suffer from internal bleeding. Many previously healthy animals also bled to death after simple veterinary procedures. A Canadian veterinarian, Frank Schofield, determined that the moldy hay contained an anticoagulant that was preventing their blood from clotting. In 1940, scientists at the University of Wisconsin, led by biochemist Karl Link, had isolated the anticoagulant compound in the moldy hay. A particularly powerful derivative of the compound was patented as warfarin, named after the Wisconsin Alumni Research Foundation (WARF) that funded its development.

But before it was used to treat heart attacks, strokes and blood clots, warfarin was used as… rat poison. In 1948, it was approved for use as a rodenticide. It wasn’t until the mid-1950s that warfarin entered clinical use. Among its early patients was President Dwight D. Eisenhower, whose 1955 heart attack was treated with warfarin.

Matches

Lucifer matches were a straight copy of John Walker&#039;s original friction lights of 1826-7. The next development in 1832 was the &#039;Congreve&#039; which contained yellow phosphorus. The items are from the Bryant and May collection of fire-making at the Science Museum, London.
SSPL/Getty Images
Lucifer matches were a straight copy of John Walker's original friction lights. The items are from the Bryant and May collection of fire-making at the Science Museum, London.

According to Charles Darwin, fire was the most significant human achievement after language. And ever since we learned to make fire, humans have been trying to figure out how to improve our processes. Prior to the invention of the friction match, fires were commonly made with a flint and steel or a fire drill, both of which could be laborious.

Early matches relied on chemicals, like the “Prometheus match,” invented in 1829, which contained a glass vial of sulphuric acid wrapped in paper; the match was lit by crushing the glass vial. Darwin himself was a fan of these, and would entertain others by biting matches to ignite them. However, as one might imagine, a match that people are tempted to light with their mouths has some safety drawbacks.

Around the same time, British pharmacist John Walker was experimenting with chemicals when he accidentally scraped a coated stick across his hearth. The stick burst into flames, giving Walker an idea. In 1827, he began selling “Congreves” at his pharmacy, named in honor of the inventor of a type of rocket. Walker’s Congreve’s were cardboard sticks coated in a mixture of potassium chlorate and antimony sulfide, which would ignite when struck against a piece of sandpaper.

Though Walker’s invention was instantly popular, he chose not to patent it. As a result, others copied his design and began selling their own versions, obscuring his role as inventor. It wasn’t until long after his death in 1859 that he was acknowledged as the creator of the first friction match.

Coca-Cola

Bottle inspection operations, Coca Cola plant, Southern California, 1933.
Dick Whittington Studio/Corbis via Getty Images
Bottle inspection operations, Coca Cola plant, Southern California, 1933.

One of the most popular soft drinks in the world also has one of the most unusual histories. In 1866, an American pharmacist named John Pemberton was trying to create a painkiller. Pemberton had been gravely injured in the Civil War, and developed a morphine dependency that he hoped to curb by inventing an effective, opiate-free alternative.

His first product, which he called Pemberton’s French Wine Coca, contained a few ingredients you won’t find in today’s recipe. Coca wine, which combined alcohol with leaves from the cocaine-containing coca plant, and kola nuts, which contain stimulating caffeine.

WATCH: 'Cola Wars' on HISTORY Vault

His “French Wine” was popular, but when the temperance movement took hold in his home state of Georgia in 1886, he had to develop an alcohol-free alternative. He substituted sugar syrup for wine, and while tinkering with the formula he accidentally mixed his concoction with carbonated water. After tasting it, he decided to market the beverage as a fountain drink instead of a medication, naming it “Coca-Cola” after its original ingredients.

Unfortunately, Pemberton’s health worsened, as did his morphine dependency, and he died in poverty just two years after his invention. By then, he had sold his shares to his business partner Asa Griggs Candler, who turned Coca-Cola into one of the most successful companies in the country.