Hi all. Have a simple button box project but with a small screen (from Teensy, the little ~3in LCD they offer) and a Teensy 3.2. I Intend to have 5-8 small single color LEDs inside the box to provide backlight to the button panel. Goal is to mimic the Elite Dangerous in-game pilot interface, shown here, so most of the LEDs are cyan, a couple will be amber:
I've done buttons before, comfortable with them, and this will just be simple momentary microswitches, no pots or encoders (this side - "right hand" panel will have both). This question is about also just using the Teensy to provide the current to some LEDs for lighting effects. I know the T3.2 has a per-pin current limit and a total current limit. The LEDs purchased are all in the 3.3V 20mA 'typical' run range, and should give plenty brightness at low current draw, but my intent was to put them on some PWM pins and run them at lower duty cycle to dim as needed and hopefully extend lifetime. The question is, do I really need the resistor in line with each LED?
Basically I guess my question boilds down to: is the per-pin current limit "controlled" by the Teensy (e.g. it can't deliver more) or is simply a ''rating" (It'll provide as much as the load defines, until I kill it, user must make sure it *shouldn't* demand more)? Even the simple tutorial using an RGB LED shows placing a 220ohm R on each channel. I would use one LED per PWM pin up to a small number max in case I need to have a few slightly brighter than others to help the backlit clear 3D print difuser glow more 'uniform'. I'll make a small circuit board that sources 5V off the USB input to provide the screen some power (powered hub between the whole mess and the computer), lets me place the microswitches under my 3D printed button forms, and place the LEDs as well. So I can add resistors as needed, I just don't 100% grasp if I need to.
I did search and for example found some threads with for example powering a single Neopixel with no resistor indicated, but Neopixels have their own driver so maybe that's a poor example vs. the tiny surface-mount LEDs I've picked. (https://www.digikey.com/en/products...tRDFTcnc1VThzUm9rWWFseW1IUEtXQ3c5bGJiUVQifQ== )
Worst part of the dumb questions is I actually am a EE, but microcontrol and active circuits are well outside my normal work. I do electromagnetics mostly (antenna design, waveguides, that sort of thing...all just metal and dielectric to shape the waveform in space, tune the frequency response and impedances. I fail at anything transisitory. ;-) ) I did successfully build one other button box already with a Teensy3.2, including 1 encoder, but the "lights" on that panel are all totally separate lighted switches for 12V power distribution to/from other things. (The panel has 12V in, several switched 12V outs, and the Teensy in there is powered with a buck converter turned down to about 6V on one of those switched lines, with the little backside trace scratched off between Vin and VUSB on the Teensy itself, so I can switch the buttons on or off vs. unplugging the USB cable in that case).
I've done buttons before, comfortable with them, and this will just be simple momentary microswitches, no pots or encoders (this side - "right hand" panel will have both). This question is about also just using the Teensy to provide the current to some LEDs for lighting effects. I know the T3.2 has a per-pin current limit and a total current limit. The LEDs purchased are all in the 3.3V 20mA 'typical' run range, and should give plenty brightness at low current draw, but my intent was to put them on some PWM pins and run them at lower duty cycle to dim as needed and hopefully extend lifetime. The question is, do I really need the resistor in line with each LED?
Basically I guess my question boilds down to: is the per-pin current limit "controlled" by the Teensy (e.g. it can't deliver more) or is simply a ''rating" (It'll provide as much as the load defines, until I kill it, user must make sure it *shouldn't* demand more)? Even the simple tutorial using an RGB LED shows placing a 220ohm R on each channel. I would use one LED per PWM pin up to a small number max in case I need to have a few slightly brighter than others to help the backlit clear 3D print difuser glow more 'uniform'. I'll make a small circuit board that sources 5V off the USB input to provide the screen some power (powered hub between the whole mess and the computer), lets me place the microswitches under my 3D printed button forms, and place the LEDs as well. So I can add resistors as needed, I just don't 100% grasp if I need to.
I did search and for example found some threads with for example powering a single Neopixel with no resistor indicated, but Neopixels have their own driver so maybe that's a poor example vs. the tiny surface-mount LEDs I've picked. (https://www.digikey.com/en/products...tRDFTcnc1VThzUm9rWWFseW1IUEtXQ3c5bGJiUVQifQ== )
Worst part of the dumb questions is I actually am a EE, but microcontrol and active circuits are well outside my normal work. I do electromagnetics mostly (antenna design, waveguides, that sort of thing...all just metal and dielectric to shape the waveform in space, tune the frequency response and impedances. I fail at anything transisitory. ;-) ) I did successfully build one other button box already with a Teensy3.2, including 1 encoder, but the "lights" on that panel are all totally separate lighted switches for 12V power distribution to/from other things. (The panel has 12V in, several switched 12V outs, and the Teensy in there is powered with a buck converter turned down to about 6V on one of those switched lines, with the little backside trace scratched off between Vin and VUSB on the Teensy itself, so I can switch the buttons on or off vs. unplugging the USB cable in that case).