No, building codes have nothing to do with the odorization of natural gas.
Federal and state laws mandate the odorization of natural gas so consumers can detect gas leaks via sense of smell.
The United States Department of Transportation (DOT) requires that: a combustible gas in a distribution line must contain a natural odorant or be odorized so that at a concentration in air of one-fifth of the lower explosive limit, the gas is readily detectable by a person with a normal sense of smell.
Mercaptan is the substance that causes natural gas to smell bad. It is typically added to gas before the gas is shipped or piped, so that any leaks can be instantly detected.
When was mercaptan first added to gas in the U.S.?
Natural gas is mainly methane with traces of mercaptan odorants deliberately added.
Pure natural gas is colourless and odourless. This means if there is a leak people will not be able to detect it until it builds up enough to become explosive. For this reason a chemical called Mercaptan is added to the gas to make is smell. Mercaptan is harmless, non-toxic and has a strong "rotten egg" smell.
"MURR-captain". Methyl mercaptan, CH3SH, aka methanethiol, is added to natural gas to let us smell it. It is one of the chemicals responsible for the smell of bad breath and flatulence (farts).
ethyl mercaptan
ethyl mercaptan
Mercaptan
The mercaptan odor has been added specifically to assist in the detection of leaks. If odor from the gas is noticed, the implication is that you have a leak. Attend to it promptly.
The smell in gas is man-made, natural gas is odourless. It is added during the gas manufacturing/refining process so as to be able to detect it (i.e. smell). The chemical is Mercaptan
Natural Gas itself is colorless and almost odorless - A chemical odorant (t-butyl mercaptan) is added to the Natural Gas so the leak can be detected quickly. The smell of t-Butyl Mercaptan is distinct, once you smell it you will always know it...sort of a rotten cabbage smell. Sometimes a related Chemical, Thiophane, is used...with a rotten egg smell.
ethanithiol ( IUPAC) ethyl mercaptan is added in lpg to detect leakage by the odour.