Run a string of LEDs from the mains


Closed Thread
Results 1 to 31 of 31
  1. #1
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697

    Default Run a string of LEDs from the mains

    Hi, I would like to run 80 LEDs directly from the mains. Here in the UK the mains is 240V. That gives 3V per LED and they are rated at 3-4V. Would there be any problems with this? Ive been told that i should use a current limiting resistor when running LEDs from 12V. As far as im aware thats only needed if the input voltage is greater than whats required (i still dont completely understand this stuff).

    As its AC then there would be a slight flickering on the LEDs. Could i use 4 diodes to make a rectifier? The diodes are only meant for about 50V 1A. Technically they would be in series with the LEDs so it shouldnt matter. Could it cause any problems though?

    I thought about adding a capacitor aswell to reduce the flicker as much as possible. I found one thats 470N 250V. Would 470N be enough?

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


    Did you find this post helpful? Yes | No

    Default

    Hey Sparky

    Why not buy a string of lights and save the possibility of letting your magic smoke out for another day?
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    Because that would be too simple

    These LEDs are going to be on a PCB and used to make a really bright light. Ive been thinking about a few other projects that would need the same kind of thing so now would be a good time to get it right.

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


    Did you find this post helpful? Yes | No

    Default

    If you are serious about this we need to look at the data sheet for the LEDs.
    You say 3-4 volt... That is quite a range.
    Amps per LED? 0.025???
    And does the mains fluctuate any? Here I get anything from 110 to 120.
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Dec 2004
    Location
    USA
    Posts
    36


    Did you find this post helpful? Yes | No

    Default

    Current limiting resistors limit current draw, not voltage. You will need the resistors.

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


    Did you find this post helpful? Yes | No

    Default

    The datasheet can be found here. They use 50mA so the whole string should only use 50mA.

    I keep hearing all the time that things only take as much current as they need. So a 50mA string of LEDs will be fine on a 13A mains circuit. I read that they will only take too much current if i put too many volts into them.

    The power in our house can be a bit strange. We are supposed to be getting only 230V but ive never seen it drop below 240 and quite often its as high as 250. Dips wont be a problem and spikes should be fine as i could put over 300V into the string and still be within the max voltage

  7. #7
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Don't do it.

    As an experiment, put a string of LED's across your Car Battery without any form of Current Limiting - that's a reasonably constant voltage - then go rev your car engine up...

    > Could i use 4 diodes to make a rectifier?

    Yes

    > The diodes are only meant for about 50V 1A.

    Well that's kinda stupid to use them on 240v then!

    > I found one thats 470N 250V. Would 470N be enough?

    Depends on how much current you're pulling... but the 250v bit is totally inadequate, because by the time you full-wave rectify mains you'll have close to 340vDC.

    Back to my first line... DON'T DO IT. You are running the risk of harming yourself, your property and putting at serious risk those around you.

  8. #8
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,806


    Did you find this post helpful? Yes | No

    Default

    I double the Melanies post.

    But if you insist on doing it, PLEASE promiss to have a camera on and with direct link to internet, so we can all see what happens the moment you turn the power ON!

    Direct link is needed as you may not be able to send the video file later!

    Anyway, some notes on he LED.

    1. 50mA is the Absolute Maximum. So according o D.S., 30mA is the working conditions.

    2. Each LED is different so a range of 3-4 volts is logiacal. BUT, if you have a source of 10 volts, then you calculate the 3.5 Volts/.03A to find the resistor that each led should have in order to balance its current.

    3. A slight increase in Voltage will dramatically increase the current through LED as its characteristics are not Linear. It is NOT a resistor! It is a diode.

    Now if you still want to do it, I would suggest:

    WARNING All voltages are lethal!

    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

    OK. We finished.

    Hope you wear safety glasses and gloves because:

    1. LEDS may explode if they get high voltage by accident

    2 Every where on the circuit are very lethal voltages!

    If you still want to do it, don't forget the Video Camera!

    Ioannis

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


    Did you find this post helpful? Yes | No

    Default

    Thanks for the info. I know the diodes are rated at 50V but my thinking was that the LEDs are rated at 3V and the diodes would be in series with them. Thats why i asked this seemingly silly question. I will make sure to use diodes suitable for mains.

    It seems i give the impression that im willing to plug things into the mains without caring if it will explode or not. I do actually think about these things. I usually check here even if i know what im doing but i have a few doubts. I wont be plugging these LEDs right into the mains. I will start with lower voltages and step it up gradually. I wont be touching random parts of this circuit while its turned on. I have been working with mains voltages for many years and i know how painfull it can be. I will be as careful as i always am when dealing with high voltage

  10. #10
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Multiply this by 95 LED's and a lot more vicious...



    OK... let's be helpful... look at this and follow instructions...



    I absolutely trust this guy... here's a great tip from him on how to make your workplace smell nice...


  11. #11
    timmers's Avatar
    timmers Guest


    Did you find this post helpful? Yes | No

    Default

    Don't forget that with all these LEDs in series that if one blows or goes high impedance (and they do change with time and temperature) they will all go off. Just like christmas tree lights.

    Put say 10 of them in series and use a boost driver like the Sipex SP6691 or similar with current regulation.

    8 banks of 10 will work much better than 1 bank of 80.

    Quote Originally Posted by The Master View Post
    I have been working with mains voltages for many years and i know how painfull it can be. I will be as careful as i always am when dealing with high voltage
    Your'e gonna have to be more careful than that!

    Rectified mains is not forgiving at all. -Ask any qualified TV engineer.
    Mains thats passed through a bridge rectifier will cause the resultant -v output to be at a half mains potential, and not ground as you would expect / hope.

    Good luck.

  12. #12
    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
    It seems i give the impression that im willing to plug things into the mains without caring if it will explode or not. I do actually think about these things. I usually check here even if i know what im doing but i have a few doubts. I wont be plugging these LEDs right into the mains. I will start with lower voltages and step it up gradually. I wont be touching random parts of this circuit while its turned on. I have been working with mains voltages for many years and i know how painfull it can be. I will be as careful as i always am when dealing with high voltage
    We are just concerned about your safety..

    I will now sound like the old gezzer I am and say that I have been "playing" with high voltage/amps for I will bet more years than you have been alive.

    I see NO reason to risk your health and safety doing something like this. I would not try it. To many things that can and probably will go wrong. Yes it can be done, but why? Just to say you did it?

    Do like timmers suggested and run multiple strings from a lower voltage.
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    Thanks for the links. I just need 4KV now... :P

    I am considering running multiple smaller strings already but using 1 long string seems to be more efficient.

    Im planning a few projects that will involve having hundreds of LEDs lighting up together. These LEDs use 50mA which adds up to quite a lot and i would probably need multiple transformers to run them all. Running them from the mains would mean theres no need for any transformers so it would be a lot cheaper

  14. #14
    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.

  15. #15


    Did you find this post helpful? Yes | No

    Default

    Well, if you are planning to sell these commercially at some point, you should look at UL (and whatever the EU version is, IEC maybe?) requirements. Conencting directly to the mains may be cheaper from an implemetation standpoint, but all the extra safety features that would be required to meet these standards would probably drive the cost back up. Also High voltage is anything above about 40VAC or 60VDC.
    Last edited by falingtrea; - 30th September 2009 at 18:52. Reason: spelling correction
    Tim Barr

  16. #16
    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.

  17. #17
    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

  18. #18
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,806


    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.

  19. #19
    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.

  20. #20
    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.

  21. #21
    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!

  22. #22
    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?

  23. #23
    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

  24. #24
    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.

  25. #25
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,806


    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

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


    Did you find this post helpful? Yes | No

    Default

    Nothing happens to the color. What should i be seeing?

    The LEDs im using work on a min of 3V. They can go upto 4V if needed. With 80 LEDs that gives me an extra 80V to play with. If the voltage goes up over 320V then you would expect things to blow up anyway. If i were running 4 LEDs through a 12V transformer then i would expect 320V input to give me 16V output so still 4V per LED

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


    Did you find this post helpful? Yes | No

    Default

    You should see a color change when running at the peak voltage.

    Just curious.... What does RMS stand for and how is applied to electronics?
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    With 4 LEDs running on 12V they are all running at their lowest voltage. I have accidentally put too many volts into some of these LEDs before. They dont change color they just get slightly brighter and stop working after a few days.

    Do you mean root mean square? I think someone has mentioned this in one of my previous threads but i didnt quite understand it

  29. #29
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,806


    Did you find this post helpful? Yes | No

    Default

    1. your typical 240 Vac when rectified will be 240 x 1.41 =338.4 Volts DC. But if line goes up to 250 then 250 x 1.41 = 352.5!

    So watch out.

    2. RMS is that AC voltage that represents the same thermal effect when an equal DC voltage is applied to the load. That is if your line is 240Vac and you put a resistor on the line, that resistor will get hot. If you then apply DC voltage, you have to apply exactly 240 Volts to have the same thermal effect.

    BUT note that 240Vac is not the maximum level that the line reaches. Is the peak of the sinus wave form and is 240x1,41.

    Ioannis

  30. #30
    Join Date
    Feb 2008
    Location
    Michigan, USA
    Posts
    231


    Did you find this post helpful? Yes | No

    Default

    The explanations that people are giving you are good but maybe a different one will help.

    A LED will pull WAY more current than is healthy for it if it is not restricted in some way. The color is one indication that things are going badly and in short order. The resistor is sized so that it limits the current to a safe level using Ohm's law. Limiting it to MAX will reduce the potential life of the LED. Common practice it to limit it to less than max, hence, the suggestion of 30 mA instead of 50 mA. The voltage rating is what is needed to light the particular material (they are different because they use different materials to give different colors).

    A quick look at a Digikey catalog gives a few examples:
    Color,forward voltage, max current
    Red, 2.0vdc, 25mA
    Green , 2.2vdc, 25mA
    Blue , 3.65vdc, 30mA

    You can run any of these off of a 12 v supply because there is more than enough to overcome the "bandgap" of the material, but you still need to limit the current to around 20 mA. (less than the max listed).

    The calculations are this:
    Red: 12.0v - 2.0v = 10v: 10v / .020A = 500 ohm
    Green: 12.0v - 2.2v = 9.8v: 9.8v / .020A = 490 ohm
    Blue: 12.0v - 3.65v = 8.35v: 8.35 / .020A = 417.5 ohm

    Common practice it to find the common value that is closest, but higher value, or if close, but lower (more current) recalculate and see how close you are to max and determine if you can live with the reduction in life.

    On a side note, if you put a 1n917 diode accidentally across 120v ac mains, they release their smoke explosively! ie: glass shards many feet away.

    Reading between the lines of your questions, prudent advise would be that lower voltage is much more likely to give you the chance to live a long and fruitful life.

    I will admit that the idea did intrigue me when I first read it. Outdoor IR illumination came to mind, but after mulling it over, even with 25 years of working around the "magic lightning" I decided I'm going to pass.

    Good luck
    Bo

    The little LED thumb sized flashlights are an interesting case in design. You open it and wonder why they don't need a resistor. The batteries are coin cells that are limited in the amount of current that they can supply even if shorted, so the current limit is a function of the batteries. If you supplied the same voltage from a power supply, the LED would smoke in short order.
    Last edited by boroko; - 1st October 2009 at 17:02. Reason: another thought:

  31. #31


    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

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 : 1

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