3W LED dimmer

globecollector

Jun 27, 2011
27
Joined
Jun 27, 2011
Messages
27
Oh, just another quick comment...you need to provide a PWM signal to this chip to dim the LEDs, so you will need to build a separate PWM circuit...it will need a regulated supply voltage, so use the DC-DC Boost converter for this.

Follow all the design tips for this chip closely...particularly the high frequency, high current paths around the inductor, bypass capacitors and shottky diode...it will work like cpap if you don't and radiate R.F., stirring up every radio and TV for miles around.

Some tips if you do not wish to make a PCB...you will really know how to solder very well...the chip is probably surface mount and really tiny...you will need a magnifier, fine solder, SMD flux if you can get it.

Get a tin can, not aluminium, but tinplate...like a Tuna fish can. Try to get all the polymer coatings and printing off it..or just use the "bum" of the can which should be bare metal on the outside. Use old 60-40 lead solder, the new silver-tin stuff is brittle and hard to work with. Old scissors will cut a small piece from the bum of the can after you have got it with the can opener...one of those that leaves the seam on the can not on the bum/lid!
Careful you don't cut yourself on the sharp edges and blunt them off with a small file after cutting. Hold with bull-nose pliers whilst cutting if you can...cut close to the end of the pliers.

Bend the ground pin of the chip down with needle nose pliers and solder it to the top of the can so it pokes up perpendicular to the surface but the body of the chip is parallel to the surface and as close to it as you can get without the other pins touching it. This will hold the tiny thing in place so you can do the next step.

First the 10uF bypass capacitor from the "in" pin to the tin can...use a ceramic monolithic SMD capacitor with no leads you can easily wreck this off an old motherboard from a PC, lay the chip's "in" pin across the top of the capacitor with the other end of the capacitor on the surface of the tin...so it stands up on its end like a toombstone...if the chip ain't high enough, lengthen the ground pin with a piece of solid core wire or a little rectangle of tin similar in size as the capacitor until it IS high enough. Now you will have the "rail" and "Ground" pins done and they will hold the chip firmly in place. Now put the inductor, (make sure it is the correct sort, right sort of core and big enough to handle the current...not just any old 47uH...again look for images of circuits built with this chip so you can actually see the inductor...probably one of those "cotton reel" types dipped in army green goo, or a small toroid or pot-core.) Solder it between the "in" and "sw" pins with its leads REAL SHORT...no more than 3mm long if you can. Now put the shotty diode...SMD again if you can find one...must be able to withstand a reverse bias voltage of about 50-70v...research this component very carefully..it is important. Don't use any old Shottky from a cabbaged power supply! Solder its anode right to the inductor-"sw" pin node..again as close and tight as you can. Lastly..the output bypass cap, the 0.47uF...again, surface mount, like a toombstone, one end to the tin can the other to the cathode of the shottky...that's it..those are the bits the 1.3MHz circulates through...all the other bits are non-critical and can have longish leads.

Any wires soldered to these bypass cap nodes, those to the battery and LEDs...strain relief them in some way...loop 'em through pairs of holes in the tin or cable tye them down to the tin through pairs of holes...anything to stop them being pulled and breaking the bypass caps in half.

Oh, put a blob of silastic between the inductor and the tin...it damps the magnetstriction vibrations which will break the leads/solder/pins off the chip given enough time.

Good Luck and happy, (but fiddly) building!
 
Last edited:

TKSkirata

Nov 30, 2017
9
Joined
Nov 30, 2017
Messages
9
@globecollector Once again wow, and thank you for taking the time to type out such thorough and information-laden replies. I'm afraid though I am more confused than when I stepped into this project!

Given that you have provided, from what I can tell, everything I need to know, it's now just a matter of using (carefully!) your responses and as you say Messer Internet in order to put together my little circuits. The LEDs will be driven from separate circuits so that each may have different brightnesses at any given time.

Thanks again,
Takeshi
 

globecollector

Jun 27, 2011
27
Joined
Jun 27, 2011
Messages
27
Oh, only ONE L.E.D. .... You can still use the same chip because it is a constant current source...it simply "punches" a current down through the stack of L.E.D.s which can be any number from one to about thirty...least I think that is what the data sheet says. It is important to read the datasheet CAREFULLY.for any chip you intend to use.

This chip....the one I put the link to "above" and on the previous page, the MP3302....it takes in a P.W.M. signal in the frequency range from 200Hz to 1KHz to the EN pin, which is pin 4.

This simply turns the whole booster circuit on and off very rapidly, it stops when pin 4 goes below 470mV and starts again when it rises above 700mV ....so your switching PWM circuit needs only to go below 470mV and above 700mV. Now there is a point worth noting here....most chips will be damaged if ANY of their inputs receive a signal with a peak voltage GREATER THAN 600mV above the D.C. supply to the chip, BUT this is easy to remedy....let's say your P.W.M. signal is coming out of a "Digital" chip...a logic gate, 7555 or comparator and it is 5v high....i.e. the "logic low" state is nearly zero volts or a few tens of mV from it, and "logic high" is 5v. Run this through a 1K resistor and into pin 4 of the MP3302...but put a shottky diode...not a fancy one, just any old one in a nice small package with its cathode to the the MP3302's power rail...i.e. pin 2 and its anode to the EN pin, pin 4....this will "clip off" any part of the incoming signal one shottky drop, (200mV odd) greater than the chip's supply at pin 2....the 1K will soak up the difference.

You will want the P.W.M. signal to have the highest frequency possible...in this case 1KHz. The reason for this is to prevent strobing of the L.E.D.s which is bloody annoying. The faster the P.W.M. the less is the chance that your eyes will be able to detect the flashing.

Now for the P.W.M. circuit itself....I'd probably use the "modern" CMOS version of the old "555" the 7555. Let's look up its datasheet...

https://www.intersil.com/content/dam/Intersil/documents/icm7/icm7555-56.pdf

I see its D.C. rail can be anything from 2-18v...that's handy....if you run it at 2.5v it will trip the 470mV/700Mv thresholds of the EN input of the MP3302 and the peak voltage will not be greater than the supply voltage of the MP3302 so the shottky clamping diode between pins 2 and 4 of the MP3302won't be needed...least not at this stage.

Now this presents two "new" problems...firstly, where do we get the 2.5v for the 7555? And, secondly, is there enough headroom for a bipolar transistor constant current source to function...you see they need at least 120mV of headroom just for the base circuit....O.K. it has just come to me...run the constant current source directly off the unregulated anode of the battery...the 3.7 odd volts. That's one problem down, now where to get the 2.5v for the 7555?

You can do this two ways....the "dumb inefficient" way and the "clever, more complicated and efficient" way. Now the 7555 does not need very much power...it is only driving the EN pin of the MP3302 which will be a high impedance input....actually, no, I'm wrong, pin 3 of the 7555 won't be driving anything at all, the waveforms at the input pins 2 and 6 will be used by the PWM comparator and most of that energy is directly from the battery anyhow as the current source runs directly off the battery....so the power supply to it won't need to have much "ooph" (i.e. have a real low static source impedance) either!

The "dumb" way is with a zener diode and a resistor....so dangle a resistor from the anode of the battery then a zener diode in series with it, cathode to the resistor and anode to "ground"/ov/cathode of the battery/circuit reference. Now I don't think 2.5v zeners exist but I think that 2.4v ones do...this is good enough. The 7555 will probably only need 1mA or less, the zener will need to sink 5mA or so to get any regulation, so that will be 6mA in all through the resistor, 2.4v at one end and the battery voltage...say 3.6 at the other...so that is a drop of 3.6 - 2.4 = 1.2 volts @ 6mA. So use Ohm's Law to calculate the resistor...V = I R 1.2 = .006R ... so R = 200 Ohms....if you choose from the "R12" resistor values you can have 180 or 220 ohms..220 is probably good enough. One thing to think about though...if you forget to turn this thing off the battery will be flattened right down to the zener voltage or 2.4.

So, now to the sawtooth generator, to start we have a constant current source "hanging" from the battery's anode...i.e. two crappy silicon diodes in series...1N4148's or 1N914's..(ther'e all much the same and can be wrecked from any old electronic junk) also in series with a 470Ohm to 1K resistor to "ground" so three things in all ...then a PNP transistor...any old "small signal" one....(you live in the United States so it would be a 2N3906.....here in Australia it would be a BC557) its base connected below the two diodes, i.e to the node between the cathode of the second diode and the resistor....its emitter goes "up" to the anode of the battery via another resistor it will have a low value between 22 and 220 ohms. The collector of the transistor is the "constant current" output it will go to a capacitor, the other \end of which is connected to "ground" the value of this capacitor will determine the frequency of your PWM signal...i.d "guesstimate" about 22-47nF and would be a polyproplyene film capacitor or similar. The node at the upper end of this capacitor (called the timing capacitor) will go to both pins 2 and 6 of the 7555 and a shottky diode will connect from here up to the 7555's 2.4v supply rail at pin 8 with the cathode end facing pin 8...(same chip input protection I describe above) ...a 10 Ohm resistor will also connect from this node, (the top of the capacitor, collector of the transistor, anode end of shottky and pins 2 and 6 of the 7555 around to pin 7 of the 7555, this dumps the timing capacitor each cycle. Pin 5 of the 7555 will have a another 33-22nF odd, (not critical) film capacitor to "ground" and pin 4 will be strapped to pin 8 and will have a 2.4v zener...cathode end connected (with its anode end to "ground") also, there will be a 10uF electrolytic capacitor and 100nF film capacitor in parallel in parallel with this zener...(make sure the electrolytic is the correct way around with the negative pole to "ground"). A 220 Ohm resistor (half watt) will go from pins 4 and 8 of the 7555 back to the anode of the battery....this is your sawtooth generator, complete. The sawtooth waveform will come off the collector of the 2N3906/BC557 and will be fairly high source impedance...so you won't be able to load it down with much without "upsetting" it (distorting the shape and amplitude of the waveform) or stopping the oscillator altogether......shorting it to "ground" won't hurt the oscillator...it will simply stop and start again when the short is removed. (Don't forget to connect pin 1 of the 7555 to "ground".)

Now you need a PWM comparator .....my go-to favorite is the old LM311...

http://www.ti.com/lit/ds/symlink/lm111.pdf


BUT there is a problem.....its rail voltage is 3.5v minimum....it is just too old a technology for your application so we need to find a newer, swankier comparator. O.K. here's one...the SGS-Thompson TS331...

http://www.st.com/en/amplifiers-and-comparators/ts331.html

1.6-5v Vcc and 20uA standby current.....just the ticket for battery powred gadgets!

Jeepers-Creppers, it's in a SOT-23 package....hope your'e not crosseyed and have a steady hand!

O.K. connect its "Vcc+" pin to pins 8 and 4 of the 7555, i.e. your 2.5v "regulated" sub supply. Connect its "Vcc-" pin to "ground". I'd "piggyback" it over the 7555's package and keep the leads very short.

Connect its "in+" input via a 1K resistor to the sawtooth, i.e. the collector of the 2N3906/BC557. Connect another high value resistor 4.7-1.0 Meg Ohms between this "In+" input and the output...this will give it some hysteresis and prevent it oscillating stupidly at radio frequencies. Connect its output via a 1K resistor to pin 4 of the MP3302 L.E.D. driver chip...this is your P.W.M. control link between all this "guf" here and the L.E.D. driver. Finally..the thing you really want...the pot with a knob on it to control it all. Now this is a bit trickey. This pot has to have a stable voltage across it or the LED will change brightness WITHOUT you turning the knob...obviously you don't want this....now the only stable voltage you have is the 2.4 volts across the zener, but you can't pull more than about 1mA out of it without "upsetting" it....so you will need a high value pot..50 or 100K ...you could go as low as 5K but you risk pulling the zener out of regulation....connect the ends of the pot across the zener, one end is "ground". the other is your 2.4v "reference". Connect the "wiper" of the pot via a 10K resistor to the "In-" of the TS331 and place a 10nF film capacitor from here to "ground" to "keep it quiet".

And there you have it a PWM circuit. Now to explain some issues you might have...one is that the battery will be discharged down to 2.4 volts if it is left on accidently, the second is the high impedance nature of the control pot which is prone to picking up "hash" and rubbish capacitively from the environment...of the pot is located close to the circuit it will be O.K.
If the pot is to be located some distance away, use shielded audio cable for the wiper, put the wiper down the centre wire and the sheath to the "ground" end of the pot or the circuit or both.

If the pot is to be located a long way away, say 30 feet, then even the shielded cable may well not be enough. You could try decreasing the value of the pot to 20K or 10K, but it may pull the zener out of regulation..but is worth a try. If there are issues you might consider replacing the zener and 220 Ohm resistor with the "smart" option....another chip acting as a "buck regulator" to supply the 2.4v to the 7555 and TS331 and Pot! This adds complexity but drops the source impedance of this 2.5v supply to a very low value so it has lots of "oomph" to drive lots of chips and pots and whatever you like...then you can easily decrease the pot's value to 5K with no worries and not have all those high input impedance "pickup" issues. I have NOT described this possible stage in any detail, I suggest you look up.."3.7v in, 2.4v out Buck Regulator" on "Mr-Internet". Another advantage is that this regulator will probably have an undervoltage shutdown, so when the battery really dips when it gets flat, the regulator will shut off the 2.5v, the PWM circuit will stop dead and the MP3302 will stop dead too...protecting your expensive batteries from over discharge.

This is pretty much the whole circuit. You will need to fiddle with the values of the resistor in the emitter circuit of the 2N3906/BC557 and the capacitor from the collector of the same transistor to "ground" to get the sawtooth frequency to 1KHz......you will need an oscilloscope for this or you can capacitively couple the swatooth to the audio input if a hi-fi....pad it down with a 100K resistor and 4.7K resistor in series so it dosn't blow the speakers across the room....if you a "musical" you will know what 1KHz sounds like.

Really an Oscilloscope is a must because you can test each piece as you build it....so build the MP3302 bit first...that will give you a steady LED off the lithium cell. Then build the sawtooth generator and look at its output on the oscilloscope...then do the PWM comparator last and use the oscilloscope in dual channel mode to look at the PWM with one and swatooth with the other input. This will add the dimming function.

You will need to "fiddle" some things to get them working properly...you might need "stop" resistors at either end of the pot...particularly if the LED reaches zero brightness before the knob reaches full counter clockwise rotation and the same at the other end...full brightness may well be reached before the knob has reached the "top".....fiddle and learn...
Cheers, Andrew
 
Last edited:
Top