I am using an infrared LED in a circuit and it seems like it is drawing around 15 mA at 5 V.
That is unlikely unless it has a built-in resistor.
Figure 1. The I versus V curves for a range of typical LEDs shows that the forward voltage of an IR LED is about 1.25 V at 20 mA. Source: LED IV curves.*
Note that if you were to apply even 2 V to the IR LED that the current would exceed 100 mA and it might not last long. At 5 V a bare IR LED would almost certain die instantaneously.
I was told today that I am running a chance of burning it since infra red LEDs require 1 to 2 volts as well as I should consider adding a resistor to protect it from higher currents.
A better explanation would be that you need to limit the current through the LED to a safe value. A resistor is the simplest way of doing this.
I got confused because my understanding of current is that the consumer draws as much as it needs ...
Yes, but the graph is showing us that at 5 V it "needs" a very high current.
... and the only requirement for the power source regarding current is that it must supply at least that.
That's correct (subject to my previous comment).
For example if my power source is a 5 V 1Ah battery the current flowing would still be 15 mA regardless of the higher capability of the battery.
Only if there is a current limiter in the circuit. Again, a resistor would be the normal solution.
I got further more confused by the second part. I thought resistors affect the EMF, not current, ...
The resistor will both limit the current and create a voltage drop.
How can I calculate what resistance I need in order to limit current to 15 mA?
There are many, many sites on the Internet that explain this. The load-line tool below may be of interest.
Figure 2. A loadline graphic calculator for various LEDs on a 5 V supply. Source: Loadline resistance graphic tool.
To use the tool:
- Select your LED colour: IR in your case.
- Select the current you want: 15 mA in your case.
- On the If axis move up to the 15 mA line and move across to the IR curve.
- Select the nearest loadline curve: 270 Ω.
A 270 Ω resistor will limit the current through your IR LED to about 15 mA on a 5 V supply. There will be 1.25 V across your LED and about 3.75 V across your 270 Ω resistor.