Long time ago, but it was just in the last century, miners used canaries to detect poisonous gases (carbon monoxide) in mines.
Now there are much better detection systems (and no canary needs to suffer anymore...) but these are quite bulky and costly. There are several technologies that allow the detection of gaseous molecules although they work best at high temperature (they do not work at ambient temperature so you need to heat up the gas before testing it).
Now, a joint effort from researchers in US (Berkeley), Japan (Murata Manufacturing in Kyoto) and Taiwan (Tsing Hua University) have come up with a sensor on a chip that works at ambient temperature and can detect a variety of gaseous molecules with high sensitivity.
The chip consists of FET (Field Effect Transistors) in a 3.5 nm layer. These transistors have very thin junctions covered by noble metal ions. These latter respond to the presence of gaseous molecules of a certain type by changing the resistance of the silicon layer (the FET) below that in turns changes its amplification resulting in a signal that is specific for that gas molecule. By decoupling the amplification from the sensing the researchers have been able to keep power consumption very low and by changing the composition of the sensing layer they can create sensors that can detect,at the same time with a single chip, a variety of molecules.
The chip is not ready for sale, quite a bit of engineering is still needed, in particular to ensure stability. You don't want to get false signals, do you? Eventually, these chip may find a place in our smartphones, providing early detection and generating alarm. You don't have to go down the shaft of mines to be exposed to dangerous gases, sometimes the carbon monoxide is produced by a stove in the kitchen...