I've been playing with a series of 6 LED's as a first project and have the following setup:
6 x LEDS (2v voltage drop and 20ma target current), each LED has its own resistor and PIN on the Uno with a common ground.
I calculate that as 150 Ohms for each LED.
I'm pretty sure I have that bit nailed however I have a question regarding Duty Cycle. Lets say I'm using the PWM pins and write 122 to the pins, ~50% duty cycle, does that mean any of the variables used to initially calculate my required resistance change? ie. the voltage drop across the LED? Or does it all remain unchanged?
What happens to the current draw at ~50% duty cycle, is it reduced by 50~ as its only high for half of a full cycle?
What happens to the current draw at ~50% duty cycle, is it reduced by 50~ as its only high for half of a full cycle?
All remain unchanged.
Calculation is based on maximum peak current 20 mA, and must be preserved to avoid any damage to electronics parts.
Current is not DC anymore, when you drive a LED using PWM, so to answer your second question, depends on what point in the circuits you talking about. Current integral value consumed by all circuitry would be 50 %.
With regards to the current consumed by all circuitry, if the engineer knows that the system will permit the following as maximums:
1 x LED on at 20ma - 100% Duty Cycle
1 x LED on at 10ma - 50% Duty Cycle
1 x LED on at 5ma - 25% Duty Cycle
3 x LED off
Is it good or bad practice to state that this subsystem requires a maximum of 35ma when factoring it into the total current draw of a larger system, or should it be recorded as the full 20ma of all 6 LED's although they'll never all be lit at the same time, taking us to 120ma and therefore potentially influencing the design of the rest of a system where another engineer may well have to make changes to accommodate this.
All completely out of interest you understand, I'm just messing around at home on an Uno with 6 LED's.
I'm not sure, what is the industry standard in this case. IMHO, if there is a chance to set all LED to 100 % ( by mistake, software bugs or hardware failure) current has to be shown as 120 mA in docs. If designer intend never light up some of the LED to 100 %, current than should be limited by hardware - via resistor to 5 or 10 mA, and you even will get better software resolution 0- 100 % instead of 0- 25 or 0- 50 %.
Thanks, I thought it was an interesting one, point taken about bugs.
The thing I'm writing just makes 6 LEDs cycle up and down, one lead LED at 100% then two trailing at reducing output, 3 will always be unlit, no need for more resolution.