A Software-Defined Radio on a Shoestring

21,053

181

16

Introduction: A Software-Defined Radio on a Shoestring

In the beginning was the crystal set - the first practical broadcast radio receiver. But it needed a long aerial and could only receive local stations. When valves came along (tubes, for our American friends) they made it possible to build much more sensitive radios, and ones which could also drive a loudspeaker. Early radios still had relatively poor selectivity (i.e. the ability to discriminate stations close together on the tuning dial).

A game-changer was introduced in the 1930's in a radicaly new design known as the superhet. It typically needed 4 or 5 valves but gave much improved sensitivity and selectivity. In fact it has remained the dominant design ever since.

You can learn more about all of these in How Radios Work in the Restart Wiki.

With the explosion of digital communications the superhet design is still the dominant method of tuning and amplifying the radio signal. But in many cases the signal is no longer just fed to a loudspeaker. It might be a mobile phone signal, or GPS, or DAB radio or a data feed from a space probe, or WiFi or Bluetooth, or a signal to remotely open your garage door. Or any of an almost endless list.

So now you need a satnav to receive GPS signals, a DAB radio for digital broadcasts, a smartphone for mobile voice and data, a WiFi-enabled computer for WiFi, a garage door to respond to your fob and ... well, the list goes on.

There must be a better way?

Fanfare of trumplets please! Enter Stage Left the Software Defined Radio (or SDR to its friends).

A computer can do anything, provided you can break it down into logical steps. You're looking at one now! So why not program it to interpret a radio signal? With a different program you can receive whatever you like, including old fashioned AM and FM broadcasts.

Sounds complicated and expensive? Not at all - you can do it for pocket money! Read on.

Step 1: What You Need

First of all you will need a USB DVB-T TV adapter. It must be one using the R820 and RTL2832 chips.

If you simply search eBay for "R820 RTL2832" you will find plenty under £10, or well under £10 if you can wait a few weeks for delivery from the Far East.

Broadly, there are two types. There are some with an old fashioned co-ax TV socket on the end, and others with a more modern SMA or MCX screw-type connector. Some of the latter come with their own aerial. It doesn't matter which you choose, but the cheapest is likely to be one with a TV socket and to use a DIY aerial.

Whist any of the above should work fine, if you're happy to pay rather more you can get one here which is guaranteed to give the best possible performance.

You will also need a computer, preferably Windows or Linux. If you're a Mac user then you might consider finding an old computer and installing Linux on it, though there is limited SDR software for OSX.

For a DIY aerial you will need an old co-ax TV aerial lead, or if you have a soldering iron you can use a coax TV plug and a scrap piece of wire.

You may also find a USB extension lead useful, in order to position the dongle and its aerial away from the computer.

Step 2: An Aerial From a Co-ax TV Lead

The length of the aerial isn't critical unless you want the ultimate sensiivity in a particular band, but you're not likely to get that with a simple DIY aerial.

Take your co-ax aerial lead and cut one end off with 15 - 30cm of lead.

Now cut the outer insulation around its circumference with a craft knife. Cut from there to the end along its length in order to remove the insulation.

Loosen or cut the outer braid so that you can pull out th inner conductor with its insulation.

Now just snip off the outer braid, and you have your aerial.

Step 3: An Aerial From a Piece of Stiff Wire

If you have a soldering iron and a spare co-ax plug you can use these to make an aerial. I used a piece of roughly 16 guage enamelled copper wire with a short length of heat-shrink sleaving to prevent the cable grip cutting through the enamel.

Step 4: Windows Installation

The best software to start with is SDR# (pronounced SDR Sharp), which runs on Windows 7, 8 and 10. There's a Quick Start Guide which gives full instructions so here I'll just give a summary. Refer to the Quick Start Guide if anything isn't clear or doesn't seem to work as expected.

First, you will need to ensure you have Microsoft .NET 4.6 or newer redistributable installed. You may also need the Visual C++ Runtime if not already installed.

Now browse to www.airspy.com and select Download in the top menu, then click the Download button against Windows SDR Software Package.

This will download a zip file, not an installer (.MSI) file. I like to put such programs in c:\Programs rather than c:\Program Files, so create c:\Programs, and under it, a folder SDR#. Expand the downloaded zip file into it.

In the folder of extracted files, double-click on install-rtlsdr.bat. This will run a command prompt whch will download additional drivers.

Now plug in your dongle and wait for Windows to attempt to configure it. This may take a couple of minutes. Wait until it's no longer showing as "In Progreass" in Devices and Printers. It will either fail to configure it, or install the Windows DVB-T TV drivers.

Again in the folder of extracted files, locate zadig.exe, right-click on it and select Run as Administrator.

Under the Options drop-down meny, make sure List All Devices is checked. Then, in the drop-down list select Bulk-In, Interface (0). Against USB ID it should now show 0BDA 2838, which is the id of your DVB-T adapter.

Against Driver, it may say None or RTL2832UUSB. In the box to the right select WinUSB. Click the Install or Reinstall Driver below. (In the screen shot I'd previously done it so the left hand box already showed WinUSB as the currently installed driver.)

If you get a warning that Windows can't verify the publisher of the driver, click Install Anyway.

Wait for confirmation pop-up indicating successful installation.

Finally, form the folder of extracted files, find SDRSharp.exe, and whilst holding both the Ctrl and Shft keys, drag and drop it onto the desktop. This will create a convenient launch icon.

.

Step 5: Running SDR#

Double-click the SDRSharp.exe shortcut icon on the desktop. The AIRSPY logo will appear overlaid on your desktop and after a few seconds the SDR# window will appear.

In the left hand pane at the very top, click on Source, and from the drop-down list select RTL-SDR (USB).

Now click the Start icon at the top. SDR# should now be running, showing the spectrum of what it's receiving. In this screen shot of part of the FM broadcast band you can see two strong stations. (You can easily listen to AM and FM broadcasts. See later.) Below it is what's called the "waterfall display", showing how the spectrum above evolves with time. The station on the left is music and you can see that the one on the right is speech with silences in it. The two continuous vertical red lines you can see running through it if you look carefully are the ultrasonic carrier which is modulated with the stereo information. A morse code signal would actually show the dots and dashes.

You will get better results if you use a USB extension lead to position the dongle away from your computer, otherwise you will get many spurious signals generated by the digital circuits in your computer.

The SDR# interface isn't completely intuitive, so read on for guidance.

Step 6: Tuning and Controls

Tuning:

The screenshot above shows a DAB radio broadcast, specifically the BBC National DAB ensemble (Block 12B). As you can see, there is 1.5MHz of bandwidth packed with many different programs into a single "ensemble".

The method of tuning takes just a little getting used to. First, make sure you have the Centre Tuning icon (two triangles pointing to each other) displayed to the right of the large font frequency display at the top of the window, as in the screen shot. If not, click it until you do. Hovering over it should show the hint "Centre tuning".

The frequency display consistes of 4 groups of digits, representing GHz, MHz, KHz and Hz. In the screen shot it's

000 225 601 019

This represents 225.601019MHz.

You can change the frequency by hovering over any of the digits and using the scroll wheel on your mouse, or you can click the top or bottom halves of a digit to increment or decrement it. You can also click and drag the display to the left or right if you want to scan through a band to see what's there.

Slider controls:

On the right hand side you have 4 vertical slider controls:

Zoo zooms the display in onto a narrower band of frequencies.

Contrast controls how thecolours in the waterfall display (from deep blue to deep red) represent signal strength, from weak to strong.

Range adjusts the range of signal strengths displayed and Offset moves that range up or down.

Step 7: Listening to Radio Stations

There are plugins allowing SDR# to decode various different types of broadcast but it can play AM and FM radio broadcasts out of the box.

In the left hand panel, open up the Radio group. You can select one of 8 different types of broadcast to decode. The most useful are AM for normal AM broadcasts, and WFM for broadcast (wide-band) FM broadcasts.

(You can find out about the difference btween AM and FM in the Restart Wiki in the How Radios Work page.)

Select which you want and tune to a radio station. The sound should come out of your computer's speakers.

The others types are used by ham radio and services such as air-band.

Whereas with normal AM it's very easy to extract the audio even with something as simple as a crystal set, it's wasteful in both transmitter power and bandwidth. In power, because there is a carrier frequency always being transmitted even during silences in the broadcast. So why not just suppress the carrier? And in bandwidth because the audio is spread out symetrically either side of the carrier frequency in two "sidebands". So why not suppress one sideband? Doing both, all the transmitter power is going into transmitting information (the audio signal) as efficiently as possible, and so the broadcast will travel further.

SDR# supports all variants of these. DSB is Double Sideband, where just the carrier is suppressed. LSB and USB are Lower and Upper Sideband, where the upper or lower sideband (respectively) is also suppressed. None of these are used for normal broadcasts as a more complicated receiver is required and accurate tuning is required to avoid serious distortion as the receiver has to reinsert the carrier at the precise frequency.

CW is Continuous Wave is used for Morse code. The transmitter is simply switched on and off and SDR# will produce the dots and dashes as short and long tones.

NFM is narrow-band FM. For services where high quality is not required so long as intelligible speech can be transmitted, FM can be broadcast using much less bandwidth. This allows many more channels to be packed into a given range of frequencies.

Step 8: Detecting 433MHz Gadgets

433MHz is used for short range communication by a host of low power devices including car key fobs, wireless headphones, wireless door bells, home automation and security products and home weather stations. It's very easy to pick these up and display them using rtl_433.

Using your favourite search engine, search for windows rtl_433, or browse to this link:

https://cognito.me.uk/computing/windows/2015/05/26...

Under the Download heading click on the link to download the 32 or 64 bit version, according to the bittiness of your computer. You should now have a zip file in your Downloads folder (or wherever you chose to save it).

Again, I like to keep programs that don't require installing in c:\Programs, but that's optional. Create a new folder rtl_433 in c:\Programs (or wherever else you choose). Double-click the zip file and copy and copy the contents to this new folder.

Launch a command prompt. The quickest way to do this is to press the Windows key and R, then type cmd in the box, and click OK or press Enter.

At the command prompt, type cd c:\Programs\rtl_433

(If you chose to expand the zip file elsewhere you will need to modify the path to the folder accordingly.)

Type rtl_433 and press Enter.

Now just wait. Depending on your neighbourhood you may have to wait a while, but you should see devices popping up. Leave it running all day to see what you get. The screen grab is a few of the records I got on a first attempt.

By default it will only report signals it recognises, albeit from quite a wide range of devices though by no means all. If it doesn't detect your doorbell or some other gadget you suspect uses 433MHz, try adding -a or -A (after a space) to the rtl_433 command to get raw output.

Step 9: Going Further

Here, we've only scratched the surface of SDR but hopefully I've whetted your appetite. Here are one or two leads to take you further.

Instead of a Windows computer you can use one running Linux.

DragonOS LTS is Lubuntu Linux with a host of SDR applications pre-installed. Download the .iso file and use Rufus to create a bootable memory stick from it. You can run it on any PC, booted directly from the memory stick, or if you have a spare hard disk you can use the desktop link to install it permanently. For each of the tools listed on the DragonOS web page you'll need to find its web page and see what it does.

The screenshot shows CubicSDR running under DragonOS. This is similar to SDR#.

Alternatively you can use a Raspberry Pi, even one of the original ones or the very cheap Pi Zero, though a later more powerful model will run better. Many SDR tools can be installed very easily using the Synaptic package manager.

An easy one is is rtl_fm. This comes in the package rtl-sdr which you can install this with Synaptic. Open a Terminal session and run it with the command such as:

rtl_fm -f 91300k -M wbfm|aplay -r 32768 -f S16_LE -t raw -c 1

This will receive and play an FM radio station. (91300k represents 91,300KHz or 91.3MHz - change it to the frequency of the station you want.) You can also use it to monitor a VHF or UHF radio microphone if you know its frequency, or can find it with SDR#.

Be the First to Share

    Recommendations

    • Colors of the Rainbow Contest

      Colors of the Rainbow Contest
    • Make it Real Student Design Challenge #3

      Make it Real Student Design Challenge #3
    • Arduino Contest

      Arduino Contest

    16 Comments

    0
    Toter
    Toter

    1 year ago

    I want to read RF from accessories like keyboard and mice. I'll show you my ir when I'm done. BTW I couldn't get the drivers to work yet for my pci Tuner... You'll probably think this is funny, but... I lost my antennae.

    0
    Toter
    Toter

    Reply 1 year ago

    BTW did you have any scripts or software I might be able to utilize? I use windows and Linux.

    0
    Toter
    Toter

    1 year ago

    The DVB-T tuner already receives radio... it's printed right on the plastic chassis. You made the antenna bigger?... It does what it did before....? I would have put a coax-to-composite converter on it, and plugged in a Nintendo, or a security camera... or a Nintendo.

    3
    dialup_prisoner
    dialup_prisoner

    Reply 1 year ago

    Did you miss the part where it can also pick up garage door remotes, tyre pressure sensors, wireless microphones.... and, as you say, wireless secuirty cameras.

    This will receive pretty much anything with a radio transmitter in its frequency range. Sure, if you just want to listen to music, there are easier ways and SDR may not be for you. But the whole point of this instructable is to use a cheap piece of hardware above and beyond "what it says on the plastic chassis."

    0
    Toter
    Toter

    Reply 1 year ago

    I did miss that. I understand the concept. Listen to signals from rf devices like wireless keyboards, remotes, walkie talkies, garage door openers. What I don't understand is why you changed the antenna. The original probably sucked couldn't blame you for that. My point is wouldn't you be able to do the same things without changing the device? BTW could you capture keyboard RF signals? I've got tons of gadgets like that I'd love to utilize, for example anything with a dongle that was lost. I'm currently working on an old TV Tuner. I'm also fiddling with IR too. You can put those receivers and transmitters on anything. I didn't mean to be terribly condescending. You should see what you can do with that and a raspberry pi. I put an ir receiver on mine and utilized an old remote for Kodi.

    1
    p_leriche
    p_leriche

    Reply 1 year ago

    If course, if you go for a device that comes with an antenna, then certainly use that! But on a shoestring budget, the cheapest ones come without.

    0
    FabrizioB4
    FabrizioB4

    1 year ago

    Nice and very interesting project. Just a question: how do you calculate the aerial length to receive the correct EM wave? It should be different according to what you want to receive, I guess..

    1
    p_leriche
    p_leriche

    Reply 1 year ago

    Agreed, a receiver is only as good as the aerial you connect to it, but if it's only a shoestring radio then the best aerial in the world isn't going to turn it into anything to get excited about. The point of this Instructable was simply to introduce the concept and some of its possibilities at low cost and by exploring reasonably strong signals.

    To get you started over a wide range of frequencies then a simple aerial like I show is fine, but if you have a particular fewquency band in mind then make it a quarter wavelength if you reasonable can. Use one of @mcshrade's calculators or simply divide 300 by the frequency in MHz to get the wavelength in metres. Placing it high up or away from obstacles will probably make more difference than getting the length right.

    0
    joreli48
    joreli48

    1 year ago

    Gracias por su información, preguntarle porque después de rato de funcionar el sdr, al intentar apagar el cp. Se bloquea ,teniendo que reiniciar el cp, gracias

    0
    sail4sea
    sail4sea

    1 year ago

    How do you transmit, provided that you are licensed to do so? Or is SDR a receive only protocol?

    KE0UNF

    0
    p_leriche
    p_leriche

    Reply 1 year ago

    SDR isn't a protocol but a design methodology which you can apply to a transmitter just as well as to a receiver. Given a sufficiently powerful processor, software can (in principle) create any waveform you like. You then only have to feed it into a power amplifier and hence to a transmitting aerial. But obviously, a DVB-T tuner is incapable of transmitting.

    0
    Granzeier
    Granzeier

    1 year ago

    Thanks for this - I have been wanting to get into SDR for a while now, and you have given me the motivation to get started. I ordered an SDR receiver, but it will take a while (as late as 22 Jul) to get it.
    Well, I have a lot of other things to do until it gets here. ;-)
    Thanks again.

    0
    mcshrade
    mcshrade

    Reply 1 year ago

    1. Always remember: a receiver is only as good as the antenna it is connected to!

    The first antenna I connected it to was a broadband scanner antenna and it worked great!
    Yes the antenna cost 3 times more than the RTL-SDR it was connected to, but see point 1 above...
    If you want to get into more and/or better sdrs look at the top of the line offerings.
    AirSpy line, Funcube Pro+, SDRplay line of sdrs. These are in the $125 - $250 range and they offer so much more. Hope this helps anyone.