Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

Share this Page URL

Chapter 6. Wireless Communication > Two Flavors of Wireless: Infrared and Radio - Pg. 179

WIRELESS COMMUNICATION 179 Two Flavors of Wireless: Infrared and Radio There are two common types of wireless communication in most people's lives: infrared light communication and radio communication. The main difference between them from a user's or developer's position is their directionality. Television remote controls typically use infrared (IR) com- munication. Unlike radio, it's dependent on the orientation between transmitter and receiver. There must be a clear line of sight between the two. Sometimes IR can work by bouncing the beam off another surface, but it's not as reliable. Ultimately, the receiver is an optical device, so it has to "see" the signal. Car door openers, mobile phones, garage door remote controls, and many other devices use radio. All of these work whether the transmitter and receiver are facing each other or not. They can even operate through walls, in some cases. In other words, their transmission is omnidirectional. Generally, IR is used for short-range line-of sight applications, and radio is used for everything else. are still considerably cheaper than their transceiver counterparts. The first two projects in this chapter use transmitter-receiver pairs. Keep in mind the distinction between transmitter-receiver pairs and transceivers when you plan your projects, and when you shop. Start by asking yourself whether the com- munication in your project has to be two-way, or whether it can be one-way only. If it's one-way, ask yourself what happens if the communication fails. Can the receiver operate without asking for clarification? Can the problem be solved by transmitting repeatedly until the message is received? If the answer is yes, then you might be able to use a transmitter-receiver pair and save some money. Transmitters, Receivers, and Transceivers There are three types of devices common to both IR and RF systems: transmitters, which send a signal, but can't receive one; receivers, which can receive a signal, but can't send one; and transceivers, which can do both. You may wonder why everything isn't a transceiver, as it's the most flexible device. The answer is that it's more complex and more expensive to make a transceiver than it is to make either of the other two. In a transceiver, you have to make sure the receiver is not receiving its transmitter's trans- mission, or they'll interfere with each other and not listen to any other device. When you buy a transceiver that does this for you, you pay for the convenience. For many appli- cations, it's cheaper to just use a transmitter-receiver pair, and handle any errors by just transmitting the message many times until the receiver gets the message. That's how TV remote controls work, for example. It makes the components much cheaper. It's increasingly common, especially in radio, to just make everything a transceiver, and incorporate a microcontroller to manage the transmitter-receiver juggling. All Bluetooth, ZigBee, and Wi-Fi radios work this way. However, it's still possible to get transmitter-receiver pair radios, and they How Infrared Works IR communication works by pulsing an IR LED at a set data rate and receiving the pulses using an IR photodi- ode. It's simply serial communication transmitted using infrared light. Since there are many everyday sources of IR light (the sun, incandescent light bulbs, any heat source), it's necessary to differentiate the IR data signal from other IR energy. To do this, the serial output is sent to an oscil- lator before it's sent to the output LED. The wave created by the oscillator, called a carrier wave, is a regular pulse that's modulated by the pulses of the data signal. The receiver picks up all IR light, but filters out anything that's not vibrating at the carrier frequency. Then it filters out the carrier frequency so that all that's left is the data signal. This method allows you to transmit data using infrared light without getting interference from other IR light sources, unless they happen to be oscillating at the same frequency as your carrier wave. The directional nature of infrared makes it more limited than radio, but cheaper than radio, and requires less power. As radios get cheaper, more power-efficient, and more robust, it's less common to see an IR port on a computer or PDA, but it's still both cost-effective and power-efficient for line-of-sight remote control applications.