A microcontroller based electronic switch for controlling lighting performance of an LED lamp comprising:
- a first controllable switching element, electrically connected between a power source and a first LED lighting load for emitting light with a first color temperature;
- a second controllable switching element, electrically connected between the power source and a second LED lighting load for emitting light with a second color temperature;
- wherein the first LED lighting load and the second LED lighting load form said LED lamp;
- a detection device, for detecting an external control signal and converting said external control signal into a message carrying sensing signal;
- and
- a microcontroller with program codes to read and interpret said message carrying sensing signal generated by said detection device, wherein said microcontroller through a first control pin is electrically coupled to said first controllable switching element, and through a second control pin is electrically coupled to said second controllable switching element, wherein said microcontroller through a third control pin receives said message carrying sensing signal from said detection device, wherein said microcontroller with program codes controls a conduction state or cutoff state of said first controllable switching element through said first control pin and said microcontroller controls a conduction state or cutoff state of said second controllable switching element through said second control pin according to said message carrying sensing signal generated by said detection device;
- wherein the first color temperature is higher than the second color temperature;
- wherein said message carrying sensing signal is characterized with a signal format of a short voltage signal, a long voltage signal or a plurality of voltage signals generated in a short preset time interval;
- wherein when the microcontroller receives said message carrying sensing signal, said microcontroller manages to activate a corresponding subroutine according to said signal format of said message carrying sensing signal to perform one of various working modes including an on/off switch control mode, a dimming and color temperature tuning mode and a delay shutoff mode;
- wherein when said first controllable switching element and said second controllable switching element are in the conduction state, said microcontroller further controls electric power transmission levels from the power source respectively to said first LED lighting load and to said second LED lighting load according to said signal format of said message carrying sensing signal received, wherein said microcontroller through said first control pin successively outputs a first control signal to control conduction rate of said first controllable switching element, said microcontroller through said second control pin successively outputs a second control signal to control conduction rate of said second controllable switching element, wherein said first control signal and said second control signal are programmed to operate with an arrangement that said first LED lighting load is dimmed at a faster pace such that said first LED lighting load leads said second LED lighting load in both reducing light intensity and reaching a cutoff state during a dimming and color temperature tuning cycle to create a dim to warm effect.