Patent ID: 8154214

Claim:
A power supply comprising: A DC power source having positive and negative terminals; a semiconductor switching element; a current sensor coupled to the switching element; a light-emitting element coupled on a first end to the positive terminal of the DC power source and further coupled on a second end to the negative terminal of the DC power source through the switching element and the current sensor; a control circuit configured to generate a PWM signal for driving the switching element; a calculating circuit coupled between the switching element and the current sensor, and further coupled to the control circuit, the calculating circuit configured to detect the PWM signal from the control circuit and the detected current from the current sensor, calculate an average value of a current flowing to the current sensor when the switching element is turned on and provide the calculated value to the control circuit; and wherein the control circuit controls a pulse width of the PWM signal based on the average current value calculated by the calculating circuit and a predetermined target value.