# PCB Heaven

## General Category => Your projects => Topic started by: matheuslps on February 05, 2011, 03:23:26 AM

Title: Driver for constant current that I am developing.. Work?
Post by: matheuslps on February 05, 2011, 03:23:26 AM
Hi people. I follow this site and forum a while ago. But now I am developing a power suply to a array of leds and need some help.

The scenario is:

I want to change the regular filament head lamp of my motorcycle with a different kind of light, not too different at this days. I thought about using xenon but here in my country the law do not acept this kind of modification because xenon is too bright.

So I chose to use LEDs. Searched to find a good one, cheap and bright. I found the SSC P7: http://www.seoulsemicon.com/en/product/prd/zpowerLEDp7.asp (http://www.seoulsemicon.com/en/product/prd/zpowerLEDp7.asp)

Looking at the datasheet, in the page above, we can see that the led works with 3.6V@2.8A.

So, I want to buy 3 of this P7´s to change the regular head lamp of my motorcicle. So when the motor is off, the voltage on the battery is 12V and when it is ON, the voltage is 13.8V.

The original head lamp is 35W@12V. So I have 2.92A. If I use 3 P7´s in serie I will maintein the 2.8A on all of them and will not pass the 2.92 original "limit"....

Now I need a driver. I search and found the LM358 voltage regulator from Natinal: http://www.national.com/mpf/LM/LM338.html#Overview  (http://www.national.com/mpf/LM/LM338.html#Overview)

But for the proper operation of the LED we must regulate the current not the voltage.

If you read the LM338´s datasheet, will find this:

To archieve the 2.8A for the LED´s just calcule the right resitor to 2.8A with this formula:

R=Vref/Io

R=1.25/2.8 = 0.45 ohm

Result this:

(http://img152.imageshack.us/img152/9936/driverdeledcomcorrentec.jpg)

Now I need to do a PWM routine with a small microcontroler to make a low and high ligh beam for the head lamp.

EDITED:

Just some pics that I found (The led is not 20w. It is 10W):

http://www.superled.com.br/zbxe/?document_srl=5554 (http://www.superled.com.br/zbxe/?document_srl=5554)

bye
Title: Re: Driver for constant current that I am developing.. Work?
Post by: kam on February 05, 2011, 14:41:18 PM
Hi MatheusLPS,

What you need to regulate is the voltage. On a given voltage, the LEDs will draw the nominal current, no matter what. So, you will connect 3 LEDs in series, each one with 3.6 voltage drop across. Which means that all 3 will have 3x3.6 = 10.8 volts drop. Theoretically, if you provide this voltage, the LEDs will draw 2.8 amperes. The LM338 is a very fine solution for you. You regulate the output to 10.8 volts and the LEDs will draw the nominal current.

The circuit you provide will indeed regulate the current, but it will also cause a huge (I2R) loss on the 5W resistor. That will be 2.82*0.45 = 3.528 Watts! The resistor will heat up, keep that in mind. Do not solder it close to the PCB nor close to plastic parts).

I suggest, for the voltage regulator circuit, you use the one in the datasheet (http://www.datasheetcatalog.org/datasheet2/8/0ujhh2scud4dfop1xfyut2u2qopy.pdf) stated as "1.2V to 25V ADJUSTABLE REGULATOR" or "REGULATOR WITH PROTECTION DIODES". Use on your board the potentiometer to fine adjust the voltage (with your multimeter) before mounting on the bike.

Regarding the PWM circuit: You could of course use the same LM338 circuit and reduce the voltage simply with 2 different potentiometers and a selection switch to choose which one is active. Look the attached image. It is the "1.2V to 25V ADJUSTABLE REGULATOR" from the datasheet. I have add a resistor R3 and a switch. Suppose that the switch is open (as in attached image) and the R2 is set to 850 Ohms. The output (given by the formula 1.25*(1 + R2/R1) ) is:

Vo = 1.25 x (1+850/120) = 10.1 volts. This is enough for your LEDs to operate at full power.

Now, suppose that R3 is 4700 ohms (4.7K), and the switch is closed. The R3 will be in parallel with R2, and the total resistance will be:

Rtot = R1*R2 / R1+R2 => Rtot = (850 * 4700) / (850 + 4700) => Rtot = about 720 ohms. The new Vout is now:

Vout = 1.25 x (1 + 720/120) = 8.75 ohms. The LEDs will now be significantly dimmer than before. You can try different R3 resistors, or replace R3 with a second potentiometer (like for example 5K).

If you still want to use PWM pulses, you will need the circuit (like this one (http://pcbheaven.com/circuitpages/High_Frequency_PWM_Fan_Controller)) and an additional high current mosfet (like the IRF540) to drive the LEDs. I explain how in the second circuit of this page named "What about the 3-wire and the 2-wire fans?". You will simply provide the 12V from the LM circuit and connect the LEDs at pins named 12V and 0V on the right side of the schematic. This is the best method in terms of efficiency. But frankly, i would use the previous one in my bike.

BTW. what bike do you own? And where are you from?
Title: Re: Driver for constant current that I am developing.. Work?
Post by: matheuslps on February 05, 2011, 18:59:09 PM

Your sugestion is very good and minimize power loss. Since it is a head lamp, it will be near plastic things.I understood it perfectly.

My fear in use a voltage regulator without any current limiting is based in one example:

Supose that we have a power suppy made with the LM338 configured in ~ 3.2V and we want to use a normal 20mA blue LED rated @ 3.2V.

It is suposed the led drain only the 20mA when powered with 3.2V, right? OK. But imagine that our power supply is not very regulated and has a increase of 5% in voltage, that is very common, and become 3.36V. So now our current on our LED is not 20mA any more. Maybe this current can be doubble ou more.... Result: our LED will burn. Since LED is a diode and has a exponential curve like this one:

About the PWM, maybe to simplify things, I will not use.

I bought those P7 from Deal Extreme. Maybe in 1 month they arrive... :(

Meanwhile I will developing this power supply...

bye
Title: Re: Driver for constant current that I am developing.. Work?
Post by: kam on February 05, 2011, 21:09:13 PM
To avoid over-current, you simply can add a quick acting fuse. LM has a very good stability and if set correct, then it will not fail.  If something goes wrong, the fuse will act. And also, i would not recommend, no matter what, to power the LEDs exactly with the nominal voltage. If i was you, i would power them with 3.1 volts. I always do that for a couple of reasons. Mainly because, the difference of this 1/10 volts has no influence at the brightness, but is has a huge influence at the current (and heat losses, remember, I2R, current is squared). I always like to make efficient projects, but that is just my taste. You can power them with 3.2 with no problem.

Also, i strongly strongly suggest you make this on a breadboard first to see how it is going. Let it run for a day or so, check temperatures, have an ammeter in series... Test-run it. A friend of mine made a dome light off delay that i presented last year, and he put it in a crappy board on a crappy housing in his car, with no test. I burned a week later (not the car, the project).
Title: Re: Driver for constant current that I am developing.. Work?
Post by: matheuslps on February 05, 2011, 21:46:01 PM
I got your idea to do not try to power the LEDs exactly with the nominal voltage. Even though I lost a little brightness, it is safer.

I will try this one first and I aways test the circuit on a breadboard. Actually, I do not lile to make board to my circuits. Most times I do "self-supported". It does not look very beautiful, but works :D

bye
Title: Re: Driver for constant current that I am developing.. Work?
Post by: bob on February 08, 2011, 12:37:35 PM
Hi MatheuslLPS,
if I understand correctly, you want to install/replace filament/original globe on your motorcycle. Kam has solved issues as far as electronics is concerned, but how are you going to fit your LED in the headlight cavity? You need to remember that the globe sits in the focal point of a parabolic mirror, since that what the headlight is, a parabolic mirror and beams out all available light out onto the road in front of you. I think you will have a strong light, but it will not reach out far enough and make your ride safe.Consider also the speed you will travel at, wild life at night etc. I do not mean to discourage you, but remember, your safety and safety of others on the road takes a president. That is why, there is no country I know of, that allows mods to vehicles or bikes that may jeopardize other road users.
Cheers. Bob
Title: Re: Driver for constant current that I am developing.. Work?
Post by: matheuslps on February 09, 2011, 02:47:02 AM
Great insights and points bob!

We know that a filament light bulb has a 360º of light spreaded. This is why parabolic mirror works.

But LEDs do not have this amout of coverage with light. They have focus. If we do a little search, we will find that most of them have typically less then 60º of light coverage and those that are HIGH POWER LEDs have ~120º of coverage.

So, we can conclude that parabolic mirror from a bike will not work very well for this kind of LED.

BUT I searched a solution. For this kind of LEDs we can buy some lenses to "narrow" (?) the light. Exemple:

The P7 from SSC without a lens (130º):

(http://www.superled.com.br/zbxe/files/attach/images/5540/554/005/led_p7_p002.jpg)

With a 35º:

(http://www.superled.com.br/zbxe/files/attach/images/5540/554/005/led_p7_25.jpg)

With 25º:

(http://www.superled.com.br/zbxe/files/attach/images/5540/554/005/led_p7_45.jpg)

and 15º:

(http://www.superled.com.br/zbxe/files/attach/images/5540/554/005/led_p7_10.jpg)

So, I can not be sure, but I do not think this will be a problem.

thanks.

bye

Title: Re: Driver for constant current that I am developing.. Work?
Post by: bob on February 10, 2011, 06:31:34 AM
Hi MatheusLPS,
very convincing examples. If you go ahead and do this, I would suggest, you should fit all components on a PC board and once you decide on the value of the current limiting resistor, make sure you select "bolt on type". These are housed in an aluminum enclose to facilitate heat transfer onto a heat-sink. Then you can saturate the whole assembly in epoxy resin of some kind to give weather protection and lastly, fit it in such a place where you would have plenty of air flow to cool the heat-sink while you're on the move.
Cheers. Bob
Title: Re: Driver for constant current that I am developing.. Work?
Post by: kam on February 11, 2011, 00:52:35 AM
MatheusLPS, super awesome photos! Nice LEDs. Will you send us photos when you have it ready? Photos like this, in dark.
Title: Re: Driver for constant current that I am developing.. Work?
Post by: matheuslps on February 11, 2011, 03:59:01 AM
Sure I will take some photos!

Better, I will do a WIP (Work in Progress) when they arrive.

But It is a torture buy something from DealExtreme. The products takes too long time to arrive.

They are coming from Hong Kong. I bought on 19-01-2011. Hope they will arrive in 1 ou 2 months!  :o

Ahhh... There are more photos here: http://www.superled.com.br/zbxe/?document_srl=5554 (http://www.superled.com.br/zbxe/?document_srl=5554). But those are not mine.

from bob:

Quote
Then you can saturate the whole assembly in epoxy resin of some kind to give weather protection and lastly, fit it in such a place where you would have plenty of air flow to cool the heat-sink while you're on the move.

I was trying to figure how to cooler and you gave me an interesting idea! But I have one doubt: If I put the LM338 inside a box made of heatsinks and close all the holes with epoxy resin, could the LM338 burn inside? If I fit it in such a place where have plenty of air flow to cool the heat-sink, wil it be enough?

bye
Title: Re: Driver for constant current that I am developing.. Work?
Post by: kam on February 11, 2011, 08:00:17 AM
cool! the aluminum enclosure is very cool! and as i see, you will not have a problem with light. those LEDs are very powerful. Whenever you have it ready, inform me to feature it
Title: Re: Driver for constant current that I am developing.. Work?
Post by: bob on February 11, 2011, 15:14:48 PM
Hi Matheus,
take a look at these. The choice of a heatsink for 338 depends on how much power it will  disipate (voltage drop accros regulator, times,the current drown by the LEDs). You should be able to work it out from Kam's calculations. Read them again. All you need is there. For the LEDs, the same. One of these is very neat, but may be a bit pricy.
You decide.Personaly, if I was doing it, I would have gone for the best. Remember, try to make it as profesional as you can manage. I am sure, your friends will be impresed, once you get it going.
Cheers. Bob
Title: Re: Driver for constant current that I am developing.. Work?
Post by: matheuslps on March 30, 2011, 01:10:21 AM
Just a update!!!

My leds just arrived!!!!!!

I did a simple test. Took a PC power supply and used the orange cable, 3.3V. I measured and was 3.1V. So the led is very under powered... LED has an exponential curve.

Sorry about the quality of the pics. I took with a cellphone.

Tomorrow I will go to the college and use their power suply and take more pics with a decent camera.

So:

(http://i.imgur.com/nk01O.jpg)

(http://i.imgur.com/punZ0.jpg)

(http://i.imgur.com/PMvSj.jpg)

(http://i.imgur.com/XQ7NC.jpg)

(http://i.imgur.com/mihie.jpg)

(http://i.imgur.com/3qfRW.jpg)

(http://i.imgur.com/99kbP.jpg)

(http://i.imgur.com/qJxcy.jpg)

(http://i.imgur.com/axwOf.jpg)

(http://i.imgur.com/QHh7s.jpg)

(http://i.imgur.com/OwmwS.jpg)

(http://i.imgur.com/XBQWZ.jpg)

(http://i.imgur.com/IQ5HJ.jpg)

bye

Title: Re: Driver for constant current that I am developing.. Work?
Post by: kam on March 30, 2011, 14:38:04 PM
these LEDs are so cool!!! please do me a favor. can you also measure the current for different voltage rates? for example 3V, 3.1, 3,2 and 3.3? thanks
Title: Re: Driver for constant current that I am developing.. Work?
Post by: matheuslps on March 30, 2011, 20:24:33 PM
I will measure on a practical test today at 19:00 (-3GMT). But you can aproximate with the datasheet:

(http://i.imgur.com/ZngKy.png)

bye
Title: Re: Driver for constant current that I am developing.. Work?
Post by: matheuslps on March 31, 2011, 07:45:13 AM
So, I went to the laboratory at the college and made some practical tests....

OBS: I will put only image links because it is easy to see.....

Well, I am very happy with the results.

First I took one led and connected it to the power suply and rised the voltage. It did not work very well, the led was bllinking.... So I changed the aproach and I made a current power suply. Just put the voltage´s knob at maximum and I increaded the current slowly....

First, see my power suply:

http://i.imgur.com/Ugh7W.jpg

I put a fan below the heatsink. This power suply has two power, on the left I powered the fan, 11.6~12V:

http://i.imgur.com/qcJT0.jpg

Here you can see the first test, 3V@560mA

http://i.imgur.com/lYtLg.jpg

Here is 3.1V@740mA. The image shows 3.0V, but the power suply change very quickly to 3.1V:

3.2V@990mA:

http://i.imgur.com/6tSXh.jpg

3.3V@1.60A:

http://i.imgur.com/5cuhE.jpg

3.4V@2.04A:

http://i.imgur.com/uuDAk.jpg

3.5V@2.45A:

http://i.imgur.com/Huzc2.jpg

And finally, 3.6V@2.8A. Sure I can go higher, but the datasheet says that this is the maximum current..

http://i.imgur.com/M9WI3.jpg

This is a image of all 3 leds on the same heatsink:

http://i.imgur.com/eT1f6.jpg

The circuit:

http://i.imgur.com/sdOm6.jpg

Now I started the test with the 3 leds in serie. Just turn on the power supply and aplied some current. 8.2V@150mA

http://i.imgur.com/ruZKe.jpg

The circuit:

http://i.imgur.com/3Hhmd.jpg

8.9V@490mA:

http://i.imgur.com/LoCB6.jpg

9.9V@1.5A:

http://i.imgur.com/qC8rn.jpg

The circuit:

http://i.imgur.com/0dq62.jpg

10.3V@2A:

http://i.imgur.com/roNcx.jpg

10.7V@2.8A

http://i.imgur.com/1ma2h.jpg

The circuit:

http://i.imgur.com/lrxnj.jpg

Lets try to make light on all of the room:

http://i.imgur.com/nSOWS.jpg

The system:

http://i.imgur.com/LPZfE.jpg

Ahhh, my notes:

http://i.imgur.com/KX71t.jpg

All 3 Leds@2.8A. The guy in red is the one who cares of the laboratory, the midle one is my electronic teacher and the right one is my electric protection teacher:

http://i.imgur.com/NYM60.jpg

Just one more:

http://i.imgur.com/gpNIY.jpg

So guys, I am very happy with this first result. I think that this leds needs a lense to narrow the light beam.

What do you think?

bye

Title: Re: Driver for constant current that I am developing.. Work?
Post by: kam on March 31, 2011, 23:10:11 PM
you are so cool! And i think that the LEDs are super powerful. A lens is indeed a great accessory for those. Tell me something, i see you have a fan on the heatsink. Does it get TOO hot and you need a fan? i mean, if i use similar leds for room light (not main light but something for watching tv), i need to consider a fan as well?
Title: Re: Driver for constant current that I am developing.. Work?
Post by: matheuslps on April 01, 2011, 02:22:27 AM
Hum...

The fan was just to test those leds. I did not know how much they could get hot.

With the fan the heatsink became a little warm. I forgot to test without the fan.

But to not have problem, use a bigger heatsink.

There is a book on the college with some calcs to choose the right heatsink. I will take it and read.

bye