There's one thing that I've always been a bit lost on while playing with my Arduino, and that is power issues. I understand the basics, and can figure out things like needed resistance for LEDs, but beyond that I'm pretty lost.
I'm sure some of you have seen this. He goes into explanation about how he powers these by using a 5v supply which handles 25A. Beyond that, there is little explanation as to how these are powered.
I recently finished a project where I controlled a single RGB LED. This was accomplished through the use of PWM on the Arduino. For a similar system I would create to the mood lighting one, I don't believe I would need such a complex setup as he had the individual slave units so he could control more LED groups specifically. I'd probably just be interested in two channels using the 6 PWM pins on the Arduino.
I guess my question is really this:
If PWM is used to control the power to an LED, how can you power the LED through an external source? Am I confusing what PWM actually is/does?
I figure the amperage capability of the Arduino will not suffice to power let's say, 10, 1 amp RGB LEDs. If anyone can just roughly explain how these LEDs would be power external while preserving the ability to use PWM, it would be greatly appreciated!
If PWM is used to control the power to an LED, how can you power the LED through an external source? Am I confusing what PWM actually is/does?
When using external power to supply current for a device like a LED or motor, the Arduino PWM output signal does not supply the current, but rather controls the external current by toggling the main switching device (usually a transistor) on and off. The externl transistor is acting like a current amplifier that the pwm signal controls.
Does that make sense?
Yes, that does make sense. Shows how little I know about the power side of these projects as I didn't immediately think of a transistor! :-/
I guess the question then becomes if the transistor would accept the same sort of signal as I am currently passing straight into the LED. That is, currently I am passing values between 0 and 255 for the R, G, and B pins on the LED. I presume a transistor could handle varying inputs the same way through PWM (ie. would not simply be on or off)?
Then, after a quick search on transistors, it seems that different transistors handle different levels of power (which makes sense). Looking at RadioShack's current inventory, I see, for example, one transistor designed to dissipate 40w.
So, could we use the equation Watts = Amps x Volts to determine the required wattage handling for a series of LEDs? Let's say the LEDs are at 1 amp (which seems to be the approximate draw of the 3w RGB LEDs). Let's say I have 6 of these LEDs (6 amps total) in series, and in the example I linked earlier, he used a 5v power supply.
6 amps x 5 volts = 30 watts
Does this work? So for the handling of a given series of 6 of these LEDs, would that calculation be accurate? Is that how you determine what size transistor is needed?
Lots of questions... thanks for helping me out to get a grasp of all this!
After doing a bit of reading on the tech specs for some transistors, I see that they vary in their amperage handling, which isn't always directly related to their dissipation of wattage. So how do I know what the voltage handling capability is of a transistor? Will most transistors handle 5v, 9v, 12v, etc? (normal voltage levels for LEDs) It's not immediately clear on some of these tech spec pages on the store's website.
I may go by RadioShack after work and pick up a couple of transistors to test them out with some external power sources.
A transistor's rating is the maximum it will take, so you always operate at less current and less voltage than the rating, at least 80% less and normally more.
which isn't always directly related to their dissipation of wattage.
I guess the question then becomes if the transistor would accept the same sort of signal as I am currently passing straight into the LED. That is, currently I am passing values between 0 and 255 for the R, G, and B pins on the LED. I presume a transistor could handle varying inputs the same way through PWM (ie. would not simply be on or off)?
Pulse Width Modulation, or PWM, is a technique for getting analog results with digital means. Digital control is used to create a square wave, a signal switched between on and off. This on-off pattern can simulate voltages in between full on (5 Volts) and off (0 Volts) by changing the portion of the time the signal spends on versus the time that the signal spends off. The duration of "on time" is called the pulse width. To get varying analog values, you change, or modulate, that pulse width. If you repeat this on-off pattern fast enough with an LED for example, the result is as if the signal is a steady voltage between 0 and 5v controlling the brightness of the LED.