I'm still fiddling with this, though I'm currently prototyping with a different MCU (I'll try again with a Digispark when I have more time for experimentation). The background here is that I'm building a TV mute control for my special-needs son, who has trouble with the small buttons on the regular television remote. I was able to make a working prototype with a pushbutton (using software debounce), and it correctly sends the "mute" command to our television.
The problem I have now is that the range is too short -- it only works if the device is within about 1m of the television. I'm going to need it to work at a distance of about 3-5m. After a little Googling, it seems that there are few different things you can change to increase the range:
- Use more power (higher current to drive the LED, and/or use more LEDs)
- Use lenses to focus the signal
- Get a better wavelength match
Since it *does* work, I feel like I can ignore the wavelength issue. I doubt it would affect the range a whole lot, anyways.
I'd rather not mess with lenses if I don't have to. I don't recall really seeing any in most commercial remotes?
So I'm looking at power. Obviously, I can't drive a lot of current from a microcontroller pin, so I figure I need to use a transistor, and let the LED pull current straight from my power source. Also, I might try ganging up three or four LEDs in parallel.
The infrared LED I'm using says that while the typical current draw is 20mA, it has a maximum tolerance of 100mA. Looking at an LED calculator for four LEDs in parallel, it's saying I just need about 6ohms for my current-limiting resistor with a 3V source (I'm hoping to use a couple of AAA batteries, with a boost to power the MCU -- and even with a 5V source, we're still only talking about 15ohms).
Since the IR signal is modulated at 38kHz and is of very short duration, I'm thinking that I could probably just omit the resistor entirely. Should that be safe enough? Alternately, I'm guessing that I can probably power them at even higher currents, but then I probably *would* need a resistor.
Thoughts?