Run a string of LEDs from the mains


Closed Thread
Results 1 to 31 of 31

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Just wondering.

    All of the LEDs on one string will be a "spot light", no control.
    I would think you would want to be able to control at least "banks". You could then have dimming, blinking or what ever... For an idea...
    http://www.picbasic.co.uk/forum/showthread.php?t=10200

    As for the current. The LEDs will last much longer at 0.03 or even a bit lower. Running at the max will shorten the life a lot.

    100 LEds at 0.03 is only 3 amps. A 10 amp transformer would take care of 300 LEDs. With some cushion
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default

    In this case there will just be 1 set of LEDs. Some of the other projects will need multiple chanels but there will be 80 per chanel (maybe double that depending on the project).

    So far ive always been planning for the LEDs to use 50mA to make sure i dont get a transformer thats too small. I know in practice that they use a little less.

    Now for a dumb sounding question. How do i run the LEDs at 30mA instead of 50mA. Im lead to believe that if i use, for example, 5 LEDs on 12V instead of 4 then obviously the voltage drops but the current is supposed to drop too.

  3. #3
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default

    falingtrea: If i use a transformer inside a device then would it make a difference? 240V would still be going into it so i would need to look at all that safety stuff anyway

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by The Master View Post
    falingtrea: If i use a transformer inside a device then would it make a difference? 240V would still be going into it so i would need to look at all that safety stuff anyway
    But the "safety stuff" would be isolated to one point.
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    But the "safety stuff" would be isolated to one point.
    Thats a good point. Most of these projects would involve having the LEDs on the same board as the transformer but while testing its probably a good idea if most of the PCB has low voltage running through it

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    mackrackit: This confuses me a bit. you say theres no need to worry with 5 LEDs on 12V but they could be a bit dim. Are you saying theres no need for any resistor? I wouldnt normally use a resistor in this case anyway.
    Now the wheels are turning...
    You tried 4LEDs across 12 volts with out a resistor. Put in a 220 or whatevere and see what happens to the color.

    I know this is all a bit confusing. Maybe another reason not to run from mains directly. At least not untill you get all of this sorted out.
    Dave
    Always wear safety glasses while programming.

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,139


    Did you find this post helpful? Yes | No

    Default

    I think you need some basic classes on electronics. Maybe the Art of Electronics is a book all have to read first.

    That picture shows the relation between Current and Voltage. Do you notice how steep is the curve at the point where the diode starts to contact? A very little increase at Voltage and the current will be infinite!. Thats why a resistor is needed or even better a current source to stabilize the current at 30 or if you insist on decreasing ED life at 50mA.

    A battery is very constant and 12 will never be 13 volts without any good reason. But Power line? No ones guarantees the 240Vac. So what will happen to you precious diode (read LED) when the voltage across the pins moves away from the knee of the curve? Bam!

    Ioannis

  8. #8


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by The Master View Post
    falingtrea: If i use a transformer inside a device then would it make a difference? 240V would still be going into it so i would need to look at all that safety stuff anyway
    Which is why most companies buy an off the shelf power supply solution. The power supply company handles the safety issues. If a part already meets UL or IEC standards, you usually don't have to requalify the part when you submit your product that includes the pre-approved product.
    Tim Barr

  9. #9
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,139


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by The Master View Post
    How do i run the LEDs at 30mA instead of 50mA. Im lead to believe that if i use, for example, 5 LEDs on 12V instead of 4 then obviously the voltage drops but the current is supposed to drop too.
    1. How do you run at 50mA ? The same way at 30mA.

    2. What do you mean the voltage drops? Every LED needs a forward voltage of about 3.4 volts and the current should stay about 30mA. So if your source is 12 Volts then your resistor which should always considered there has to drop the rest of thevoltage that is 12-3.4=8.6 and its vaue would be 8.6/.03=286.6 ohms

    Now if you want in series more leds, thats OK. put up to 3, and 3 x 3.4 = 10.2 volts. The rest should be dropped on the resistor in series. You cannot omit the resistor and put another LED. Chances are that they will not light.

    Why? The answer is simple. Look at the characteristic curve of a diode (or LED, its the same). It conducts the forward voltage at a very specific point and increasing the voltage slightly, the current increases dramaticaly. I said that on my previous post but you did not give it attention.

    Look at the attached photo.

    Ioannis
    Attached Images Attached Images  
    Last edited by Ioannis; - 30th September 2009 at 19:26.

  10. #10
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by The Master View Post
    Now for a dumb sounding question. How do i run the LEDs at 30mA instead of 50mA. Im lead to believe that if i use, for example, 5 LEDs on 12V instead of 4 then obviously the voltage drops but the current is supposed to drop too.
    No dumb questions

    Some of the confusion might go back to folks calling the resistor a current limiting device. It is and is not...

    In this case look at it as a voltage limiter. But being volts and amps kinda go together...

    Look at the math Ioannis gave you.
    1. Have a 4x1N4004 or 4007 diodes as a rectifier, or even better a bridge rectifier (4 pins) for 500Volts/2-5Amps.

    2. On the AC line, fuse and a small resistor for the in-rush currents, say 2-5 ohms.

    3. After rectification a capacitor of 220uF/500 Volts.

    4. Calculate maximum voltage as 250 Vac x 1,41=353 Volts DC on te capacitor.

    5. Calculate the total drop of LEDs say 332.5 Volts. Calculate the number of LEDs 332.5/3,5= 95 LEDs.

    6. Calculate the resistor to be in series as (353 - 332.5)/.03 = 680 Ohms

    7. Calculate the power of the resistor .03 x .03 x 680= 620mW. I would go x4 to set it at 2,5Watts
    6. Calculate the resistor to be in series as (353 - 332.5)/.03 = 680 Ohms
    Change .03 to .05 and the result is 410~ Ohms.

    So lets say you are running 5 LEDs from 12 volts and each LED uses 3.5 volts and you want to run at 0.03 amps.
    Well guess what... 5 LEDs at that voltage adds up to 17.5 volts.
    4 LEDs? = 14 volts...
    Do not need to worry here. Could be a bit dim...

    3 LEDs? = 10.5 volts. Yup, now we have a problem. There is 1.5 volts to much.
    12 - 10.5 = 1.5
    1.5 / 0.03 = 50 Ohm resistor.
    1.5 / 0.05 = 30 Ohm resistor.
    Dave
    Always wear safety glasses while programming.

  11. #11
    timmers's Avatar
    timmers Guest


    Did you find this post helpful? Yes | No

    Default

    ... or use a constant current regulator.

    Leds in series with a current sense resistor at the bottom. Regulator will up the supply voltage until enough current flows through the resistor to generate the devices feedback voltage. As the Leds age they go dim because their resistance increases. No problem, regulator will up the voltage to compensate giving you a constant brightness.
    Connect the enable function to a PWM output, and hey presto PWM dimming!

  12. #12
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default

    Ioannis: I am trying to take all of this in but i dont understand all of it.

    These LEDs do work fine if i put 4 in series on 12V (3V per LED). Thats the min value specified in the datasheet. They are pleanty bright enough at that.

    Sorry but i dont understand what that pic means.

    mackrackit: This confuses me a bit. you say theres no need to worry with 5 LEDs on 12V but they could be a bit dim. Are you saying theres no need for any resistor? I wouldnt normally use a resistor in this case anyway.

    I may have misunderstood but i think some previous posts said that 80 LEDs (3V each at 240V) would blow up because of the current. If i use a transformer that supplies 12V 6A then isnt this the same problem?

Similar Threads

  1. How about String Variables?
    By mytekcontrols in forum PBP Wish List
    Replies: 40
    Last Post: - 20th January 2015, 12:53
  2. Embedded Strings in your Code Space
    By mytekcontrols in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 9th March 2008, 07:50
  3. Using LEDs as light sensors
    By skimask in forum Code Examples
    Replies: 3
    Last Post: - 30th December 2006, 22:19
  4. Visual Basic 6 & Access 2000
    By Demon in forum Off Topic
    Replies: 33
    Last Post: - 7th September 2006, 04:39
  5. controlling leds with the switches
    By ilteris in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 12th October 2005, 21:02

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts