An illumination device includes one or more LED's and a power supply configured to convert energy from a commercial
AC power source and drive said LED's. The power supply includes a
rectifier circuit, a phase detection circuit receiving an output
voltage from the
rectifier circuit and a switching element. A circuit includes the one or more LED's, an inductive element and a
diode, and is coupled on a first end to the
rectifier circuit and coupled on a second end to ground through the switching element. A
current sensor is positioned to detect a current flowing to the light-emitting
diode. A
control circuit is coupled to receive the detected current and the detected phase of the rectified output
voltage, and further coupled to the switching element and configured to generate a PWM
signal for driving the switching element at a frequency higher than a commercial
AC frequency. The PWM
signal has a pulse width determined in accordance with one or more of a
feedback control based on a current detected by the
current sensor and a feed-forward control based on a phase of the pulsating
voltage detected by the phase detection circuit.