Topic:-1
INFRARED COMMUNICATION

What is IR?
Infrared (IR) is a type of light that is not visible to the human eye. The following are both good introductions to IR:


How can you use IR to communicate?
Put very simply, a transmitter produces rapid pulses of IR light in specific patterns, which a receiver can interpret. You most likely use IR for communication on a daily basis: that's how television remotes work!

How does the RCX use IR?
The IR port on the RCX is the shiny black bit above the numbered input ports. Primarily, you use this port to download new programs to the RCX (through the IR tower that plugs into your computer). However, the port can also send messages out.

The RCX sends IR 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 IR tower!). So when you want to send messages between two RCX bricks, you can only send one byte at a time. (What is a byte?) If you are interested in specifics pertaining to the RCX, check out Stef Mientki's page on Mindstorms IR-communication.

What are some problems with IR communication?
IR 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. In direct sunlight, the IR 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. If 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. In my experience, I'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.
Timing problems.
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).
Please do leave your valuable comments here

Comments

Popular Posts