This smell, called petrichor, which pleases many people, is perceived after the rain. The responsible is a substance called geosmin (aroma of the earth in Greek). Geosmin is produced by Streptomyces coelicolor or Albert’s bacteria, although it is also produced by some cyanobacteria and filamentous fungi.
This bacterium is found in most soils, and apart from contributing to the equilibrium of ecosystems (it decomposes organic matter, participates in the nitrogen cycle…) and producing antibiotics, it produces this substance as a response to humidity. In other words, it is produced not only when it rains, but also when the soil is watered (including potting soil).
For camels and other animals the detection of this smell is vital. According to zoologists, these animals can detect it when they travel through the desert and thus know if there is a water source nearby. In other words, geosmine is a water-indicating molecule.