• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Pulse width modulation

Status
Not open for further replies.

Karkas

Member
Hello, I have been trying to design a project, i talked about it in the forum of designs and projects, to make the effect of flashing in a LED with a triagle waveform, but somebody told me about PWM to do it, i found information about it and it was not that complete: I wonder if somebody can help me with some information about it and how to implement it.

Thanks.
 

RCinFLA

Well-Known Member
For an LED probably easiest is to do it with a 555 timer set as retrigger with variable pulse width. You don't have to worry to much about frequency shift in this application.

The advantage to digital PWM is the drive is on or off which dissipates less power. The average intensity of the LED will be the duty cycle of the applied waveform. 100% full on needs to be setup to max drive spec on LED.
 

Karkas

Member
Well i'm using a 555 as astable to get the wave, but i'm affraid i don't know what you mean by variable pulse width, i mean, how can i do it with a 555?
i know i will get a T1 and high level and T2 in low level, but i didn't know i could get a variable pulse width.

How can i see the flashing effect with that?
 

Electronworks

New Member
OK here goes...

An LED has a non linear characteristic, meaning if you halve the current, the brightness will not halve in sympathy. Therefore Pulse width modulation was suggested instead. Here you drive the LED on and off but the ON/Off times vary. Obviously the longer the LED is ON for, the brighter the LED lights. Very similar to switching a light switch on and off very quickly, before your father tells you off...

With the 555 you can change the ON/OFF time by applying a dc voltage to pin 5 (I need to check this). Set the part up as an astable multivibrator (just Google that last bit or see the datasheet of the 555) and modulate the voltage on pin 5 and you should end up with a square wave that changes its ON/OFF times. Hook up your LED to this (via a resistor of about 220 Ohms) and your LED should brighten and dim in sympathy with your ON/OFF times:p
 

Karkas

Member
Thanks for the answer, now I can understand better. The ON/OFF times in the wave of the output (pin 3) will change as a modulate de voltage in pin 5, right?
I'm going to test it as soon as a can, and consult about the results.

Now, I found something about this that said that I could implement PWM by using a comparator, and aplying a sawtooth waveform in one of the inputs (don't remember if the inverting or the non-inverting, guess the inverting) and in the other input the square wave in my case. That was in wikipedia, and I don't trust it completly, and I would like to see if that is right and what does it have to do with that Electronworks said.

By the way i found easier that of the DC voltage in pin 5.
Thanks.
 

Karkas

Member
New quieston, i read something related to this in another thread.
The purpose of changing the duty cycle, i mean making it shorter, is to make the LED light brighter? Electronworks says here that "Obviously the longer the LED is ON for, the brighter the LED lights" but then, what would be the purpose of minimize the duty cycle as i read in another thread, to have the strobe light effect?
 

crutschow

Well-Known Member
Most Helpful Member
The LED will indeed be brighter with a longer duty-cycle. You vary the duty-cycle to vary the brightness of the LED. It's similar to having a variable resistance pot in series with the LED but is somewhat more efficient.
 

Karkas

Member
thanks for the answer, is ther some way i can get thes progresive increase of the brightness usinf PWM? i mean, the effect i'm looking for with the triangle waveform, i haven't test it yet.

Thanks.
 

Karkas

Member
Thanks for the answer. and what would this exactly do to the wave in the astable output?
how would i apreciate the effect?
 
Last edited:

bountyhunter

Well-Known Member
Hello, I have been trying to design a project, i talked about it in the forum of designs and projects, to make the effect of flashing in a LED with a triagle waveform, but somebody told me about PWM to do it, i found information about it and it was not that complete: I wonder if somebody can help me with some information about it and how to implement it.

Thanks.
Here is a link to a free comprehensive tutorial on LED dimming. You have to register to get access, but no cost.

TechOnline | Fundamentals of LED Dimming
 

Wilksey

Member
I had a similar problem back along when making an LED sign, all my rows / columns were driven by shift registers, connected to transistors for the high sink / source, the end controller was a PIC micro, this had 1 hardware PWM built in, however, it only drives 5v max and the LED's were driven from 12v, so with my shift register output and a 5v PWM output i used a simple and gate to drive the PWM with great success from the 2 outputs.

Hope this helps? Took me ages to figure out that the AND gate would solve all my problems.
 

Karkas

Member
I had a similar problem back along when making an LED sign, all my rows / columns were driven by shift registers, connected to transistors for the high sink / source, the end controller was a PIC micro, this had 1 hardware PWM built in, however, it only drives 5v max and the LED's were driven from 12v, so with my shift register output and a 5v PWM output i used a simple and gate to drive the PWM with great success from the 2 outputs.

Hope this helps? Took me ages to figure out that the AND gate would solve all my problems.
I can see it (kind of), would you explain it a little deeper? how did the and gate do that?
 
Status
Not open for further replies.

EE World Online Articles

Loading
Top