Gas detector for the petroleum sector