to your IR transmitter.
The Transmitter Circuit
Figure 7 shows a schematic of the transmitter circuit.
A nine volt battery powers the Arduino MEGA. An
Arduino Duemilanove, Uno, or equivalent will work as
long as you don’t try to store too many codes. For the off
code example demonstrated in this article, the code
compiled to almost 38,000 bytes with 211 codes. The
Duemilanove has a maximum 30,720, so the MEGA was
used. Researching the Internet will reveal clever data
compression techniques, but the C code becomes
complicated. It is easier to stick with straightforward code
and either a larger processor or less remote control codes.
NPN transistor Q1 is used to boost the digital signal
from the Arduino MEGA and power the IR LEDs. A 15
pack of resistors from RadioShack was used as a source
and contains three different transistors: 2N3904,
MPS2222, and 2N4401. A little more Internet research
showed the 2N3904 had a lower collector current rating
of 200 mA. The 2N4401 has a rating of 600 mA which
yields more power. The 2N4401 is also rated for a peak
current of 800 mA which is more than ample for this
project. The MPS2222 should also work as the specs are
similar to the 4401.
Resistor R1 limits current from pin 7 of the Arduino to
a safe level. In early tests, a value of 560 ohms was used
to protect the Arduino, even with some kind of
malfunction in the transistor or mis-wire; 560 ohms was
chosen based on a maximum current at five volts divided
by 560 ohms is 9 mA which is well within maximum spec
of 40 mA. Follow-up testing on the circuit showed IR LED
output was a little low compared to a TV remote control
(use a digital camera to view the IR LEDs in action). Using
an oscilloscope, the voltage on the base of the transistor
never dropped below 1.9 volts. With an Arduino pin
voltage of five volts maximum, the max voltage driving
force is 5-1.9 = 3.1 volts. A 100 ohm resistor limits current
to 0.031 amps — within the Arduino spec of 40 mA — and
yields considerably more IR output.
Four IR LEDs were used in series to maximize IR
signal output and utilize the nine volts available from the
battery. Four LEDs in series yields a total voltage drop of
4. 8 volts based on the rated forward voltage of 1.2 volts.
The LEDs are rated at 100 mA continuous, but it is not
clear from the packaging or RadioShack website what the
peak current limit is. Looking at specs for other LEDs with
similar continuous current ratings showed peak currents in
the 1-2 amp range which is ample for this circuit.
Continuous current limits at 100 mA will limit peak
currents to 400 mA based on a duty cycle of
approximately 1/4. Code bursts are about 1/2 of the code
and each burst is modulated 50% for an overall duty cycle
of 1/4; 400 mA 1/4 duty cycle = 100 mA. This is
conservative as there is more off time than on time in
■ FIGURE 7. IR transmitter schematic.
Resistor R2 limits current to the IR LEDs. A five ohm
resistor was used from a spare parts bin, or two 10 ohm
resistors from the parts list could be used in parallel. The
maximum driving force is nine volts minus the voltage
drop across the LEDs. At 1.2 volts each, voltage out of the
LEDs and into the resistor is 4. 2 volts; 4. 2 volts / 5 ohms
yields a high calculated current of 840 mA. In practice, the
currents are smaller. The reason for this is that as current
through the LEDs increases past the rated continuous
current of 100 mA, the voltage drop increases beyond the
rated forward voltage of 1.2 volts. At a battery voltage of
eight volts, forward current was 320 mA and the voltage
drop across each LED was 1.6 volts. Voltage across R2 is 8
- 1.6* 4 = 1.6 volts. Current is calculated by 1.6 volts across
R2 / 5.0 ohms = 320 mA. At maximum voltage with a
fresh battery at nine volts, current was 426 mA which is
still within the capability of the LEDs, transistor, and a
good alkaline nine volt battery.
■ FIGURE 8. Arduino board, circuit, Plexiglas enclosure,
and pen transmitter package.
February 2011 33