Transmitting data with a Pi and RTL-SDR

radio

Sometimes the best builds aren’t anything new, but rather combining two well-developed hacks. [Marc] was familiar with RTL-SDR, the $30 USB TV tuner come software defined radio, but was surprised no one had yet combined this cheap radio dongle with the ability to transmit radio from a Raspberry Pi. [Marc] combined these two builds and came up with the cheapest portable radio modem for the Raspberry Pi.

Turning the Raspi into a transmitter isn’t really that hard; it only requires a 20cm wire inserted into a GPIO pin, then toggling this pin at about 100 MHz. This resulting signal can be picked up fifty meters away, and through walls, even.

[Marc] combined this radio transmitter with minimodem, a program that generates audio modem tones at the required baud rate. Data is encoded in this audio stream, sent over the air, and decoded again with an RTL-SDR dongle.

It’s nothing new, per se, but if you’re looking for a short-range, low-bandwidth wireless connection between a computer and a Raspberry Pi, this is most certainly the easiest and cheapest method.

Comments

  1. Mansour says:

    Interesting hack, especially the transmitter which I hadn’t seen before.

    However, easiest and cheapest? How about nRF24L01+? Sells for $3 a pair on eBay and can transmit and receive on both ends at up to 2Mbps rate.

  2. Ianmcmill says:

    How far could this be extended ? Maybe with some additional hardware ?
    And what limits this range ?

    • vpoko says:

      Tx power and the antenna mainly limit the range. With a linear amplifier and a good antenna, it could transmit reasonably far (limited by line-of-sight more than anything else). BUT, I wouldn’t hook one of these things up to an amp on a bet. First, it puts out square waves, which are inefficient and have a high potential for interference – a lot of the power ends up on odd harmonics instead of at the fundamental frequency. Hardware filtering could suppress the harmonics, but you still have an unstable oscillator because it’s running on an RPi with a non-real-time OS and your frequency will necessarily drift as the processor does other things.

      This is a cool hack, I’m not knocking it, but a quality long-range transmitter this most certainly isn’t. There are other, inexpensive ways, to transmit FM if that’s your goal.

      • Mojoe says:

        A linear amplifier is class a. If you’re transmitting FM then you can get away with a class c amp since all the information is in the frequency and not the amplitude. It’s much more efficient and easier to design. Even so, between the frequency instability of the GPIO pin and the unfiltered square waves, I bet that thing is making a mess of the whole broadcast band in his whole neighborhood!

  3. DainBramage1991 says:

    Interesting hack, but PLEASE, for the love our eyes and that’s holy, change the contrast on that waterfall display!!!

  4. qwerty says:

    Great hack. I thought it could not generate a 100 MHz carrier and all they were receiving was an harmonic of a lower frequency but apparently it’s possible to output such a high frequency. Just beware of the interferences you are generating though: this device outputs square waves which means a huge amount of unwanted signals. If you want a more powerful and clean transmitter, couple that pin with a RF transistor based amplifier and add the necessary filtering and impedance matching networks before the antenna. The ARRL Handbook will teach you how to.

  5. Mariusz says:

    Even through walls?? You don’t say

  6. Christopher says:

    Nice find. Wifi would likely be cheaper, faster and better for pi to pc. Heck, it’s plug-n-play.

  7. GammaRayBurster says:

    It is a wonderful hack, but please do not do it unless you are both aware of and in compliance with radio regulations. Building transmitters often requires some knowledge of RF engineering, which is necessary to avoid interfering with other radio services. (Keep in mind, the world is analogue. This often creates unintended consequences.) In some cases you will require a license to create transmitters, but this can be done through your country’s amateur radio service.

    I am saying this as encouragement to do things properly, rather than discouraging people from doing it at all. There is a lot of good material out there, both electronically and in print. You can develop amazing projects if you utilize it. (Just ignore some of the naysayers, because they’re interested in protecting their own turf.) By following the regulations we can ensure that such projects remain legal for the decades to come.

    (Note: the ARRL is a good starting point, even if you aren’t an American.)

  8. NewCommentor1283 says:

    if all you need is 300 BITS per second you could use an analog cordless phone and two uControllers at each end programmed as modems. top that off with a protocol of any type and you got radiomodem.

    unfortunately i dont believe 9600 is possible through a cordless phone.
    i believe the audio bandwidth is less then 5000 … maybe 2000

    as for the square waves in this project, i think with appropriate analog output filters and shielding from actual chip to the shielded box with the filter and THEN the 20cm antenna this design could work wonders with speed. modulation speed. 50 simultaneous synthisized parallel …….. mmmm bandwidth

  9. aamonster says:

    Please, NEVER do such a hack. It’s a great way to create bloody mess in radio.

  10. Alan says:

    You don’t HAVE to use 100MHz. The actual limit is – the lowest range the RTL-SDR will pick up. If that’s [for example] 50MHz, you can lower your transmit frequency.
    Bonus points for not blatting out in airspace supposedly reserved for commercial radio. Considering the range quoted with a 20cm antenna, that makes for happy neighbors.
    I’d still suggest some filtng, but at least a square wave dominates odd harmonics – so using 50MHz should leave 100 MHz fairly clear, while blatting around 150 MHz (amateur radio, some weather satellites).

  11. d says:

    I experimented with this and successfully transmitted SSTV images over 2m ham frequencies. Add a low pass filter! There are VERY strong harmonics on the odd harmonics, ie, your frequency x3, x5, x7…).
    Looks like I didn’t look hard enough for a program like minimodem, I want something simple to be able to create APRS packets.
    I had to change the C transmit program to reduce the bandwidth (to maybe 3kHz?) and remove pre-emphasis.

  12. Me says:

    This kind of hack is fun to read about and I am in no way knocking what Brian Benchoff did. However…

    “if you’re looking for a short-range, low-bandwidth wireless connection between a computer and a Raspberry Pi, this is most certainly the easiest and cheapest method.”

    No way! http://goo.gl/snDcH9 You can get low-bandwidth transciever modules for about $5! And… you don’t even have to chew up all your CPU power doing SDR.

    • Squirrel says:

      Agreed! The RTL dongles use too much power, and the SDR uses too much of the processor, and yet even more power. It’s not a good idea for a battery powered project…

      The RF little modules are definitely the way to go if you’re trying to build a reliable low power data network! They have the FIFO, modem and integrity checking right on the chip. I made an in house pager with those that keeps me alerted of email, etc.

    • AsGablaw says:

      The hack is the frequency can be between 1-250 MHz.

  13. “i dont believe 9600 is possible through a cordless phone.”

    I did 16.8 kbps under poor signal conditions, up to 28.8 kbps with a clean signal. The speed usually fluctuated between those speeds. With a clean signal it would start out at 33.6 kbps but wouldn’t hold, the modems would re-train to 28.8 kbps or lower.

    For filtering the 100.MHz square wave you could use a simple 3-pin monolithic FM bandpass filter – most FM radios have these. I use these between my RF gain stages for my xmters.

  14. Implement dstar

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 96,700 other followers