Stop with the salt: adding a dash of water to coffee beans before grinding them could be the secret to a better-tasting cup of caffeinated goodness, new research suggests.

The trick boils down to reducing the amount of static electricity generated by grinding whole coffee beans, which otherwise causes them to clump together and clog up the grinder, creating a whole lot of mess and waste.

Coffee buffs have long been spritzing their beans to moisten them before grinding. Now scientists have confirmed what makes sparks fly in ground coffee beans – and shown how budding baristas can reduce that static electricity to consistently produce a more intense cup of espresso, if that's your thing.

"Moisture, whether it's residual moisture inside the roasted coffee or external moisture added during grinding, is what dictates the amount of charge that is formed during grinding," says Christopher Hendon, a materials chemist at the University of Oregon.

Hendon, who has previously shown how freezing coffee beans improves the flavor, collaborated with former University of Oregon volcanologist Joshua Méndez Harper (now at Portland State University) to investigate which types of coffee tend to clump together and why, and how this impacts brewing.

Harper, Hendon, and colleagues compared a bunch of commercially sourced and lab-roasted coffee beans, which varied in their origin, roasting times, and moisture content. They measured the static electricity in each batch after grinding, as well as the particle size of the freshly ground coffee and the flavor of the final brew.

Grinding whole coffee beans into fine particles creates a lot of friction as particles rub against each other and fracture. This generates static electricity – a separation of charged particles – much the same as dust particles in volcanic plumes rub together and discharge to produce lightning.

By twice-grinding coffee beans, the researchers showed that most of the static electricity in ground coffee arises from fracturing beans, and less so the friction between them.

As for the types of beans that tend to clump together when ground, drier, darker roasts used in the team's experiments produced more electrostatic charges than lighter roasts, with a charge-to-mass ratio similar to particles in volcanic plumes and thunderclouds. The researchers suspect this may be because darker roasts are more brittle than lightly roasted beans that retain their moisture.

By comparing beans ground with and without a spritz of extra water, Harper and colleagues also showed that adding water before grinding resulted in a longer espresso extraction time and a consistently stronger brew. The water permeated through moistened coffee grounds and pulled more flavor from the less clumpy beans.

Speaking to New Scientist, Hendon recommends adding around 20 microliters of water per gram of coffee, or about half a milliliter for a typical espresso shot, to improve its consistency and flavor.

While further experiments are needed to test different types of grinders and brewing methods, the researchers conclude that "a few simple squirts of water have solved the problems of clumping, channeling, and poor extractions while aiding in the pursuit of attaining the tastiest espresso."

They also hope their coffee-fueled collaboration yields new insights about earth science as well. "There's a lot more to know about how coffee breaks, how it flows as particles, and how it interacts with water," says Harper, the volcanologist who led the study.

"These investigations may help resolve parallel issues in geophysics – whether it's landslides, volcanic eruptions, or how water percolates through soil."

The study has been published in Matter.