Pulse width modulation (PWM) can be used to vary the power, speed or brightness of many devices. With LEDs, PWM can be used to dim them, or make them brighter. I will use them make a small hand torch.

An LED can be dimmed by quickly turning it on and off, several times a second. By varying the mark space ratio, the brightness is varied.
A simple implementation of a PWM system would be a clock feeding an LED and protective resistor to the ground.

The clock should ideally oscillate at a frequency of 50Hz to ensure that you will not see the oscillation. To test this, you can either use a signal generator to provide a square wave, as below, or create a circuit to do it for you.

Step 1: Relaxation Oscillator

This circuit will produce a square wave with a duty cycle of 50%. Two 10K resistors connected to the +input of the op-amp provide a reference voltage, and R1 and C1, connected to the -input, create a time constant which controls the frequency, f = 1/{2ln(3)RC}.

The capacitor C1 charges and discharges through the resistor R1, and the time taken for this cycle to occur is the period of the waveform.

Please put video so that we can see how it looks. How long this light goes in dark?
 so your LED are connected in parallel??
Yes, each with its own current limiting resistor.<br />
in step 2 there is a i.c. or transistor in the picture? no part no. please reply. thanks<br>
No, there is not.<br><br>You can select an NPN transistor based on the current required for the LEDs you are going to use. This selection is a design decision you must make, and I cannot make for you.
&nbsp;Thank you very much for replying me, as you can see from my detail, I am a newbie to electronics and just join recently, I have a question about powering up 12 &nbsp;LED, would you mind to have a look of the following link and give me some technological advise please?<br /> <br /> https://www.instructables.com/answers/Power-for-12-LED/<br /> <br /> thanks again for your time and advise<br />
This is a great instrucable! Some very simple and powerful ideas are presented here, Thank you!
where put the switch?<br>
Err... Exactly what is the point of this? Using them normally (without PWM) would yield just as much light? I could see if there was a potentiometer to adjust the frequency and there for the light output, but there isn't.
Just because it gives off the same amount of light, it is not unnecessary. It uses far less current as an average, and the LEDs do not heat up anywhere near as quickly.<br/><br/>And yes, potentiometers could be used to adjust the frequency (<a rel="nofollow" href="https://www.instructables.com/id/Pulse-Width-Modulated-LED-Torch/#step2">Step 2</a>), so long as you ensure the on time is no greater than 10ms.<br/>
Show me the math. How much energy does this save? Does the IC use as much energy?
From observation while testing the relaxation oscillator, the circuit draws approximately 10mA. While off, the LEDs draw no power, and when on, the LEDs draw 150mA each, and so 900mA. Given the duty cycle of 1:10;<br/><br/>10mA + (10*0mA)/10 + (1*900mA)/10 = 10mA + 0mA + 81mA = 91mA<br/><br/>As I said above, the power supply gave a reading of about 85mA, so this isn't far off.<br/><br/>If it was wired up 'normally' then<br/><br/>6 * 30mA = 180mA<br/><br/>Adds up to a fairly large saving.<br/>
Nice. Not quite off-topic: PWM is good for model trains, as inertia tends to give unrealistic acceleration from normal controllers. L
How do you mean off topic? PWM is good in this instance due to its large (<50%) energy saving.
I said "not quite off topic" with reference to the rest of my comment. PWM is good for things, and not just LEDs. L

About This Instructable




More by mathews:Pulse Width Modulated LED Torch 
Add instructable to: