7

What i saw is that the led use 1.3V on 100mA with a 1:10 Cycle (100ms). Im currently at 30mA using only a 100 resistor, but the range of the led is 20cm at max, i want to get at least 2 meters.

Since i know the max output of the Arduino pin is 40mA i need to use a transistor to get the 100 i want. And that is the problem, i read a lot about how transistors works but i can't yet understand how can i achieve 100mA using a transistor.

I did the math using 5v and got 37R.

Is this correct? So i need to use a 37 ohms resistor to get the 100mA i want?

And this resistor is going between the digital input and the transistor base, correct?

Im using a NPN 2n2222 and reading the datasheet 100mA is easy job for this transistor.

I appreciate any help.

Luke
  • 73
  • 1
  • 1
  • 4

2 Answers2

4

Here is a diagram from Peter Bennett's answer to an Electronics Stackexchange question, How much voltage to give my IR LED?:

transistor driver

As you can see, the current-limiting resistor is in series with the IR LED and the transistor's collector. The base resistor is large relative to the current limiting resistor, because this transistor amplifies base current by a factor like 100.

The 1000 Ω base resistor is ok for loads into the neighborhood of 100 mA; if you plan to drive a larger load, use a smaller base resistor. As noted in the 2N3904 datasheet, hFE may be as small as 30 when IC = 100 mA. To ensure transistor saturation, arrange that hFE*(VCC-VBE)/RB exceeds desired collector current.

2N2222 specifications are similar to those of the 2N3904 mentioned in the question, but hFE drops off more slowly (as IC increases) for the 2N2222.

See the Electronics Stackexchange question linked above for more discussion and further links.

James Waldby - jwpat7
  • 8,920
  • 3
  • 21
  • 33
4

Increasing the power to the LED isn't the best way of increasing the distance. In fact it's the worst way.

The 100mA is only for a small duty cycle. You can power it with 100mA but only for a fraction of the time. The overall average light output won't be any more than at 30mA.

The problem you are actually suffering from is the fact that your receiver can't distinguish the LED's light from the background light. That is simple to overcome though. You just need to modulate your LED with a high frequency (typically 30kHz or higher) and perform a high pass filter and amplification on the receiver.

Exactly the same way that remote controls do it.

That way you can distinguish the LED (flashing at a given frequency) from the background light (static brightness or relatively very slowly changing).

Majenko
  • 105,851
  • 5
  • 82
  • 139