Until the 20th century, only the wealthy or dying might have witnessed someone trying to cool the air indoors—even though building a fire to keep warm in the winter would have been perfectly reasonable. Extreme heat was seen as a force that humans shouldn’t tamper with, and the idea that a machine could control the weather was deemed sinful. Even into the early 1900s, the U.S. Congress avoided the use of manufactured air in the Capitol, afraid voters would mock them for not being able to sweat like everyone else.

While adoption of air-conditioning demanded industrial ingenuity, it also required renouncing the vice of cooling the inside air. But in the process of shedding its hypothetical moral slight against the heavens, the air conditioner has perpetrated worse, actual sins against the Earth.

* * *

Despite the shadow of immorality, breakthroughs in air-conditioning developed out of desperation. Doctors scrambling to heal the sick took particular interest. In 1851, a Florida doctor named John Gorrie received a patent for the first ice machine. According to Salvatore Basile, the author of Cool: How Air-Conditioning Changed Everything, Gorrie hadn’t initially sought to invent such an apparatus. He’d been trying to alleviate high fevers in malaria patients with cooled air. To this end, he designed an engine that could pull in air, compress it, then run it through pipes, allowing the air to cool as it expanded.

Outside of his office though, people saw no practical need for this achievement. It wasn’t until the pipes on Gorrie’s machine unexpectedly froze and began to develop ice that he found a new opportunity. Still, this accomplishment was lampooned as sacrilege in The New York Globe: “There is Dr. Gorrie, a crank ... that thinks he can make ice by his machine as good as God Almighty.”

The use of ice and snow to chill drinks or to help cool a room was nothing new. In the 17th century, the inventor Cornelius Drebbel used snow that had been stored underground during the summer to perform an act he called “turning summer into winter.” In his book Absolute Zero and the Conquest of Cold, Tom Shachtman speculates that Drebbel achieved his effect by mixing snow with water, salt, and potassium nitrate, which formed ice crystals and significantly cooled the space. King James, who invited Drebbel to demonstrate his innovation, reportedly ran from the demonstration in Westminster Abbey, shivering.

It looked like the grill of an old car shoved through a window.

Ice would be used two centuries later to cool another man in power, U.S. President James A. Garfield. On July 2, 1881, Charles Guiteau fired two shots from his revolver into Garfield’s back. The aftermath inspired naval engineers to develop a method to keep a president cool, as he slowly died that summer.

The astronomer Simon Newcomb oversaw development of the apparatus that struggled to chill Garfield’s sickroom. Newcomb rigged together an engine connected to pipes that powered a fan to blow over a giant bucket of ice. In written reports, Newcomb explained that his apparatus held “some six tons [of ice] in all, through which the air might pass in one direction and return in the other.” The device lowered the room’s temperature from 95 to 75 degrees—and ate up hundreds of pounds of ice an hour.

As news of Newcomb’s machine slowly grabbed the public interest, distrust of cooling the air began to wane. Inventors developed fanciful schemes to beat the heat. One believed he could take a balloon connected to a fire hydrant and a hose and create personal rainstorms. Another came up with the idea of towers with carbon dioxide bombs at the top that would explode above a neighborhood and cool the air upon detonation. Some of these curiosities managed to win patents, but few proved useful in practice.

* * *

Two decades after Garfield’s death, Willis Carrier coined the term “air-conditioning.” Although it wasn’t an overnight sensation, Carrier’s breakthrough came in July 1902, when he designed his Apparatus for Treating Air, first installed in the Sackett Williams Publishing building in Brooklyn, New York. The device blew air over tubes containing a coolant. Its purpose was to reduce humidity more than to reduce air temperature; excess water in the air warped the publishing house’s paper.

In 1899, Alfred R. Wolff had preceded Carrier with an air-cooling device, installed in the dissecting room of Cornell Medical College in New York City. Later, the same year Carrier installed his first apparatus in Brooklyn, Wolff placed his machine at the New York Stock Exchange. Instead of keeping cadavers fresh for study, it brought comfort to the horde of men at work.

The technology began to spread. Frigidaire sold the first “room cooler” for the home in 1929. H.H. Schultz and J.Q. Sherman marketed an air conditioner that leaned against the windowsill, but the first window-mounted unit, as we know it today, was the 1932 Thorne Room Air Conditioner. It looked like the grill of an old car shoved through a window. In her book Cool Comfort: America’s Romance with Air-Conditioning, Marsha Ackermann recounts a radio interview in which Carrier announced his vision. He imagined a world in which “the average businessman will rise, pleasantly refreshed, having slept in an air-conditioned room. He will travel in an air-conditioned train, and toil in an air-conditioned office.”

Air-conditioning’s major public debut was at the 1939 World’s Fair. Carrier hosted the Carrier Igloo of Tomorrow expo, where 65,000 visitors would experience air-conditioning for the first time, boosting consumer interest. Over the next decade, as the air conditioner shrank in size, advertisements for the machine shifted their appeals from men in the workplace to women at home. In some early ads the air conditioner sits in the window among a proud family admiring their machine like a spacecraft that had landed in the living room.

Commercial buildings used more than 500 billion kilowatt-hours of electricity for air-conditioning in 2015 alone.

Basile points out another, less obvious move that increased the device’s popularity: In 1959, the U.S. Weather Bureau created its “discomfort index”—we know it today as the heat index, a measure of temperature and humidity combined. The discomfort index gave an unexpected boost to air-conditioning by, as Basile says in his book, putting “people in mind of cooled air.” Now the public could gauge if it was too hot to go outside. If they could afford it, there were plenty of air-conditioner manufacturers offering solace from the weather.

By the 1960s, millions of air conditioners were being sold every year in the United States. Windows across cities and suburbs were being plugged with the machines. As of 2011, the Energy Information Administration’s Residential Energy Consumption Survey says that 87 percent of households in the United States have an air conditioner or central air. That’s compared to 11 percent in Brazil and only 2 percent in India.

* * *

While the public’s reluctance to air-conditioning might have hampered the initial development of air-conditioning technologies, its eventual popularity has proved detrimental to the Earth’s atmosphere.

By 1989, the Montreal Protocol was enacted in an effort to cut the release of chlorofluorocarbons, or CFCs, into the atmosphere. Freon, a CFC used in the early A/Cs, was among the features of older air-conditioning units that contributed to ozone depletion.

Even though refrigerants have been modified to use fluorine instead of chlorine, and thereby to avoid impacting ozone, air-conditioning still exerts enormous environmental impact. According to Daniel Morrison, the acting deputy director of communications at the U.S. Department of Energy, residential and commercial buildings used more than 500 billion kilowatt-hours of electricity for air-conditioning in 2015 alone. That’s almost 20 percent of the total electricity used in buildings, amounting to $60 billion in electricity costs annually. Air-conditioning is also one of the main contributors to peak electric power demand, one symptom of which is rolling summer blackouts.

It has become both a symbol of human ingenuity and of weakness.

Of all the devices people use today, the air conditioner has not experienced major design makeovers like the television or the telephone. But there are companies trying to revolutionize the future of air-conditioning—both in aesthetics and efficiency. Some of these efforts rehearse earlier qualms about the unseemliness of interior cooling, making air-conditioning more personal. CoolWare, for example, makes an A/C collar, which wraps around the neck and delivers water-cooled air via small fans. Wristify offers a similar product as a bracelet. Kuchofuku makes an air-conditioned work shirt of a similar design.

A Cyprus-based company called Evapolar has introduced what it calls “the world’s first personal air cooler.” It’s a small cube with a water reservoir and a fan that creates a breeze and purifies the air. Evapolar promotes the idea of a “microclimate” designed to cool a single person’s work or sleep space, and thereby to avoid wasting energy by cooling entire rooms or buildings. “Just as our phones became personalized, we believe that the climate device should also become personalized,” Evapolar spokesperson Ksenia Shults tells me.

Dyson and Xiaomi are also introducing small, personalized air purifiers into the market. All these devices remain niche (and fairly uncool, as it were), but stranger things have become mainstream.

Even today, air-conditioning remains controversial. Due to their environmental impact, some advocates call for disuse of these machines. Others accuse the air conditioner of chauvinism, forcing women in the workplace to dress one way inside and another outside. It has become both a symbol of human ingenuity and of weakness, acclimatizing human bodies so that they are less resilient against natural heat without the aid of machines.

More than just an appliance, the air conditioner is a memento mori. It was a device people invented to avoid a few individual deaths, and yet one whose adoption might have a role to play in the passing of a temperate climate for everyone. As summer proceeds, listen to the chorus of machines humming in the windows, outside the houses, atop the office buildings. They offer a reminder that humanity’s ingenuity can come at a cost. Maybe our forebears weren’t entirely wrong to see peril in the act of cooling the air.