Diode Dimming Circuit

Thread Starter

dhosinski

Joined Dec 6, 2007
40
Hello, I am working on my senior project which is a "dimming circuit" for LED's. I have a circuit to drive the LED's, but need a PWM signal as input to the current controller (via opto isolator).
My advisor has suggested I used dual 555 timers for this. I have found a LM556 dual 555 timer chip. Question is, I can't find any sites that have examples of this type of circuit.

I need to achieve a ~1kHz signal so in order to vary the duty cycle I am going to use a potetiometer.

Can someone please point me in the right direction to a site that might have something if interest?

Thanks
Darrin
 

iONic

Joined Nov 16, 2007
1,662
Question is, I can't find any sites that have examples of this type of circuit.
Can someone please point me in the right direction to a site that might have something if interest?

Thanks
Darrin
Google is your best friend here.... there is tons of information dealing with the LM555/556 as well as PWM.

LM556 DataSheet: javascript:eek:penreq http://www.ortodoxism.ro/datasheets/nationalsemiconductor/DS007852.PDF
LM555/556 Circuits and descriptions: http://home.cogeco.ca/~rpaisley4/LM555.html
 

SgtWookie

Joined Jul 17, 2007
22,230

Thread Starter

dhosinski

Joined Dec 6, 2007
40
Hello, and thanks. I will look at all of the sites tonight.

The PWM circuit is only one part of the whole circuit which you already know. My other issue is, what kind of supply can I get that will take 120VAC down to a usable 12VDC for the PWM circuit. The diode dimming circuit will operate off of the 120VAC. I was thinking about buying a 120VAC/12VDC adapter and removing the cover then mounting it into the base of my lamp. That way I will only have 1 plug to the wall.

Kind of a hack job, but I know it would at least work. Any suggestions on switch mode/buck mode power supplies? I really don't know much about them.

Just to let you know, I have been going to school for 12 years part time. I work full time and have a family. Just trying to do better for myself.

Thanks
 

SgtWookie

Joined Jul 17, 2007
22,230
Why not just get a "wall wart" that puts out 12V DC? Your LED's won't pull much power; they require around 20mA; using 12V you can have up to four LED's in series, depending upon their voltage drop at their max rated current.

For example; let's say you have some super-bright white LED's that are rated for 20mA @ 2.6V. If you run four of them in series, that's 10.4V dropped. Your MOSFET will have a small amount of voltage dropped across it when conducting; transistors more (about 0.7v), Darlington pairs even more (about 1.3v).

This gives you the flexibility to select a wide variety of current switching devices. Practically any wall wart will supply 100mA's worth of current; even with that small amount you could power 5x4 or 20 LED's, less what's consumed by the rest of the circuit.
 

Thread Starter

dhosinski

Joined Dec 6, 2007
40
I found a PCB mount transformer. It will take 120VAC at the primary and output 12/6vac at 300mA from the secondary. I have to find out what power requirements a 12VDC regulator will require?

I can probably use this to run the PWM. Any good places to find voltage regulators circuits?
 

SgtWookie

Joined Jul 17, 2007
22,230
You could use an LM7812 regulator IC in a TO220 case, or an LM317 which is an adjustable regulator.

The LM7812 requires just three connections; input voltage, ground, and output.

The LM317 will require resistors connected between output and the adjust terminal (120 or 240 Ohms), and the adjust terminal and ground (you could use a 1KOhm, 2KOhm or 5KOhm potentiometer) to set the output voltage.

Of course, you'll need to rectify the AC, and have a fairly large capacitor to smooth the output from the rectifier. You should also use at least a 0.1uF cap on the output of the LM7812/LM317. Datasheets are available at National.com and other manufacturers.
 

gootee

Joined Apr 24, 2007
447
I found a PCB mount transformer. It will take 120VAC at the primary and output 12/6vac at 300mA from the secondary. I have to find out what power requirements a 12VDC regulator will require?

I can probably use this to run the PWM. Any good places to find voltage regulators circuits?
You could go to http://www.national.com and do searches for the regulator ICs that have been mentioned, or use their parametric search. Download the datasheets for the devices. They almost always have application circuit examples, near the end, as well as important design considerations, etc. Also download any interesting-looking application notes.

The 12VAC transformer output "SHOULD" be ok to use, to get a 12 VDC regulated output. In general, you have to calculate the minimum voltage that the regulator IC's input will see, even with something like 10%-low AC Mains voltage, and taking into account the troughs of the ripple voltage, after the rectifier bridge's 1.4V-or-so voltage drop, with the smoothing capacitor's effect, and make sure that that minimum voltage will always be more than the desired regulator output PLUS the regulator's maximum "dropout" voltage (as spec'd in datasheet for your max DC current load). Hint: You might want to look at "Low DropOut" (LDO) regulators.

If you actually run those numbers, assuming a 300 mA max load current, while assuming that the transformer's output is exactly 12VAC, you will find that it almost always appears that you need somewhat MORE than 12VAC from the transformer output to be able to get a reliable 12VDC regulated output, with most standard-dropout-voltage regulators (assuming 1.3V dropout voltage for 300 mA load current), even with a large smoothing capacitor and only 300 mA max load current, if 10%-low AC Mains voltage is considered, which would probably lead you to believe that you need to go to the next-higher standard transformer voltage, maybe 15VAC. But, in reality, it usually turns out that the transformer's regulation will save you, and you only need a 12VAC-rated transformer, as long as the transformer is somewhat over-specified.

Below is a nice, concise webpage that has everything you need to design the power supply (i.e. approximate equations for average DC value after smoothing caps and for ripple voltage amplitude), and to prove that your regulated power supply design will work with a 12VAC transformer and a 12VDC regulator, even with 10%-low AC Mains voltage, as long as you take into account the fact that the transformer, if somewhat over-specified, will have an output voltage that is slightly higher than 12VAC (you would probably have to measure it, with your max load current, unless regulation numbers are known for your transformer), and assuming your regulator's dropout voltage is something like 1.3V max for a 300 mA load current.

http://www.zen22142.zen.co.uk/Design/dcpsu.htm

I think I still would want to use an LDO regulator, though. Something like national.com's LM2940, in its LM2940CT-12 or LM2940T-12 version, might be good. It is a fixed-output-voltage 12-Volt LDO three-terminal regulator, with 0.5V dropout voltage at 1 Amp (its max rated current) [whereas a 7815 has a dropout voltage of 2.0V at 1A]. The LM2940's datasheet also includes a graph showing that its dropout voltage is about 0.2V at 300 mA, and only 0.1V at 100 mA.

By the way: In this case, the "T" means it's in a TO-220 (through-hole, heatsinkable) package. And the "C" means its operating temperature is rated for 0degC to 125degC (as opposed to the -40degC to 125degC TO-220 LM2940T-12 "non-C" version). It also comes in a variety of other packages, as shown in the datasheet. Note that free samples of LM2940T-12 are available, if you can wait a little while.

Here is the LM2940 product page:

http://www.national.com/mpf/LM/LM2940.html

Regards,

- Tom Gootee

http://www.fullnet.com/~tomg/index.html
 

Thread Starter

dhosinski

Joined Dec 6, 2007
40
Tom:
Hello and thank you for the information. I appreciate everyones inputs so far. I just wanted to point out one thing. The 300mA current is the output current of the transformer. The only load the transformer will see is the circuit required to output a PWM signal. That entails the full-wave rectifier, voltage regulator (I'm going to look into your suggestion), and the Astable Multivibrator circuit.
As long as those don't require a lot of current the 555 timer will operate on 5 to 15 volts without signal degredation (or so I've read). Question is, how can I get 1kHz out of it. I've found some resistor values but the best frequency I have found is about 680Hz. I am concerned about exceding the resistance requirement for the timer.

Thanks
 

SgtWookie

Joined Jul 17, 2007
22,230
Hello again Darrin,

Please visit the first link that I posted; it's a link to 555 Timer Pro software.

In the freeware mode, you supply it with values such as the mode (astable, monostable) frequency you wish to generate, duty cycle, etc - and it gives you the resistor values to use in your circuit.

Attached is an example of the output from the program; a 50% duty cycle 1KHz astable oscillator. If R1 & R2 were replaced by a single 10K pot (wiper on pin 7, one end connected to pin 6, other end to Vcc), you would have a 905Hz oscillator with a very wide duty cycle range.

If you wanted to use a 50K Ohm pot instead, replacing C1 with a 27nF cap would give you 1015 Hz output.
 

Attachments

gootee

Joined Apr 24, 2007
447
Tom:
Hello and thank you for the information. I appreciate everyones inputs so far. I just wanted to point out one thing. The 300mA current is the output current of the transformer. The only load the transformer will see is the circuit required to output a PWM signal. That entails the full-wave rectifier, voltage regulator (I'm going to look into your suggestion), and the Astable Multivibrator circuit.
As long as those don't require a lot of current the 555 timer will operate on 5 to 15 volts without signal degredation (or so I've read). Question is, how can I get 1kHz out of it. I've found some resistor values but the best frequency I have found is about 680Hz. I am concerned about exceding the resistance requirement for the timer.

Thanks
Hi Darrin,

The 300mA max load current was just an example. Sorry for any confusion. I should have picked a number that wasn't the same as one that had already been mentioned. But I happened to have recently worked the same problem in detail, for a 300 mA max load current. (Also, if you do want to use a lower-voltage regulator, that should be fine, at least from a power supply standpoint, but might necessitate a larger heatsink for the regulator, assuming it needs one at all.)

It appears that you have already been given a good solution for the 555 setup. If in doubt, you can easily simulate a 555 circuit with the excellent, free LTspice simulator, from http://www.linear.com .

In fact, with LTspice, it would be very easy to simulate your entire project at once. In my opinion, that would be well-worth doing, since it would make it so easy to double-check everything (and to instantly see the results of changes). For example, Alt-left-click on any component to plot its power dissipation vs time. Then Ctrl-left-click on the plot label would calculate the average and RMS power over whatever time period was displayed, for that component. And, of course, you could plot all of the voltage and current waveforms, and directly measure frequency, duty cycle, etc. You could also, just as an example, easily step a resistor value or divider ratio (pot) over a range, and see all of the plots simultaneously.

I have some downloadable LTspice power supply and other examples, at http://www.fullnet.com/~tomg/gooteesp.htm . Feel free to copy and paste, from them.

Have fun.

- Tom Gootee
 

gootee

Joined Apr 24, 2007
447
Hi Darrin,

I did a quick & dirty LTspice simulation of the NE555 circuit suggested by SgtWookie, combined with a simple regulated power supply. It works very well, using the 10K pot to control the duty cycle.

BUT NOTE: I plotted the total power dissipation of the 10K potentiometer and noticed that the average dissipation got quite high when the side connected to VCC was set to a low resistance value, with the pot and the NE555 each dissipating in excess of 5 Watts(!), which would probably destroy both components.

So, if you are going to use, for example, a 1/2-Watt pot, then in order to limit the pot's average power dissipation to about 1/4-Watt, you would need to insert a resistor between Vcc and the pot, with a value of about 130 Ohms.

With the 130 Ohms in place between Vcc and the pot, the NE555 output's duty cycle varies from 1.5% to about 99.8%, as the 10k pot is varied from 10/9990 Ohms to 9990/10 Ohms, while the frequency varies from about 860 Hz to about 930 Hz.

Changing C1 from 0.15 uF (150nF) to 0.11 uF changed the frequency range for the pot's resistance extremes, giving about 1.17 kHz to about 1.26 kHz.

The Ltspice files that I used are downloadable at the following link. Right-Click on the link and select "Save Target As":

http://www.fullnet.com/~tomg/dhosinski.zip

Included are the schematic file, named dhosinski.asc, and, a plot-settings file, named dhosinski.plt, which I included because it already has the plot of the total pot power dissipation set up. The plot-settings file will be used automatically, when you open and run the schematic file, with LTspice.

Here is a screenshot of the schematic that I used:

http://www.fullnet.com/~tomg/ps_555.gif

And here is a screenshot of the plotted output, for an example potentiometer setting of 1K (top) / 9K (bottom):

http://www.fullnet.com/~tomg/ps_555p.gif

- Tom Gootee

http://www.fullnet.com/~tomg/index.html
 

Thread Starter

dhosinski

Joined Dec 6, 2007
40
Tom & Sarge:

I really appreciate everything you have given me. I'm going to download PSPICE and try to simulate like you said.

I'll let you know how it goes. I need to do this soon because I have to create a schematic and present it on Thursday evening.
Not looking good right now.
(spent half of Saturday reformatting my laptop, and the rest of the weekend writing reports and doing Engineering Cost Analysis and ADV. DIGITAL LABS)

Darrin
 

Thread Starter

dhosinski

Joined Dec 6, 2007
40
Tom:

Do you think the frequency range is enough to visually see the diodes dimming? I haven't done this before so the only way I know is if I were to build it. I don't believe I have the MURS120 diodes or regulator. I have a trainer board, so I could simulate the reg and run it into the timer circuit.
 

SgtWookie

Joined Jul 17, 2007
22,230
Movies on film are projected at somewhere around 24 frames per second. Do you notice flickering from them? :)

Perhaps a better analogy would be your video monitor - if you get the scan rate above 75Hz or so, your persistence of vision causes you to not be able to distinguish between the video frames.

Flourescent and neon lighting is another couple of examples; both of those types are producing intermittent light at 120Hz, but you don't notice the light flickering because of your persistence of vision - unless you do something like wave your hand quickly under the light.

Even if your oscillator was running at 50Hz, it's highly unlikely anyone would notice the LED's flickering.
 

Thread Starter

dhosinski

Joined Dec 6, 2007
40
Movies on film are projected at somewhere around 24 frames per second. Do you notice flickering from them? :)

Perhaps a better analogy would be your video monitor - if you get the scan rate above 75Hz or so, your persistence of vision causes you to not be able to distinguish between the video frames.

Flourescent and neon lighting is another couple of examples; both of those types are producing intermittent light at 120Hz, but you don't notice the light flickering because of your persistence of vision - unless you do something like wave your hand quickly under the light.

Even if your oscillator was running at 50Hz, it's highly unlikely anyone would notice the LED's flickering.
I'm not worried so much about "flickering" as much as I want to be able to see that the duty cycle is changing the light intensity. Sorry if I wasn't clear.
 

SgtWookie

Joined Jul 17, 2007
22,230
Don't worry about not having the MURS120 diodes; you can use 1N4001 through 1N4007 or many other diodes - just as long as they're capable of carrying the current the transformer will produce, and sufficient PIV rating.

Unfortunately, you won't be able to see the duty cycle unless you slow it WAY down. You could do that by temporarily adding more capacitance across C2; a 22uF cap would give you 6 Hz, 47uF would give you roughly 2.85Hz. You could use an electrolytic cap, but it should be at least 16v, and make sure you have the polarity correct when connecting it (stripe or arrow points at the - terminal)
 

Thread Starter

dhosinski

Joined Dec 6, 2007
40
The transformer is only putting out a max of 300mA. I think they would be fine as long as we don't short to ground or anything.

As far as simulating, I could check the current going to the diodes and that would be an indicator. I just need to be able to adjust the duty cycle so that the current controller will change the amount of current to the diodes so you can actually notice the dimming take place.

Thank you again!
 
Top