pot with multiple LEDS

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
mbrown9412
 
Posts: 7
Joined: Mon Nov 22, 2010 11:17 pm

pot with multiple LEDS

Post by mbrown9412 »

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?

User avatar
Franklin97355
 
Posts: 23912
Joined: Mon Apr 21, 2008 2:33 pm

Re: pot with multiple LEDS

Post by Franklin97355 »

PWM will limit the apparent voltage to a pin or in the case the amount of time they are on.

User avatar
stinkbutt
 
Posts: 593
Joined: Wed Feb 17, 2010 2:40 am

Re: pot with multiple LEDS

Post by stinkbutt »

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:
constant.current.png
constant.current.png (4.71 KiB) Viewed 1658 times
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.

mbrown9412
 
Posts: 7
Joined: Mon Nov 22, 2010 11:17 pm

Re: pot with multiple LEDS

Post by mbrown9412 »

Great, Thanks!

User avatar
stinkbutt
 
Posts: 593
Joined: Wed Feb 17, 2010 2:40 am

Re: pot with multiple LEDS

Post by stinkbutt »

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.

Locked
Please be positive and constructive with your questions and comments.

Return to “Microcontrollers”