In this paper, the design and implementation of a retrofit LED lamp for AC mains and ballasts is proposed. The proposed driver contains a simple technique to deal with the different kinds of sources between high frequency power from electronic ballasts and low frequency power from AC grid and electromagnetic ballasts. With this technology, the fluorescent lamp can be replaced with the proposed LED lamp without exchanging the existed lighting fixtures and the circuitry doesn't need to be rewired, which will decrease the cost of change the entire system. The operating principles of the proposed LED lamp, the design consideration, and the key parameters will be discussed. Finally, a hardware prototype of a 22W retrofit LED lamp is built to verify the feasibility of the proposed method.