Transmitting Data With A Pi And RTL-SDR

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.

31 thoughts on “Transmitting Data With A Pi And RTL-SDR

  1. 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.

    1. 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.

      1. 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!

  2. 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.

  3. 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.)

  4. 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

  5. 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).

  6. 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.

  7. 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.

    1. 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.

  8. “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.

  9. Stay away from 50 Mhz peeps….this is An AMATEUR RADIO BAND….
    We don’t need crud in the band….
    There are frequencies available for low power devices around 49 MHz and 27 MHz…
    Cheers though…

  10. I have a drone and want to upgrade it with a Raspberry with a few sensors and a camera. I want those datas transmitted in real -time by radiowaves since the drone is going to far for bluetooth or wifi
    the video will be in 1080p that means i need a strong connection that reaches at least 2km
    what should i do?

Leave a Reply to AlanCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.