I have a red, a green, and a blue LED that I need to light up brightly. Only one at a time, though. My project is run from batteries, and I would like the brightness to not diminish as the batteries lose voltage. I understand that is what a constant current circuit is for.
(...and 10/10 for correct thinking - very rare around here!)
Can I just use one LM317 adjustable voltage regulator, or would I need 3, or is there an easier way?
You can do it with 1 if you're only going to light up 1 LED at a time. Nothing will die if you turn all of them on but the brightness won't be what you want.
Easier then a LM317 + resistor? Probably not.
If I wanted to light up more than one I'd do it with one of these
or (this - same thing
). Yes, it's a VU meter but if you tie pin 7 to VCC you get five constant-current pins, no other components needed, and they take up less space on a PCB than resistors/whatever. You can also connect pin 7 to an Arduino pin and PWM it or whatever. Worth buying a few dozen if you're going to play around with LEDs...