In the gas detection system, based on tunable diode laser absorption spectroscopy (TDLAS), Distributed Feed-Back Laser Diode (DFB LD) is often used for the Light source. In order to improve the detection accuracy, make sure the wavelength of LD and absorption line of the detected gas is highly coincidence. The appropriate absorption spectrum and absorption range is determined combining with the Lambert-Beer law and the theory of gas absorption lines. Modulation signals and scanning signals are produced by a hardware driver circuit, which is set up with a steady current function. The experiment result shows that the system works well in locking wavelength. Current Stability is 2×10-2, and make sure that is coincidence with absorption line steadily. The wavelength of LD can be changed by changing the input current. This method can also be used in other gas detection, such as CH4, NO2 and so on.