It’s an alarming pattern—large percentages of engineering students either drop out or switch to another major.Studies suggest a variety of reasons why this behavior has emerged, including the difficulty of the coursework, feeling isolated by peers who are pursuing non-STEM degrees, a lack of mentors or role models and inadequate preparation in high school.

To combat the number of STEM students they’ve seen drop out or change majors after their freshmen year, two engineering professors have come up with a plan to keep their younger students invigorated—and caffeinated.

William Ristenpart and Tonya Kuhl are professors and engineers at the University of California Davis. A few years ago, Professor Kuhl had the idea to disassemble a coffeemaker for students in order to display how its designers were able to succeed in brewing quality coffee. The pair quickly realized that coffee making would translate well to teaching engineering. For example, the process of roasting coffee beans involves several investigatable chemical reactions, and the push of hot water through the machine is a result of fluid dynamics.

In 2012, eighteen students attended a seminar called Design of Coffee. Its goal was to serve as “a non-mathematical introduction to chemical engineering.” By 2015, it had become the most popular elective course at the university, with over 1,500 students enrolled. And it’s not hard to see why! While being tasked with creating “the best cup of coffee using the least amount of electrical energy,” students learn about reverse engineering, pH and chemical reactions, mass transfer, and the balance of energy.

Due to the overwhelming popularity of the course, what began as a humble seminar has resulted in the new UC Davis Coffee Center. The plan for the 6,000-square-foot building includes specialized laboratories for studying how water quality, packaging, and bean storage affect the quality of coffee, as well as resources for researching the molecules responsible for the taste of coffee, an experimental sensory lab and much more. With the help of a $250,000 pledge from Peet’s Coffee, the center is planning on further updates and renovations and an inclusion of a Peet’s Coffee Pilot Roastery room. The center is quite an upgrade from the typical classroom.

At the end of the Design of Coffee course, students partake in a blind taste test, and grade their peers’ creations.

Now there’s a class you can’t sleep through.

Did You Know?

There is a part of the world known as the “Coffee Belt”—the area between the Tropic of Cancer and Tropic of Capricorn. This zone is ideal for coffee farming because most coffee beans thrive only within a temperature range of 64 to 70 degrees Fahrenheit.