1. A LED straight tube lamp comprising a tube, lamp caps with contact pins and located on both ends of the tube, a first rectifying unit and a second rectifying unit and a filter unit that are coupled with the pins on the two ends respectively, and a switch unit that is located between the rectifying units and the filter unit characterized in that the switch unit comprises:a sampling end that is coupled with either one or both of the contact pins,
a first end that is earthed, and
a second end that is coupled with the filter unit;
wherein the switch unit further comprises a rectifying module a reference module, an impedance detecting module, a control module, a driver module and a transistor;
a source electrode and a drain electrode of the transistor are connected with the first end and second end of the switch unit, respectively;
the sampling end outputs sampling signal to the rectifying module, which outputs rectified sampling signal to the reference module;
the impedance detecting module is used to detect the current on the switch unit's first end; the control module is used to compare the current detected by the impedance detecting module and the current outputted by the reference module and output control signal to the driver module; the driver module outputs high-low level signal to the grid of the transistor; and
wherein when the contact pin on either end of the LED straight tube lamp is connected to a power supply, if the current detected by the impedance detecting module is lower than a set value, the switch unit will be disconnected; if current detected by the impedance detecting module equal to or higher than the set value, the switch unit will be connected.