I am extremely new to this community so I hope I don't tick anyone off with this post. However, I am in need of some guidance here as I'm currently working on a little school project.
To give you all a general idea of what we're doing, we are trying to control a set of ultra-bright LEDs by using Arduino Wifi Rev 2. Right now, we are trying to understand how to adjust output current or voltage (???) in order to dim the lights.
I'm guessing that we need this current to range between 0-150mA.
Is there anyway to program current output or voltage output on the Arduino?
Not directly, it requires external parts.
But with leds you often do it another way called PWM, that is turning the led on/off very fast and regulating the brightness by waring the ratio between on/off (called duty-cycle). Arduino do directly support this with analogWrite().
You could look into stepper motor control. There are simpler ones around that can control max amps digitally directly. You could use those to limit your amp draw and thus omit the external resistor. My question would be: Why do this? The resistor will be specific to LED power allowance and required voltage drop between Uin and Ureq. so you could just use a fixed resistor, and then control brightness using the PWM functions....
I have to chuckle at the description "ultra-bright LEDs". The boils down to "modern LEDs", which are now highly efficient, something earlier, dimmer generations of LEDs simply were not.
I doubt it is possible to increase the efficiency of LEDs significantly further at this point. The term "ultra-bright" reflects nothing more than the excitement of improvements in technology - and the enthusiasm of marketing. It is now superfluous.
Here's the point: Cite the Web reference to the actual specification of these LEDs that you have. Then we can discuss how best to control them. Otherwise we will just be talking around in circles.
PWM is your best bet, LEDs are current devices not voltage devices. Yes you can dim them with voltage but it is crude and has a very narrow control range. The information you need to do this project was given to you by the teacher, next time take better notes. This response is to help you get started in solving your problem, not solve it for you.
Good Luck & Have Fun!
Gil
I'm guessing that we need this current to range between 0-150mA.
Don't guess because you can't design something on a guess.
If you do have an LED that will take 150mA then you have a high powered LED and PWM is NOT your best bet, or even a bet at all.
You need an adjustable constant current supply and some good heat sinks.
gilshultz:
The information you need to do this project was given to you by the teacher, next time take better notes.
So were you in the room, psychic, or just guessing? Once again:-
This response is to help you get started in solving your problem, not solve it for you.
This statement proves to be false, and is spreading miss information. Do you work for the Russians or Chinese?
Only if the PWM is part of a constant current regulation circuit. Using a PWM voltage applied to a LED / resistor combination at 150mA is not really on.
Probably because you didn’t test it correctly. What circuit / voltage do you run this on.
I always consider 100 mA is the dividing line where you can run a resistor as a current limiting device, assuming that you are wanting to run the LED somewhere close to the maximum rating. There is no problem if you are vastly under running the LED, but the OP seems to want these LEDs to run bright.
I do not have any fixed dividing lines, but evaluates the parameters for each case. There are a couple of ways
to regulate led brightness:
Adjust a switching current regulator
Adjust a linear current regulator
PWM a switching current regulator
PWM a linear current regulator
PWM a resistor
I used or seen all of them used in different situation. The most common types are 3), 4) and 5).
The cheap regulators for led strips is 5).
A linear current regulator can be made with a chip called 7135, but it is too much in this case because it is a 350mA driver. This chip is very easy to PWM.
I used or seen all of them used in different situation.
Yes me too.
The usefulness of a series resistor to approximate a constant current drive for an LED depends on the voltage it is dropping. The higher the voltage the better it is at approximate a constant current drive. For higher current LEDs this normally requires a higher voltage and consequently higher power dissipation in the resistor. While things are a bit fluid sticking to a quarter or eighth watt resistor imposes restrictions on the voltage you when trying to run currents that the OP is thinking he needs.
As we have not hear back from the OP as to actually what current he needs, what we are all doing is guessing at possible solutions, which is not helpful.
Grumpy_Mike:
As we have not hearD back from the OP as to actually what current he needs, what we are all doing is guessing at possible solutions, which is not helpful.