Recently I got interested in RTL-SDRs. It is pretty interesting how the electronic components in radios can be successfully implemented in software instead.

RTL-SDRs are software defined radios (SDRs) that were based off the RTL2832U chipset, and were originally intended to be used as DVB-T TV tuner dongles to receive digital terrestrial broadcast signals.

However through the enterprising efforts of some developers, they managed to turn the DVB-T TV tuner dongles into a software defined radio, eliminating the need for any other electronic components to tune into radio. With simply the RTL-SDR dongle, an antenna and a computer with Internet connection to download the appropriate software, one can get a radio. Now that's one lesser object to include in your emergency supplies!

After getting my hands on a RTL-SDR dongle, I decided to track the position of ships since I live near to the beach.

In case you were wondering, Marine Traffic is a site which allows you to see the live positions of ships anywhere in the world. But our antenna is not so powerful, so it will only be able to pick up Automatic Identification System (AIS) signals within its range. Thus, your mileage may vary. (Build a more directive antenna maybe?)

Setting up the RTL-SDR USB dongle

Prerequisites: RTL-SDR dongle, Zadig, SDR Sharp, rtl_ais, OpenCPN

1. Download Zadig and install it.

2. Plug in the RTL-SDR.

3. Run Zadig as administrator.

4. Under Options > List All Devices, make sure it is checked.

5. In the drop down box select Bulk-In, Interface (Interface 0) or RTL2832U.

6. Make sure WinUSB is selected as the target driver and click on Replace Driver.

SDRSharp

1. Open SDRSharp, select the Gear to Configure Source for the RTL-SDR input device.

2. Select Generic RTL2832U.

3. Find the ppm error and key it into Frequency Correction (ppm) under Configure Source.

4. Tune to an AIS frequency (either 161.975 MHz or 162.025 MHz).

5. Find a location with lots of moving ships/vessels and setup the laptop, RTL-SDR and the antenna.

6. Try to receive some AIS signals. They look like small horizontal lines.

7. Find the left and right AIS frequencies and note them down. The two AIS frequencies broadcast the same information asynchronously. The two frequencies must be within 1.2 MHz so that we can use rtl_ais.

Using rtl_ais to decode AIS signals

1. Download rtl_ais and extract contents of the ZIP file downloaded.

2. Open the extracted ZIP file.

3. Open ais.bat, and add additional arguments such as the PPM value and the left and right frequencies.

4. Save ais.bat and run it.

5. If everything is working, it will receive AIS traffic on the left and right frequencies and send NMEA sentences to 127.0.0.1:10110 via UDP by default.

Display AIS data on OpenCPN

1. Download and install OpenCPN.

2. In Options > Connections, under Data Connections, click on Add Connection.

3. Select Network UDP Connection with address 127.0.0.1 and port 10110. Click Apply and OK.


If everything works as intended, your map in OpenCPN will look similar to the one in MarineTraffic. Enjoy!

References