pot with multiple LEDS
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 7
- Joined: Mon Nov 22, 2010 11:17 pm
pot with multiple LEDS
Ok, so I have multiple LED's rigged up to light up on certain occasions, as well as a pot rigged up to an analog sensor. is there a command to tell the arduino not to use the full 5v for the LEDs, as I am unable to find a way to rig up multiple LEDs to one pot. is there a way to do this, or is there a way to rig up multiple LEDs to one pot without screwing things up that I haven't realized yet?
- Franklin97355
- Posts: 23912
- Joined: Mon Apr 21, 2008 2:33 pm
Re: pot with multiple LEDS
PWM will limit the apparent voltage to a pin or in the case the amount of time they are on.
- stinkbutt
- Posts: 593
- Joined: Wed Feb 17, 2010 2:40 am
Re: pot with multiple LEDS
You might want to throw a bypass capacitor with one end between the PWM output and the LED's, & the other end attached to ground. That way the voltage gets smoothed out down to the lesser voltage you're going for.
The other thing you could do is use a constant current source. There are a couple of options out there for that, but since you've got a pot in the circuit already, then you could use it (or a different pot) to adjust the current going through the LED's:
The output current from that circuit will be I = 1.25V / R where R is the resistance of the pot at that time.
There are other constant current source options, including a op-amp based options and a slew of dedicated LED drivers, but you can put that circuit together for about $1.50.
The other thing you could do is use a constant current source. There are a couple of options out there for that, but since you've got a pot in the circuit already, then you could use it (or a different pot) to adjust the current going through the LED's:
The output current from that circuit will be I = 1.25V / R where R is the resistance of the pot at that time.
There are other constant current source options, including a op-amp based options and a slew of dedicated LED drivers, but you can put that circuit together for about $1.50.
Last edited by stinkbutt on Wed Dec 08, 2010 9:42 pm, edited 1 time in total.
- stinkbutt
- Posts: 593
- Joined: Wed Feb 17, 2010 2:40 am
Re: pot with multiple LEDS
You'll want to be careful that your input voltage isn't much much higher than your output voltage. The current is going to be whatever you set it for, and the voltage drop across the LM317 is going to be the difference between the input & output voltages. Since P = V * I, that can get pretty high if you're not careful.
Please be positive and constructive with your questions and comments.