This Thanksgiving, as you pour the gravy (38 calories per spoonful) on your mashed potatoes (180 calories) and take a bite of pumpkin pie (323 calories), you may find yourself doing the math in your head: How many calories in all of this?

As it turns out, calorie-counting started in a basement at Wesleyan University in Middletown.

Wilbur O. Atwater, a professor of chemistry at Wesleyan from 1873 to 1904, developed the respiration calorimeter to measure precisely the energy provided by food and created a system to measure that energy in units, known as calories. Maintained in the basement of Judd Hall, the 4- by 8-foot chamber housed a machine that measured human oxygen intake and carbon dioxide output.

Suzy Taraba, archivist at Wesleyan, said Atwater developed the respiration calorimeter with the help of fellow scientists Edward B. Rosa and Francis G. Benedict. They began the first of about 500 experiments in 1896.

Subjects would stay in the chamber — sometimes for days at a time — and eat various types of food, portions of which were precisely measured by Atwater and his co-researchers. The subjects, usually students, then would perform various tasks, such as riding a stationary bicycle in the chamber, and the calorimeter would measure the heat the subjects gave off.

Hence, the calorie.

"He figured out that 1 gram of fat is worth so many calories, and the numbers he defined are still used today," said Amy DiCioccio, an oncology dietitian at the University of Connecticut Health Center. "He's the father of dietetics. He made a huge difference in our field."

Erika Taylor, an assistant professor of chemistry at Wesleyan, said much of what we know about nutrition comes from Atwater's early experiments.

"He knew the first law of thermodynamics — that what you consume and whatever you can't use is going to be left over and stored in your body," she said. "He knew there was an energy in and an energy out."

And Atwater was willing to suffer reproach from the public for his research. His call for people to cut back on their fat intake led to something of a backlash. Also controversial were his findings that alcoholic beverages provided some nutritional value. This didn't sit well with the very vocal temperance movement, to which he belonged.

"He was very prominent in the temperance movement, and every year he would lecture the students about temperance and tried to promote [abstention from alcohol]," Taylor said. "Being a good scientist, he reported the data and was very upset that alcohol companies used his research" to promote their products.

But as more studies have come out in recent years touting the health benefits of wine and beer, Atwater comes off as prescient.

Though not always. He downplayed the value of fruits and vegetables because neither contained much in the way of calories. To be fair, little was known about vitamins at the time.

Before the respiration calorimeter, plenty of experiments on calorie intake and expenditure had been conducted on animals.

"But there was debate during the time that these laws of thermodynamics didn't apply to humans because they were special," Taylor said. "But [Atwater] showed that they applied to humans as well. It changed how people thought about science, and about humans. He changed a lot."