Why build a radar?

If you have an interest in aircraft then a cheap and easy way to receive details of aircraft near to you is using a cheap USB TV tuner as a software defined radio to decode aircraft radar transponder transmissions. Modern transponders can transmit more than just a squawk code and altitude allowing you to see their identity, position, speed and direction, and a Raspberry Pi is cheap enough to dedicate to the task. Tuners can be had from eBay for less than £10. Here's the hardware I'm using to test:


Software setup

Starting with the latest raspbian image apply the latest updates, then we can install a few extra packages and compile the software we need:

sudo apt-get install libusb-1.0.0-dev libmysqlclient-dev cmake

git clone git://git.osmocom.org/rtl-sdr.git

cd rtl-sdr

cmake .

make -j4 (because we have lots of cores to play with on a Pi2)

sudo make install


wget http://lee.smallbone.com/blog/wp-content/uploads/2014/03/dump1090-1.08.1003.14-mysql.tar.gz

tar xvfz dump1090-1.08.1003.14-mysql.tar.gz

cd dump1090-mysql

PREFIX=/usr/local make -j4

cat <<EOF > /etc/modprobe.d/rtl-sdr-blacklist.conf

# This system has librtlsdr0 installed in order to

# use digital video broadcast receivers as generic

# software defined radios.

blacklist dvb_usb_rtl28xxu

blacklist e4000

blacklist rtl2832


cp dump1090 view1090 /usr/local/bin/

cp -av public_html /usr/local/share/dump1090

At this point you have the software built, but linux will have loaded the tv drivers not the sdr drivers. The simplest solution to this is a reboot.


Actually receiving data


Once things are up and running again you can fire up dump1090:

dump1090 --interactive --net --modeac --phase-enhance --aggressive --net-http-port 8080

You should see something like this in your terminal:


This shows you any aircraft being received. For a more interesting view point your browser to port 8080 on your Pi and you should see something like this:


So now you have a list of the local aircraft, and a map showing their position. Selecting an aircraft will cause its track to be recorded and displayed. The centre of the map and the range rings can be configured for your location - you need to edit the config.js file in /usr/local/share/dump1090


Pi or Pi 2?

I've been running this setup on an original Pi Model B for a number of months logging to a database and also supplying data to Flightradar24. The load average on an original Pi is around 1.05 and this causes it to slowly grind to a halt and eventually become completely unresponsive. A reboot solves this but is annoying if you're trying to collect long term data. Running the same software on a Pi 2 results in a loadaverage of 0.43 - so you could probably get away with running multiple receivers on a single system.


So is it worth an upgrade?

If you're just running dump1090 to see whats around you then an original Pi will just about cope. Once you want to actually do something with the data then a Pi 2 will really make a difference to the performance and stability of the system.