The invention involves a kind of LED straight tube lamp and it falls into the field of lighting technology. The LED straight tube lamp includes a tube, lamp caps that come with contact pins and are located on both ends of the tube, a first rectifying unit and a second rectifying unit that are coupled with the pins on the two ends respectively, a filter unit, and a switch unit that's located between the rectifying unit and the filter unit. The switch unit has sampling end that is coupled with either or both pins. When the pin on either end of LED straight tube lamp is connected to a power supply, if the external impedance of the pin on the other end is equal to or higher than its set value, the switch unit will be disconnected; if it is lower than the set value, the switch unit will be closed. One may effectively increase the safety of LED straight tube lamp in use by measuring the external impedance of the pin on the other end to see if the pin is correctly plugged in the lamp base so as to prevent any risk of electric shock resulted from contact between human body and the pin.