A common question asked on forums is one about – Driving an Infrared Led directly from an Arduino pin. Although the answer may be obvious to anyone with at least a basic knowledge of Ohm’s Law, many are confused about how to choose a resistor value for optimum performance. Often, there is a debate about whether a resistor is required at all, given that the AVR pins are rated to deliver an absolute maximum of 40mA on a pin. (Note: All of the quoted specs in the data sheet are for test conditions of up to 20mA on a pin). Of course there are better ways to drive an IR LED with a transistor circuit or even a constant current circuit. However, in this post we consider only the direct drive circuit using a current limiting resistor, as illustrated in the diagram down below.
Make sure to read the caveats at the end of this post.

Continue reading Driving an Infrared Led directly from an Arduino Pin