Shop OBEX P1 Docs P2 Docs Learn Events
Circuit for 12v LED PWM controlling? — Parallax Forums

Circuit for 12v LED PWM controlling?

CrosswindsCrosswinds Posts: 182
edited 2011-08-16 14:30 in Propeller 1
Hi Guys!


Iam in the need for a LED controller for my fishtank, and will simulate sunrise and sunset with a prop.

I think i am home on the software side, but am a bit worried about the circuit.


Since the LED´s im using need 12v (G4).

I think the perfect thing would have been to just use a circuit like the ULN2803A for this. But since that one only can control outputs with the same voltage as the controller-side (propeller), that fails.

I hope im makeing my self clear here!

Does someone have a circut-suggestion for doing this?


Thanks!

/Daniel

Comments

  • PublisonPublison Posts: 12,366
    edited 2011-08-11 12:19
    Crosswinds wrote: »
    Hi Guys!

    Since the LED´s im using need 12v (G4).

    I think the perfect thing would have been to just use a circuit like the ULN2803A for this. But since that one only can control outputs with the same voltage as the controller-side (propeller), that fails.

    /Daniel

    The ULN2803A will accept drive voltages up to 30 Volts. The inputs will react to Propeller voltages.

    http://oomlout.com/8TRA/8TRA-Guide.pdf

    I use these chips to drive 12 Volt Solenoids all the time. Propellers and ULN2803A work well together.
  • JonnyMacJonnyMac Posts: 9,208
    edited 2011-08-12 07:54
    The ULN 280x is an open-collector device so you can control any voltage you like within spec. You will, of course, need to have the ULN ground connected to the Propeller ground, but the source voltage from the ULNs can be a separate supply.
  • CrosswindsCrosswinds Posts: 182
    edited 2011-08-12 16:04
    Thanks guys for your help! This sounds great.

    Just have one more question. It says that it can handle 500mA per output, but is this simultanious?



    Publison wrote: »
    The ULN2803A will accept drive voltages up to 30 Volts. The inputs will react to Propeller voltages.

    http://oomlout.com/8TRA/8TRA-Guide.pdf

    I use these chips to drive 12 Volt Solenoids all the time. Propellers and ULN2803A work well together.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-08-12 16:24
    Crosswinds wrote: »
    Thanks guys for your help! This sounds great.

    Just have one more question. It says that it can handle 500mA per output, but is this simultanious?

    Maybe I'm wrong but I think you have to look at power dissipation over the entire package. You will see in the data sheet that it's limited to about 2.25 watts for the whole package. And wattage = Volts x Current. So it's not just a question of current - it's also how many volts at which you are running.

    Power Dissipation
    (one Darlington pair) 1.0 watts
    (total package) 2.25 watts


    http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/CD00000179.pdf
  • CrosswindsCrosswinds Posts: 182
    edited 2011-08-13 05:30
    Maybe I'm wrong but I think you have to look at power dissipation over the entire package. You will see in the data sheet that it's limited to about 2.25 watts for the whole package. And wattage = Volts x Current. So it's not just a question of current - it's also how many volts at which you are running.

    Power Dissipation
    (one Darlington pair) 1.0 watts
    (total package) 2.25 watts


    http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/CD00000179.pdf

    Hello! Thank you for your answer!

    I have now measured the current of thise devices.

    they use 130mA.

    12 x 0,13 = 1,56w

    Would that mean that i will draw 1,56 + 1w = 2,56? And it can only handle 2.25 total? :S
  • Heater.Heater. Posts: 21,230
    edited 2011-08-13 05:44
    The chip is only consuming power when is on, obviously, but don't forget that when it is on there is only a small voltage drop through the chip to ground. You might have to try it with one of your LEDs and measure it.
    Let's say it was 0.5 volts. So he power consumed in the chip when on is I times V = 130ma times 0.5 volts = 65 milliwats.
    Seems like it should be quite safe.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2011-08-13 06:17
    Heater. wrote: »
    The chip is only consuming power when is on, obviously, but don't forget that when it is on there is only a small voltage drop through the chip to ground. You might have to try it with one of your LEDs and measure it.
    Let's say it was 0.5 volts. So he power consumed in the chip when on is I times V = 130ma times 0.5 volts = 65 milliwats.
    Seems like it should be quite safe.

    Beware! The 2803 is a darlington configuration which means that the output will not saturate below 0.8V. The power calculation is based of course as heater infered on the voltage drop across the device and nothing to do with the supply voltage. Frankly I don't see why good old discrete transistors aren't just used. Even at the smd level the tiny BC817s easily handle 500ma each.

    EDIT: Just read the DS and it quotes around 1.1V max saturation voltage for a 100ma load.
  • CrosswindsCrosswinds Posts: 182
    edited 2011-08-13 06:25
    Heater. wrote: »
    The chip is only consuming power when is on, obviously, but don't forget that when it is on there is only a small voltage drop through the chip to ground. You might have to try it with one of your LEDs and measure it.
    Let's say it was 0.5 volts. So he power consumed in the chip when on is I times V = 130ma times 0.5 volts = 65 milliwats.
    Seems like it should be quite safe.

    Oh got a bit confused before this, i thought i should calculate with the wattage of the load!

    Should i hook this up, and measure the voltage on the load directly to see the voltage-drop? Then calculate with that?
    Beware! The 2803 is a darlington configuration which means that the output will not saturate below 0.8V. The power calculation is based of course as heater infered on the voltage drop across the device and nothing to do with the supply voltage. Frankly I don't see why good old discrete transistors aren't just used. Even at the smd level the tiny BC817s easily handle 500ma each.

    EDIT: Just read the DS and it quotes around 1.1V max saturation voltage for a 100ma load.

    I have several 2803 laying around, and i tought it would be a neat package! But ofcourse a regular transistor should work. Do you have any you can recommend for this? No use for SMD´s here.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-08-13 07:55
    Crosswinds wrote: »
    Oh got a bit confused before this, i thought i should calculate with the wattage of the load!....

    I confess, I was confused by what that really meant, too. Thanks to Heater and Peter for clearing that up.
  • CrosswindsCrosswinds Posts: 182
    edited 2011-08-13 10:35
    Ok guys! Have done some testing now! :)

    Input from the transformer: 11,97v output from the ULN to the LED´s 11,17v and one LED draw like ~110mA when it gets 11,17.

    I cannot see very much light-power change due to this, so maybe im in the clear with that.

    But could i feed 4 of these with the ULN and be in the clear? because i guess it only can handle 500mA all together and not for each channel?

    What do you guys think about this?

    Ofcourse it would be great to in some way be able to feed them 12v. But that is not really a problem.
  • Heater.Heater. Posts: 21,230
    edited 2011-08-13 10:48
    What voltage do you see from the ULN pins to ground?
  • kwinnkwinn Posts: 8,697
    edited 2011-08-13 18:00
    Crosswinds wrote: »
    Ok guys! Have done some testing now! :)

    Input from the transformer: 11,97v output from the ULN to the LED´s 11,17v and one LED draw like ~110mA when it gets 11,17.

    I cannot see very much light-power change due to this, so maybe im in the clear with that.

    The led intensity is a function of the current through it, not the voltage. There is probably an internal current limiting circuit of some type built in to the led. As long as the voltage is above a certain point it has very little effect on the intensity.
    But could i feed 4 of these with the ULN and be in the clear? because i guess it only can handle 500mA all together and not for each channel?

    What do you guys think about this?

    The ULN2803 can not drive all 8 outputs at 500mA, it can however drive all 8 outputs simultaneously at 110mA per output. There was a similar thread a while back using the ULN to drive solenoids and the data sheet with the derating info was posted there.
    Of course it would be great to in some way be able to feed them 12v. But that is not really a problem.

    The 12V is a nominal rating. If you look at the data sheet you will find that it can be 12V +/- x% (typically +/-5%) or has lower and upper voltage ratings listed somewhere.
  • CrosswindsCrosswinds Posts: 182
    edited 2011-08-14 04:41
    Heater. wrote: »
    What voltage do you see from the ULN pins to ground?

    0,8v
    kwinn wrote: »
    The led intensity is a function of the current through it, not the voltage. There is probably an internal current limiting circuit of some type built in to the led. As long as the voltage is above a certain point it has very little effect on the intensity.



    The ULN2803 can not drive all 8 outputs at 500mA, it can however drive all 8 outputs simultaneously at 110mA per output. There was a similar thread a while back using the ULN to drive solenoids and the data sheet with the derating info was posted there.



    The 12V is a nominal rating. If you look at the data sheet you will find that it can be 12V +/- x% (typically +/-5%) or has lower and upper voltage ratings listed somewhere.

    Thank you for clearing this up! Then it should be possible to use all the gates, since they pull about 100mA each then!
  • Heater.Heater. Posts: 21,230
    edited 2011-08-14 05:06
    My next concern about this is the LED lamp. There is no such thing as a 12v LED. I have a couple of 12v LED lamps that fit into sockets where halogen bulbs used to be on desk lamps. Are they just a case of having LEDs in series an current limiting resistors? Is there a rectifier to make use of both cycles of the 12v AC? Is there even some switched mode PSU chip in there to make things more efficient?

    In short what are those things and would using PWM supply on them work as expected?
  • CrosswindsCrosswinds Posts: 182
    edited 2011-08-14 06:40
    Hello again Heater!

    I from what i understand they are in series and use a current limit resistor. There is no integrated PSU or such stuff. but there is a rectifier. T
    hese are the most simple ones out there. They have just made them work with 12 volt.
  • CrosswindsCrosswinds Posts: 182
    edited 2011-08-16 06:09
    Okey! Wake up this old thread again! :)

    Ive changed my mind about using the ULN´s for this. I would rather have a way that i can feed the all 12pcs of LED´s through. And not having separate cables for each one!

    It will be something like 1.5-1.6 amp 12v (for all twelve together) from my measurements. They (according to the manufacturer) draw 1w per pcs.

    What would you recomend for this? Somekind of transistor? I do have TIP102´s laying around.
  • PublisonPublison Posts: 12,366
    edited 2011-08-16 11:37
    Boy! Your all over the place with different thread. I suggest you stick with one.

    Check out Jon's Nut's and Volts article:

    http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp9.pdf

    and another that incorporates DMX:

    http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp3.pdf

    If you can get a schematic of the LED board, that would be nice
  • CrosswindsCrosswinds Posts: 182
    edited 2011-08-16 14:30
    Publison wrote: »
    Boy! Your all over the place with different thread. I suggest you stick with one.

    Check out Jon's Nut's and Volts article:

    http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp9.pdf

    and another that incorporates DMX:

    http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp3.pdf

    If you can get a schematic of the LED board, that would be nice

    Firstly, thank you for the links! Will check them out.

    Secondly im sorry if my two threads got blended together. They were meant as two. One for the hardware, and one more for the software bit!


    But i guess we could stick with this then! :)
Sign In or Register to comment.