This spring, having been stuck at home because of the coronavirus pandemic, your family may have been one of millions across the country that planted a garden. Perhaps you perused seed catalogues for your favorite fruits and vegetables, lined up small peat pots to stick seeds in, then cut open a bag of soil. Did you smell it — rich and earthy?

At least, that’s what scientists hope your soil smelled like. Sometimes you can take a whiff and get hit with smells of rotten eggs or ammonia. It’s a smell that kids can relate to if they have a cat and forget to empty the litter box, says April Ulery. She’s the president-elect of the Soil Science Society of America.

That’s because the soil in your bag was made from a variety of recycled materials: nut shells and other food scraps, sawdust, and yard waste such as twigs. It also has biosolids, that is, anything that gets flushed down a sewer, including poop that’s been heated and treated and cleaned of bad bacteria until what’s left are good bacteria and the nutrients that living things need to stay alive. In the United States, we make 8 million tons of biosolids a year.

But if the soil mix is too fine or has too much or too little of one ingredient, it won’t let in enough oxygen “to reduce smells, so the soil suffocates,” says Ulery. That’s unpleasant for our noses, and plants don’t like it either.

Ryan Batjiaka, a soil researcher at the University of Washington, has been working to find a soil recipe that not only “improves plant growth with the proper amount of nutrients,” Ulery says. It also should smell good and look attractive. “It turns out that you can have the perfect amount of nitrogen, phosphorous, potassium, and organic matter in your soil, but if people don’t like it, they won’t use it,” she says.

Batjiaka and colleagues tested soil mixes on three kinds of plants: petunias, cucumbers and radishes. They each need nutrients in varying amounts to grow best. What none of them needs are materials that are decomposing (decaying), which make compounds that are toxic to plants. They also smell bad to humans.

This is why volunteer soil sniffers who tried mixtures, too, favored 50 percent biosolids and 50 percent wood waste, and another mix that was 20 percent sand, 40 percent biosolids and 40 percent yard/lumber waste — no decomposing stuff in any of them.

We’re used to thinking of soil as an infinite resource — something we can dig out of the ground whenever we want some. But Ulery says that gardening and farming use up soil’s nutrients. Unless they’re replaced, “pretty soon soil becomes degraded and can’t support plants.” In fact, around the world, we’re running out of nutritious topsoil to grow food in.

The good news is that we have plenty of raw materials to make more. “What we’re doing is the ultimate recycling of everything we eat and then waste. We can improve the soil, then start the process all over again,” says Ulery.