In recent years, the distributed Bragg reflector (DBR) laser diode (LD) has advantages of its small size, high efficiency, low power consumption and so on, so it has been widely used in precision measurement, optical information processing, quantum research and other fields. There is a strict requirement for the output frequency of the DBR laser diode in precision measurement technology. Therefore, controlling the frequency of the laser accurately is of great significance for precision measurement. Currently, there are a lot of frequency control scheme for laser diode, mainly through the external system to stabilize the frequency of laser diode, the drawback of which is that it is not conducive to system integration. Therefore, this paper proposes a method based on FPGA for controlling the output frequency of the laser diode. The main purpose of the control is to study the frequency characteristics of the laser diode. In this paper, the FPGA chip is used as a micro controller, and combined with PID control algorithm constitute a closed loop control circuit. At the same time, the control algorithm is programmed into the FPGA device, which can maximize the operating speed of control system. For different frequency of the laser, it is only required to modify the control parameters simply, which can be realized the steady control of the light source. Through the test, near the operating temperature of the laser diode, temperature stability is better than ±0.01°C. As a result, the laser frequency stability can be controlled to 0.1%.