LED string with PWM
-
- Posts: 323
- Joined: Tue Sep 06, 2011 2:54 am
- Has thanked: 166 times
- Been thanked: 26 times
Re: LED string with PWM
Hi Enamul,
Thanks for this software,
It is an interesting way to make a PWM.
Just one thing I wonder is this, when you press the UP or Down button will the 180Ms delay not cause the pwm to stall on a low state while pressed and cause the LED to go to full brightness until the button is released again?
I was actually thinking of using the internal comparator.
But lets see first how well this one will work.
In my Program I posted two ADC one for reading three buttons and one for checking the battery so it is not controlled with one button.
But by different voltage dividers.
In this way I can have the board with the switches about 2 Meters away from the Light itself, and only a three core cable to control the light.
I normally hang a camping light high on a tree.
Best Regards:
Uli
Thanks for this software,
It is an interesting way to make a PWM.
Just one thing I wonder is this, when you press the UP or Down button will the 180Ms delay not cause the pwm to stall on a low state while pressed and cause the LED to go to full brightness until the button is released again?
I was actually thinking of using the internal comparator.
But lets see first how well this one will work.
In my Program I posted two ADC one for reading three buttons and one for checking the battery so it is not controlled with one button.
But by different voltage dividers.
In this way I can have the board with the switches about 2 Meters away from the Light itself, and only a three core cable to control the light.
I normally hang a camping light high on a tree.
Best Regards:
Uli
-
- Posts: 323
- Joined: Tue Sep 06, 2011 2:54 am
- Has thanked: 166 times
- Been thanked: 26 times
Re: LED string with PWM
Hi Enamul,
Thanks for this software,
It is an interesting way to make a PWM.
Just one thing I wonder is this, when you press the UP or Down button will the 180Ms delay not cause the pwm to stall on a low state while pressed and cause the LED to go to full brightness until the button is released again?
I was actually thinking of using the internal comparator.
But lets see first how well this one will work.
In my Program I posted I use two ADC one for reading three buttons with different resistors, the one for the buttons and can be read in any part of the program since it uses 5 volt.
In this way I can have the board with the switches about 2 Meters away from the Light itself, and only a three core cable to control the light.
I normally hang a camping light high on a tree.
The other ADC to monitor the battery has to read when the Leds are off.
Best Regards:
Uli
Thanks for this software,
It is an interesting way to make a PWM.
Just one thing I wonder is this, when you press the UP or Down button will the 180Ms delay not cause the pwm to stall on a low state while pressed and cause the LED to go to full brightness until the button is released again?
I was actually thinking of using the internal comparator.
But lets see first how well this one will work.
In my Program I posted I use two ADC one for reading three buttons with different resistors, the one for the buttons and can be read in any part of the program since it uses 5 volt.
In this way I can have the board with the switches about 2 Meters away from the Light itself, and only a three core cable to control the light.
I normally hang a camping light high on a tree.
The other ADC to monitor the battery has to read when the Leds are off.
Best Regards:
Uli
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: LED string with PWM
Hi,
My post in pic12f617 pwm area uses tmr0 for pwm duty cycle so there is problem in switch sense. I will comparator issue & will let you know
Enamul
My post in pic12f617 pwm area uses tmr0 for pwm duty cycle so there is problem in switch sense. I will comparator issue & will let you know
Enamul
-
- Posts: 323
- Joined: Tue Sep 06, 2011 2:54 am
- Has thanked: 166 times
- Been thanked: 26 times
Re: LED string with PWM
Hi Enamul.
I think there is a misunderstanding.
I am refering to the Program you wrote for the PIC16F877
Best Regards:
Uli
I think there is a misunderstanding.
I am refering to the Program you wrote for the PIC16F877
Best Regards:
Uli
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: LED string with PWM
I knew that you are referring to the program I posted using PIC 16f877a...but I have posted the updated version the same program using one switch to control duty cycle in your other post which uses PIC 12f617..thta's why I refer you to that post. Because that program also use soft PWM but no switch press issue in that one...I think there is a misunderstanding.
I am refering to the Program you wrote for the PIC16F877
I know this problem might happen in PIC16f877a program that's why I kept on working on the program to improve that issue and finally I mange to solve that using TMR0 and I post it in other post...just that nothing else..
Enamul
-
- Posts: 323
- Joined: Tue Sep 06, 2011 2:54 am
- Has thanked: 166 times
- Been thanked: 26 times
Re: LED string with PWM
Hi Enamul.
Thanks for the Info.
I did not know the Pragram on the other topic was also intended for the LED string.
Based on the first program I got some Ideas and I managed to make a program that works fine.
See Attachment.
I think it still needs some changes so that it will not affect the light when writing to EEPROM I think that takes a bit longer than reading an ADC
Best Regards:
Uli
Thanks for the Info.
I did not know the Pragram on the other topic was also intended for the LED string.
Based on the first program I got some Ideas and I managed to make a program that works fine.
See Attachment.
I think it still needs some changes so that it will not affect the light when writing to EEPROM I think that takes a bit longer than reading an ADC
Best Regards:
Uli
- Attachments
-
- Camping LightA.fcf
- (17.66 KiB) Downloaded 831 times
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: LED string with PWM
Hi,
So you want to add EEPROM write program in your version? You are using PIC 12f617 which don't have EEPROM but as you mentioned in earlier post you will move to PIC12f1822..so will I try to post something with EEPROM using that pic?
Enamul
So you want to add EEPROM write program in your version? You are using PIC 12f617 which don't have EEPROM but as you mentioned in earlier post you will move to PIC12f1822..so will I try to post something with EEPROM using that pic?
Enamul
-
- Posts: 323
- Joined: Tue Sep 06, 2011 2:54 am
- Has thanked: 166 times
- Been thanked: 26 times
Re: LED string with PWM
Hi
Yes later when the Pic12f1822 arrives I want to use EEPROM.
For now I just use the Pic12f617 for testing the circuit.
I just wonder If the LM317 current Regulator needs a minimum load.
Should I ad a 1 K resistor that it has a minimum load when the fet is off?
Best Regards:
Uli
Yes later when the Pic12f1822 arrives I want to use EEPROM.
For now I just use the Pic12f617 for testing the circuit.
I just wonder If the LM317 current Regulator needs a minimum load.
Should I ad a 1 K resistor that it has a minimum load when the fet is off?
Best Regards:
Uli
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: LED string with PWM
Hi,
If you connected Adj resistor and resistor between adj and output pin as described in datasheet you should not need any load connected....
Enamul
If you connected Adj resistor and resistor between adj and output pin as described in datasheet you should not need any load connected....
Why you are asking so? Is there any problem still you are facing in LM317?I just wonder If the LM317 current Regulator needs a minimum load.
Should I ad a 1 K resistor that it has a minimum load when the fet is off?
Enamul
-
- Posts: 323
- Joined: Tue Sep 06, 2011 2:54 am
- Has thanked: 166 times
- Been thanked: 26 times
Re: LED string with PWM
Hi
The way I understand it if the fet on the LED string is off there is no voltage flowing through the regulator.
Basically with Each cycle of the PWM the regulator turns on and off.
I wonder if this could cause instability of the regulator, and shorten the Life of the LED's
The way I understand it if the fet on the LED string is off there is no voltage flowing through the regulator.
Basically with Each cycle of the PWM the regulator turns on and off.
I wonder if this could cause instability of the regulator, and shorten the Life of the LED's
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: LED string with PWM
Hi Uli,
I am not quite clear whether you meant that you have used regulator IC after FET..what type of configuration you have used? if you apply pulsed input to regulator in that case you will not get the desired response from LM 317.
Enamul
I am not quite clear whether you meant that you have used regulator IC after FET..what type of configuration you have used? if you apply pulsed input to regulator in that case you will not get the desired response from LM 317.
I would use LM317 immediate to battery to regulate voltage and the regulated voltage would be the Vdd of FET and the LED string would be connected between Vdd and drain. If you are thinking that single LM 317 can't supply enough current for the LED string in that case you can increase the number of LM317 in parallel...The way I understand it if the fet on the LED string is off there is no voltage flowing through the regulator.
Basically with Each cycle of the PWM the regulator turns on and off.
Enamul
-
- Posts: 323
- Joined: Tue Sep 06, 2011 2:54 am
- Has thanked: 166 times
- Been thanked: 26 times
Re: LED string with PWM
Hi
I am planning to make a new board with surface mount parts.
I just do not know how the Equivalent parts are named.
Diode 1n4001
Diode 1n4007
Transistor Bc547
Transistor BC557
Transistor Bc327
Transistor BC337
What packages are the easy ones to solder?
What about capacitors and resistors.
What packages are easy to solder?
Best Regards:
Uli
I am planning to make a new board with surface mount parts.
I just do not know how the Equivalent parts are named.
Diode 1n4001
Diode 1n4007
Transistor Bc547
Transistor BC557
Transistor Bc327
Transistor BC337
What packages are the easy ones to solder?
What about capacitors and resistors.
What packages are easy to solder?
Best Regards:
Uli
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: LED string with PWM
For diodes..
http://www.diodes.com/products/catalog/ ... -id=3353#1
Following site is good for SMD all type of basic components..
http://www.lazer.com.au/parts.shtml
http://www.diodes.com/products/catalog/ ... -id=3353#1
Following site is good for SMD all type of basic components..
http://www.lazer.com.au/parts.shtml
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: LED string with PWM
Hello,
1206 and 0805 packages are ok to do by hand or in an oven.
SOT23 are also fairly simple to do.
This 3rd party guide is quite helpful if you want to learn how to bake SMD parts using an oven.
http://www.001tech.co.uk/Forum/viewtopic.php?f=18&t=60
1206 and 0805 packages are ok to do by hand or in an oven.
SOT23 are also fairly simple to do.
This 3rd party guide is quite helpful if you want to learn how to bake SMD parts using an oven.
http://www.001tech.co.uk/Forum/viewtopic.php?f=18&t=60
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 323
- Joined: Tue Sep 06, 2011 2:54 am
- Has thanked: 166 times
- Been thanked: 26 times
Re: LED string with PWM
Thanks for the Info.
So you would suggest to stay clear of 603 packages when using a soldering iron?
Best Regards:
Uli
So you would suggest to stay clear of 603 packages when using a soldering iron?
Best Regards:
Uli
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: LED string with PWM
Hi Uli,
0603 are do able and once you have a bit of practice they are no problem but I would start with the 0805 or 1206 packages as these are much easier. Also you will need a good set of tweezers as its almost impossible without them. Should only be a few £ from places like Rapid or Farnell.
0603 are do able and once you have a bit of practice they are no problem but I would start with the 0805 or 1206 packages as these are much easier. Also you will need a good set of tweezers as its almost impossible without them. Should only be a few £ from places like Rapid or Farnell.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 323
- Joined: Tue Sep 06, 2011 2:54 am
- Has thanked: 166 times
- Been thanked: 26 times
Re: LED string with PWM
Hi to all.
I went to my first camping trip with the Camping light.
It has 3 Strings of 2 Cree Xlamp Mx3
I drive them at 350mA per string and it gives good light.
In a big tent 3x3 meters I dim it to about 35% and can still easily read.
Just thinking of using a different driver so I can make it work with 3Leds in a string instead of two.
So I get 30% more light for the same amount of power.
I saw an interesting driver. Cat4104 Similar to the Cat4101 but it can drive four strings of 175mA or two strings of 350mA if pairs two outputs are paralleled.
It is cheaper and hopefully more suitable for the lower power LED's.
Has anyone used them yet?
I also wonder if I still should make a driver for the PWM input, or if it is not needed for the enable pin of the Cat4104.
http://www.onsemi.com/pub_link/Collateral/CAT4104-D.PDF
Has anyone tried this one?
I also want to try some new LED's Xlamp ML-E
http://www.cree.com/~/media/Files/Cree/ ... pML_BL.pdf
The current Rating is 150mA current max is 500mA
Now my question is would it be a bad thing to drive them up to 350mA since a camping light is not used every day I guess it still should last for ages.
Also at this current it would still give more light than the MX3 at 350mA
Best Regards:
Uli
I went to my first camping trip with the Camping light.
It has 3 Strings of 2 Cree Xlamp Mx3
I drive them at 350mA per string and it gives good light.
In a big tent 3x3 meters I dim it to about 35% and can still easily read.
Just thinking of using a different driver so I can make it work with 3Leds in a string instead of two.
So I get 30% more light for the same amount of power.
I saw an interesting driver. Cat4104 Similar to the Cat4101 but it can drive four strings of 175mA or two strings of 350mA if pairs two outputs are paralleled.
It is cheaper and hopefully more suitable for the lower power LED's.
Has anyone used them yet?
I also wonder if I still should make a driver for the PWM input, or if it is not needed for the enable pin of the Cat4104.
http://www.onsemi.com/pub_link/Collateral/CAT4104-D.PDF
Has anyone tried this one?
I also want to try some new LED's Xlamp ML-E
http://www.cree.com/~/media/Files/Cree/ ... pML_BL.pdf
The current Rating is 150mA current max is 500mA
Now my question is would it be a bad thing to drive them up to 350mA since a camping light is not used every day I guess it still should last for ages.
Also at this current it would still give more light than the MX3 at 350mA
Best Regards:
Uli
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: LED string with PWM
Hi,
This IC looks pretty cool. Yes, you can easily drive 4 strings and 2 strings as you said. But I think you shouldn't drive maximum current on it. you can always try to see how warm it becomes after driving 175mA in each branch.Cat4104 Similar to the Cat4101 but it can drive four strings of 175mA or two strings of 350mA if pairs two outputs are paralleled.
-
- Posts: 323
- Joined: Tue Sep 06, 2011 2:54 am
- Has thanked: 166 times
- Been thanked: 26 times
Re: LED string with PWM
Yes I think along the same line.
If It gets warm I will only drive 1 string of 350mA or two strings of 175mA per Regulator.
Could I drive the Xlamp MLE that is rated to 150mA and has a maximum current of 500mA to 350mA?
Is that reasonable? I know I will have a bit less Lumens per watt, but probably I would use it at a 50% PWM duty most of the time.
What is your experience?
How High do you usually drive LED's? To rated current or to something between rated and Maximum current?
Best Regards:
Uli
If It gets warm I will only drive 1 string of 350mA or two strings of 175mA per Regulator.
Could I drive the Xlamp MLE that is rated to 150mA and has a maximum current of 500mA to 350mA?
Is that reasonable? I know I will have a bit less Lumens per watt, but probably I would use it at a 50% PWM duty most of the time.
What is your experience?
How High do you usually drive LED's? To rated current or to something between rated and Maximum current?
Best Regards:
Uli
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: LED string with PWM
I would suggest to drive max 150 mA not more than that.Could I drive the Xlamp MLE that is rated to 150mA and has a maximum current of 500mA to 350mA?
Yes you can always try in hardware using 50% PWM to see what current they are drawing and what is the level of illuminations.I know I will have a bit less Lumens per watt, but probably I would use it at a 50% PWM duty most of the time.
Should try to operate in the rated current not too close to maximum..How High do you usually drive LED's? To rated current or to something between rated and Maximum current?
-
- Posts: 323
- Joined: Tue Sep 06, 2011 2:54 am
- Has thanked: 166 times
- Been thanked: 26 times
Re: LED string with PWM
Hi,
I made my new board now with a Cat4104 And Cree MLE LED's.
This chip is quite cool, but in real life you can not use 175mA per channel. I guess that rating is calculated with the minimum dropout voltage of 400mV. The data sheet says you can put some resistors to scale down the voltage before it enters the Cat4104. When you use a Car battery voltage fluctuates a quite bit between 12 and 14.2 volts, so the Cat4104 still has to handle quite a bit of fluctuation. So I settled to use only about 40ma per channel so it does not heat up when the battery is charging.
In my case now I use one CAT4104 per channel.
It works great, and I am quite happy with it.
It is very good for low power applications.
The 150mA LED's are easy to use there is not that much heat so I soldered them straight on a PC Board, it provides enough cooling.
Now I have the challenge of making an enclosure.
I just wondered is it possible to paint a circuit board with white car paint. So you will not see the board when you look at the light.
Of course I would cover the LED's with masking tape.
Best Regards:
Uli
I made my new board now with a Cat4104 And Cree MLE LED's.
This chip is quite cool, but in real life you can not use 175mA per channel. I guess that rating is calculated with the minimum dropout voltage of 400mV. The data sheet says you can put some resistors to scale down the voltage before it enters the Cat4104. When you use a Car battery voltage fluctuates a quite bit between 12 and 14.2 volts, so the Cat4104 still has to handle quite a bit of fluctuation. So I settled to use only about 40ma per channel so it does not heat up when the battery is charging.
In my case now I use one CAT4104 per channel.
It works great, and I am quite happy with it.
It is very good for low power applications.
The 150mA LED's are easy to use there is not that much heat so I soldered them straight on a PC Board, it provides enough cooling.
Now I have the challenge of making an enclosure.
I just wondered is it possible to paint a circuit board with white car paint. So you will not see the board when you look at the light.
Of course I would cover the LED's with masking tape.
Best Regards:
Uli
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: LED string with PWM
I don't think it will cause any issue. If you use that when the paint is dry.I just wondered is it possible to paint a circuit board with white car paint. So you will not see the board when you look at the light. Of course I would cover the LED's with masking tape.
-
- Posts: 323
- Joined: Tue Sep 06, 2011 2:54 am
- Has thanked: 166 times
- Been thanked: 26 times
Re: LED string with PWM
Hi to all.
Just burned my camping light out.
I use some of these very flat tactile switches without a button, just bare foil, or whatever you can call it.
The metal part jumped off onto the voltage regulator and made a short. (it looks like you can not use them push them directly with your finger.)
I have two boards, one with the switches, and the pic. From there is a three core cable going to the Board with the LED's and current regulators.
On the PWM line going to the Cat4104 regulator I have a resistor and a 5.1volt zener diode for protection. Also on the board with the LED's it has its own voltage regulator for the supply to the Cat4104 current regulator.
That the voltage regulator on the board of the switches burned out I can understand.
But it also did quite a bit of damage to the board with the LED's
78L05 regulator is burned out and at least one of the current regulators.
So I just wonder what additional protection I should make.
Just burned my camping light out.
I use some of these very flat tactile switches without a button, just bare foil, or whatever you can call it.
The metal part jumped off onto the voltage regulator and made a short. (it looks like you can not use them push them directly with your finger.)
I have two boards, one with the switches, and the pic. From there is a three core cable going to the Board with the LED's and current regulators.
On the PWM line going to the Cat4104 regulator I have a resistor and a 5.1volt zener diode for protection. Also on the board with the LED's it has its own voltage regulator for the supply to the Cat4104 current regulator.
That the voltage regulator on the board of the switches burned out I can understand.
But it also did quite a bit of damage to the board with the LED's
78L05 regulator is burned out and at least one of the current regulators.
So I just wonder what additional protection I should make.
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: LED string with PWM
Ahhaa..
Can you please post a schematic of the system to understand clearly..so that we can suggest you for more protection.
To avoid shortening I think it would be good if you could post couple of pictures of component orientation in zip...to help us visualize the condition and try to help you.

Can you please post a schematic of the system to understand clearly..so that we can suggest you for more protection.
To avoid shortening I think it would be good if you could post couple of pictures of component orientation in zip...to help us visualize the condition and try to help you.
-
- Posts: 323
- Joined: Tue Sep 06, 2011 2:54 am
- Has thanked: 166 times
- Been thanked: 26 times
Re: LED string with PWM
The shortening is just because the membrane from a tactile switch jumped off unto the regulator. So we can not blame the circuit for it. The question on my mind is why it did damage to the LED board.
See schematics:
I just added a picture of the broken tactile switch.
It looks like this type is not suitable for being pushed directly by hand. The yellow part jumped on the voltage regulator.