Scott Hanselman

Software Defined Radio is a great way to bridge the physical and the digital and teach STEM

April 26, 2019 Comment on this post [7] Posted in Hardware | Open Source
Sponsored By

Software Defined Radio AdapterOne of the magical technologies that makes an Open Source Artificial Pancreas possible is "Software-defined Radio" or SDR. I have found that SDR is one of those technologies that you've either heard of and agree it's amazing or you've literally never heard of it. Well, buckle up, friends

There's an amazing write up by Pete Schwamb, one of the core members of the community who works on Loop full time now, on how Software Defined Radios have allowed the community to "sniff" the communication protocols of insulin pumps in the RF spectrum and reverse engineer the communications for the Medtronic and now Omnipod Eros Insulin Pumps. It's a fascinating read that really illustrates how you just need the right people and a good cause and you can do anything.

In his post, Pete explains how he configured the SDR attached to his computer to listen into the 433MHz range and capture the RF (radio frequencies) coming to and from an insulin pump. He shows how the shifts between a slightly higher and slightly lower frequency is used to express 1s and 0s, just like a high voltage is a 1 and a low or no voltage is a 0.

Radio Frequency to 1s and 0s

Then he gets a whole "packet," plucks it out of the thin air, and then manipulates it from Python. Insert Major Motion Picture Programmer Montage and a open source pancreas pops out the other side.

1s and 0s from RF into a string in Python

Lemme tell you, Dear Reader, Hello World is nice, but pulling binary data out of electromagnetic radiation with wavelengths in the electromagnetic spectrum longer than infrared light is THE HOTNESS.

From a STEM perspective, SDR is more fun than Console Apps when educating kids about the world and it's a great way to make the abstract REAL while teaching programming and science.

You can get a SDR kit for as little as US$20 as a USB device. They are so simple and small it's hard to believe they work at all.

Just plug it in and download Airspy (Formerly SDRSharp, there are many choices in the SDR space). and run the install-rtlsdr.bat to setup a few drivers.

You'll want to run zadig.exe and change the default driver for listening to radio (FM, TV) over to something more low-level. Run it, select "List All Interfaces," and select "Bulk Interface 0"

Updating SDR wtih Zadig

After you hit Replace Driver with WinUSB, you can close this and run SDRSharp.exe.

I've set my SDRSharp to WFM (FM Radio) and turned the Gain up and OMG it's the radio.

Listening to the Radio with SDR

In this pic I'm listening to 91.5 FM in Portland, Oregon which is National Public Radio. The news is the center red line moving down, while the far right is 92.3, a rock station, and 90.7 on the far left is more jazz. You can almost see it!

AdaFruit has as great SDR tutorial and I'll use it to find the local station for National Weather Radio. This is the weather alert that is available anywhere here in America. Mine was Narrow Band (WFM) at 162.550 FM! It was harder to hear but it was there when I turned up the gain.

The weather report

But wait, it's more than radio, it's the whole spectrum!

Here I am sending a "Get Pump Model" command to my insulin pump in the 900Mhz range! The meaty part is in the red.

Talking to an Insulin Pump

Here's the heartbeat and requests that are sent to my Insulin Pump from my Loop app through a RileyLink (BT to RF Bridge). I'm seeing the Looping communications of my Open Source Artificial Pancreas here, live.

Watching RF Pump Communications

Next post or two I'll try to get the raw bits off of the RF signal of something interesting. If you haven't messed with SDR you should really give it a try! As I said before you can get a SDR kit for as little as US$20 as a USB device.


Sponsor: Suffering from a lack of clarity around software bugs? Give your customers the experience they deserve and expect with error monitoring from Raygun.com. Installs in minutes, try it today!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Hosting By
Hosted in an Azure App Service
April 26, 2019 10:12
Good article, Scott. There's a FB group around the these RTL SDRs, in addition to a nice website, and a good cheap book. https://www.rtl-sdr.com/. These devices have a lower cut-off near the CB band (say 27MHz), so listening to radio below that can be problematic. One can get up-converters, or a version 3 device in order to receive medium-wave and shortwave transmissions.
April 26, 2019 11:45
Excellent stuff - I used to have one of the radio antennae, a long time ago, so must try to dig it out.
We already have Heart FM (106.2) here in the London area, so it's only right that we should be looking for Pancreas FM too ;)
April 26, 2019 18:20
Does this means someone can stand outside my house and be able to pick up my data as well?
April 26, 2019 20:51
After sniffing the protocol of a 433Mhz device with an SDR USB dongle and decoding it's byte stream (audacity can be very helpful), next project: get a little 433Mhz transmitter / receiver pair (for pennies) and build yourself a little circuit based around an ESP8266 WiFi chip. Following that write some firmware code that runs on the ESP8266 that reads and writes to the 433Mhz transmitter / receiver pair via it's digital I/O and voila, you've created a tiny intelligent WiFi <-> 433Mhz bridge widget. You can even run a tiny web server directly on the ESP8266 chip enabling access to this widget from anywhere.

There are lots of things that talk 433Mhz i.e. door bells, combi-boilers, some power sockets..this really is great stuff to play with.
Joe
April 28, 2019 13:14
that's fantastic !

Does this means someone can stand outside my house and be able to pick up my data ?
April 28, 2019 15:33
There is an excellent introductory MOOC about SDR here (it's a spanish site but the MOOC is in english).

The Lab shows you to demodulate and decode the car key fob RF signal.
May 02, 2019 23:20
Hello Scott,

Would you let us know which SDR device you prefer? I saw a lot of different devices and start to figure out the differences.

Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.