How the Sprite Radio Works
I spent most of this week working with one of the trickier parts of the Sprite - the radio. This is also one of the things I get asked the most questions about, so I thought I'd take some time to explain how it works (or at least make an attempt).
The Sprite has a UHF (437 MHz) transceiver capable of transmitting at a maximum power of 10 dBm (10 milliwatts for those who don't like decibels). That's not a lot of power when you're trying to receive a signal from 500 kilometers away, but it's not as bad as you might think at first. For a rough comparison, GPS signals are broadcast with about 50 Watts of power from about 20,200 kilometers away. Ignoring variations in antennas and other smaller effects and just taking into account free-space loss, a GPS signal received on the ground will have a power of about -135 dBm (that's 28 femtowatts), while the Sprite signal will have around -129 dBm (120 femtowatts) of power. The Sprite signal is actually four times more powerful than a GPS signal when received from Earth!
The problem with receiving a weak signal is not so much that it's weak - we can always run the signal through an amplifier - it's that signals are always awash in a constant background of noise. When we run a signal through an amplifier in real life, the noise comes along for the ride and also gets amplified. The result is that we're stuck with the same ratio of signal to noise after the amplifier as we had before. Noise makes it hard for a receiver to tell if a given bit is a zero or a one and we end up with lots of errors in our received signal.
So, how do we get around this problem? We're borrowing some signal processing tricks used by GPS and cell phones. The most important is something called forward error correction (FEC). The basic idea is to take a message that you want to transmit, then strategically pad the message with extra bits before transmitting it. In an FEC scheme, the padding bits depend on the original message bits according to a set of mathematical rules. When the signal is received it will be full of errors due to noise, but by using the same set of mathematical rules, the receiver can find and correct (most of) the errors.
The whole FEC process can be abstracted away and thought of in terms of "signal processing gain" in the same way we think about antenna gain or amplifier gain. In other words, we get an effective signal boost by using FEC as if we were using a more powerful transmitter or a bigger antenna. You never get something for nothing, though, and there is a catch. Remember that we had to add those extra padding bits to our message, so for a given transmitter bit rate, our effective data rate after the padding is lower. We've traded a slower data rate for some extra gain.
Phew... I hope I didn't lose everyone by being too long-winded or technical there...
One of the things I've been working on this week that prompted this post is a library for Energia to simplify working with the radio. The goal is that developers won't have to worry about all of the stuff I just talked about. All you'll have to do is call a transmit function and pass in your message. Everything else will be taken care of behind the scenes. Here's a simple example of what the Energia code looks like right now:
Thanks for bearing with me - that's all for this week. As always, don't hesitate to get in touch and be sure to check back next Friday!