You are right. Everything that you can smell emits a gas, or vapor. The molecules of that vapor get into your nose where there are 400 different types of smell detector (receptor).
Each type of detector reacts to a different set of chemicals. A few different detectors react to each different chemical, so you can detect a lot more than 400 different chemicals.
Depending on which detectors react to the smell, your brain can decide what the smell “means” – good, bad, disgusting, delicious, etc.
Latest Answers