some online destinations that offer an IR
receiver module suitable for use with the
ArdBot II under Sources. The infrared receiver
module looks a bit like a fat transistor. It has
three leads which can be directly inserted into
the Arduino’s I/O header pins as shown in
Figure 2. Be careful: Proper orientation is a
must. The module has a front side which is
denoted by a “dome” or lens. I’m showing the
module dome side up, with the leads bent at a
90 degree angle and inserted into pins 5, 6,
and 7 of the Arduino.
You want to avoid connecting the module
backwards as that might damage it. So, before
connecting — especially if you use another
module not indicated in the Sources box —
check that the pinout connections are as
Pin 1 Data output
Pin 2 Ground
Pin 3 Power
Pin 1 is the pin on the left when the dome
(lens) of the module is directly facing you as
shown in Figure 3.
With any receiver, you need a transmitter.
That job falls to your basic everyday universal
TV remote control. You can find these online as
well, though for my robot projects I prefer the
cheap units at the dollar and discount stores. As long as
the remote supports the most common Sony TV codes,
it’ll work. (I have yet to find any universal remote control
that wasn’t compatible with Sony TV codes.)
Ordinarily, it’s a tall job to decode the data
transmitted from a remote control and intercepted by the
IR receiver module. This task is made super simple,
however, with a third-party Arduino code library, IRRemote
— created by Arduino maven Ken Shirriff. This library does
not come with the Arduino software and must be
downloaded separately; see the Sources box for the URL.
To simplify matters for you, I’ve included it with the
download with the main Arduino sketch for this part.
To use the IRRemote library, you must move all its
contents to your sketchbook libraries folder. This is a
directory within the Arduino sketch folder, for example,
My Documents\Arduino\libraries. If there isn’t already a
folder called libraries, you need to create one.
After moving the IRRemote library to its proper
destination, you must restart your Arduino software. You
must do this step or your ArdBot II sketch will not compile.
The sketch will also not compile if the library is in the
wrong place. So, be sure to do these things or you’ll just
end up getting frustrated.
Post comments on this article and find any associated files and/or downloads at
SERVO 11.2013 57
FIGURE 3. Pinout
for the IR receiver
have the same
pinout, but always
Refer to Part 1 of this series for a full list of mechanical
parts for the ArdBot II.
The IR Remote library is available from the GitHub
repository. Be sure you are using the version for the
Arduino IDE 1.0 software.