I am using a 3.7V (18650) battery, but its fully charged voltage is 3.85V.
When calculating a resister for an LED circuit, do I use the battery's voltage rating (3.7V) or the fully charged voltage (3.85V)?
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It only takes a minute to sign up.Sign up to join this community
LEDs are not really "rated" to a certain voltage, they are rated to a certain current, and their forward voltage will depend on forward current. You need to limit current through them based on the max ratings. Keep in mind, the max ratings sometimes don't mention that you need additional heat sinking to actually operate properly at those currents on some of the higher power LEDs.
If the LED is rated to 20mA, do not think it's safe to just look at (3.85Vmax - 3.4Vf - 0.55V) and use ohm's law to get 27.5 Ohms and put a resistor in of that exact value. Resistors often have "tolerances" that are ~5% unless you get fancy ones which cost more (in small runs it's not so bad, but production volume this is important). The tolerances mean you may actually be over the rating and over-stressing/heating the component without realizing it. Always be conservative, so for this case I'd go with 33Ohms 5% resistor. This means it could be between 31 and 35 Ohms in reality. This is still safe enough for the LED but will be around 16mA. Because LEDs give off light in a non-linear fashion, and because the human eye also perceives light intensity in a non-linear fashion, you will not really notice the difference between the 20mA and 16mA currents. There will be a larger and more noticeable difference between 20mA and 10mA though.
EDIT2: The current rating for LEDs is continuous - as in, forever. If you over-current pulse them most can handle very high currents for a short duration (in the microsecond range, maybe tens of millisecond range) and I have done this myself in my Strobe light project. If your LEDs are not used often, but you want a bright pulse, you can over-current them. In this case you usually use FETs and other switching mechanisms to turn them on/off for a short time, and a low value resistor is used for the pulse current limiting.
EDIT: One final tip, is LEDs work best with constant current. For lower currents like 15,20mA you can get really cool 2-pin package JFETs (with integrated resistor) with their gate tied to the source pin which self-limits and can work with usually quite different voltage supplies. They can be found in very small surface mount packages, and will give constant current basically until the forward voltage is met from the battery being drained. You can read more about them from this Vishay app note.
First of all, isn't it 4.2V when fully charged?
Second of all, this is a poor way to drive an LED. There is likely to be a noticeable change in brightness as the battery drains, and if the load current is variable, the LED will appear to pulse as the load current changes, especially as the battery gets lower.
If you have at least one regulated voltage on the board, you can drive the LED with a much more consistent current using one transistor and three resistors. Depending on the diode forward voltage, this might provide constant current all the way down to 3V, and even if it does start to drop off, it will still provide more current at low battery than a simple current limiting resistor design.
simulate this circuit – Schematic created using CircuitLab V1 could be an IO pin from a processor or something. When it is off, the LED will be off, too. R1 and R2 are a voltage divider keeping the base of Q1 at around 1.2V. R3 will therefore always have around 0.6V on it (simulate or build and test to get a more accurate number, but this is ballpark). So the current through D1 will be be approximately 0.6/R3. I tried to set it for around 20 mA, but you can adjust R3 as needed. This circuit can be used in mass production as long as you are not designing a NIST traceable illumination source or something. The voltages I quote above may not be exactly accurate, but whatever the voltage is, it will be reasonably consistent from unit to unit.
If you don't have a regulated voltage suitable for creating a stable voltage divider for the base of Q1, you can use a current source with two diodes and a transistor (and a few resistors).
I haven't actually used this in a production design, but I think it will work OK. It is a common way to get a relatively constant current when there is no regulated voltage available. The voltage across D1 and D2 will be around 1.2V, and won't change much over the useable battery range. Rest of the circuit is the same as the first one.