You are on page 1of 9

Ministry Of Higher Education And

Scientific Research
Department of technical education
Technical college /Mousaib
Electrical power technical engineering
Fourth stage
By
Infrared Communication
nfrared (R) is a type of light that is not visible to the human eye
What is IR?
How can you use IR to communicate?
!ut very simply, a transmitter produces rapid pulses of R light in specific
patterns, which a receiver can interpret .You most likely use R for
communication on a daily basis:
that's how television remotes work!
The R port on the RCX is the shiny black bit above the numbered input ports.
!rimarily, you use this port to download new programs to the RCX (through the
R tower that plugs into your computer).
However, the port can also 803/ messages out.
The RCX sends R messages in "packets."
Each packet consists of a specific "header" followed by the "payload" or actual
data.
The packet ends with a checksum, which is a method of verifying that the data
was read correctly. The header is there so that the RCX knows where the
packet starts. When you send a message from one RCX to another, the payload
is two bytes long: the first just indicates that the second byte is a message (as
opposed to code to download, for example -- the same packet form is used by
the R tower!). So when you want to send messages between two RCX bricks,
) f you are interested in What is a byte? you can only send one byte at a time. (
Mind storms specifics pertaining to the RCX, check out Stef Mientki's page on
. communication - R
How does the RCX use IR?
R is a fairly cheap and easy way for two things to communicate. However, it does have
a number of problems, including:
The sun! The sun gives off a lot of infrared light. n direct sunlight, the R receiver can be
"flooded" and won't be able to see any incoming messages. To work around this, always
use your Mindstorms indoors and out of direct sunlight.
Line-of-sight. You may know from experience that you need to point a TV remote control
directly at the TV for it to work. f you point the remote in some other direction, or if you
put your hand between the remote and the TV, chances are the remote will stop working.
Similarly, if you want to have two RCX bricks talk to each other, they need to be pointed
roughly at each other. n my experience, 've found that, as long as both robots are in the
same room and nothing is in between them, they are still able to communicate, so this
isn't as big a problem as it might seem.
What are some probIems with IR communication?
W . Timing problems
W One-byte payloads. As mentioned above, the RCX
firmware (the underlying program that interprets the
message packets and runs the code you write) only
allows for messages that are one byte long. As a
consequence, sending complex messages becomes
challenging (and time-consuming).
R
TR
CVOLT
V
C
C

D
Q
DS
THR
VCC
C2
D
R2
R1
R3
D1
LED
D D
D
1
MOD
4
2
5
3
7
6
C1
R Transmitter
$tepper Motors $tepper Motors
stepper motors consist of a permanent magnet rotating
shaft, caIIed the rotor, and eIectromagnets on the
stationary portion that surrounds the motor, caIIed
the stator .
iIIustrates one compIete rotation of a stepper motor. At
position 1, we can see that the rotor is beginning at
the upper eIectromagnet, which is currentIy active
(has voItage appIied to it).
To move the rotor cIockwise (CW), the upper
eIectromagnet is deactivated and the right
eIectromagnet is activated, causing the rotor to
move 90 degrees CW, aIigning itseIf with the active
magnet.
This process is repeated in the same manner at the
south and west eIectromagnets untiI we once again
reach the starting position .

You might also like