Bits about technology, gadgets, DIY and more!

Listening to HD Radio with an SDR

"HD Radio" is the technology by which US radio stations broadcast digital audio along with their regular analog signal. Standard FM radios only receive the analog signal and ignore the digital data. You need an HD Radio to listen to the digital audio. HD radios are most popular as features in newer automobiles, but adoption outside of car radios, as well as awareness by the public has been underwhelming.

The “HD” in HD Radio does not stand for "high definition." In fact, Ibiquity, the company that developed (and trademarked the name) HD Radio, claims that HD doesn’t stand for anything. For us hobbyists that routinely use SDR (software defined radio) to look at the waveforms of broadcast radio, we have seen the HD Radio signals as two rectangular blocks of data alongside a station’s main signal. However, since HD Radio uses a proprietary protocol, we have not been able to decode or listen to this data.

On June 9, 2017, a cybersecurity startup based in Austin, TX named Theori, posted a full description of how HD Radio works along with their open source software implementation using a $25 RTL-SDR radio. (They utilize the official government name for HD Radio, "NRSC-5.") Finally, the veil has been lifted on the mysterious encoding for this digital system, and it turns out that it is a slightly modified version of HE-AAC.

If you are looking for a fun two-hour project, you can use Theori’s code on GitHub to create your own NRSC-5 digital radio. I followed the instructions and with just a little extra troubleshooting, I was able to get it to work. Here is what the screen output looks like when you are successfully decoding NRSC-5 audio:

nrsc5 debug output

Here are some notes on my setup:

  1. I used Ubuntu Server 14.04 (no UI) on a VMWare virtual machine. 8GB of RAM and 2 processors. Make sure your machine (virtual or not) produces audio before proceeding with the setup. I used "speaker-test" for this purpose.
  2. Be sure to install all the dependencies first. You can use a package manager such as apt-get to do the installs.
  3. To do the build of nrsc5, first learn how to clone a repository on GitHub. I looked at a few examples and was able to make sense of the build instructions.
  4. When trying to run nrsc5, I received a "usb_claim_interface error -6" because my system was trying to load the SDR hardware as a TV device, so I had to blacklist that driver at boot so it would not interfere. Use these steps:
    a. Open your /etc/modprobe.d folder as an administrator.
    b. Create a new file 'blacklist-rtl.conf' and add this one line:
    blacklist dvb_usb_rtl28xxu
    c. Save the file, close the editor and restart the machine.
  5. A good antenna and strong signal are crucial. The digital signal is significantly lower in power than the main analog signal.

Good luck and I hope you enjoy the digital audio!

Getting Started with LoRa

LoRa is a radio technology for long range, low bit rate communication among sensors (temperature, light, location etc...) and other IOT devices. The sensors send their data to a radio receiver known as a gateway. The leading protocol used by sensors and gateways to manage communications, frequency, data rate and security is known as LoRaWAN. The gateway transfers the sensor data to the cloud so that web applications and end users can utilize the data.
A complete system includes one or more sensors (or nodes), one or more gateways, and a server or cloud-based app for interacting with all of the sensor data. Finding a complete working system out of the box from one source is challenging in these somewhat early days of the technology. Two full-featured kits that stand out are the Link Labs Development Kit (which uses a LoRaWAN alternative called "Symphony Link") and the MultiConnect Conduit IoT Starter Kit. Both of these include nodes, development boards and a gateway, along with instructions for connecting to various back end software and infrastructure.
The only downside to these kits are the price which is in the $1,000 or more range. That can be a lot for a hobbyist or sole experimenter to spend for evaluating a new technology. A less expensive route is to build the components on your own. Nodes, sensors and gateways can be built with readily available microcontrollers, radio modules and open source software. The downside to this approach is the typically poor documentation, compatibility issues and varied skills required to make the system work from end to end. The upside is that you (usually) learn quite a bit about the technology when you have to figure it all out yourself. (If you get frustrated easily or lack persistence this may not be the best route.)
With that in mind, I decided to build a gateway using a $289 kit sold by Seeed Studio, based on the RHF0M301 LoRa radio module by RisingHF and a bridge for connecting it to a Raspberry Pi. (The Pi is not included) It is a pretty good trade off of price and features. The Seeed is an eight channel gateway, meaning that it can receive on eight channels at the same time, which makes it LoRaWAN compatible. You could build a single-channel gateway for less than $50, but it would be of very limited use. See my post for a detailed step by step guide for successfully setting up this gateway to work on the Loriot system. The manufacturer's documentation is fair at best and the seller has limited information on their website.
Any LoRaWAN compatible node using the same frequency (The unlicensed 900 MHz band in the US) should work with the RisingHF gateway. I chose the $35 Adafruit Feather M0 with RFM95 LoRa radio. It is a very compact Arduino-compatible microcontroller that includes a LoRa radio transciever. The full LoRaWAN stack is not included, so to provide complete compatibility with the RisingHF gateway one has to do a bit of software configuration. However, the M0 has plenty of capacity and I have successfully transmitted from this node to the gateway. I will walk through my step-by-step setup process in a future post.
There are a lot of players with a lot of big plans in the wireless IOT space (check out SigFox!) and many predict a future with billions of nodes and hundreds of thousands of gateways. It will be interesting to see how it all pans out, and if all of these systems can coexist with each other.
LoRa and LoRaWAN are trademarks owned by Semtech and LoRa Alliance respectively. MultiConnect Conduit is a trademark of Mulit-Tech Systems.

Sharing Data From the Netduino

As mentioned in an earlier post, I've been working with the Netduino microprocessor board, a .NET version of the open source Arduino. In preparation for designing a home energy monitoring system, I created a small project to measure and post data from the Netduino. The simplest circuit I could find consisted of a photocell and a resistor wired into one of the analog inputs. Every 60 seconds, the Netduino measures the value from the photo cell and posts the data to the Cosm website where it is graphed and displayed for all to see.

Data collection, analysis, and display are a particular interest of mine considering my background in SQL Server design and programming. Granted, this project produces a tiny amount of data, but it is a first step in integrating a microprocessor board with online graphing. One of the great features of Cosm is that you can set triggers for events to happen based on your data. For instance, when the daylight value reaches 66% I could send a tweet announcing that it is daybreak in Philadelphia. Cosm also provides graph widgets for any public data stream on their site, such as the one below.

view on


Building Awesome Projects With Netduino

The Arduino is a popular open source microprocessor system for hobbyists, artists and experimenters to build interactive projects and devices. The Netduino is based on the Arduino but runs on the .NET platform and can be programmed in C Sharp, a huge boon to C Sharp programmers like myself. My first project is to convert an old analog jukebox from vinyl to mp3 using the Netduino to replace the relays that control the logic in the old system. My second Netduino project will be to build an energy tracking system for household use via a current sensor and online graphing using cosm.


Mash My Data

In late 2009, I developed a web-based application for the Consumer Electronics Association’s "Apps For Innovation" contest. The goal was to demonstrate how innovation and entrepreneurship are impacting the U.S. economy. I chose to focus on the FCC radio spectrum auctions and how business of many different sizes were impacted by these transactions.

The site still stands, so check it out!