AIS Receiver

The page was last updated Oct 13, 2022

My brother in-laws boat has a reasonably complex NMEA2000 instrumentation system that I wanted to understand better so I started playing with Arduino and ESP based controllers. I managed to find a few really decent libraries that allowed me to get started pretty easily. However one issue I have is that the boat is  quite far away from where I am so I can`t just tinker with it when I want to. And while I keep my eyes open for any NMEA2K based devices on Craigslist there isn`t much around. And when I do find some it is typically too pricey for just tinkering with.

I have setup OpenCPN on a laptop and it is incredible. I can connect it to the SIMRAD NMEA2000 system on the boat via the onboard Ethernet network and get all the streaming data that lets me see the position, AIS data, speed, depth, etc. But I can`t do the same at home where I am boatless.

So I wanted to get some boat data sources. I did have a serial port based GPS so was able to send that data but as the house doesn`t move much the  information was not very dynamic. I then stumbled onto various DIY AIS receiver sites and while I`m not near the boat, I am near a harbor so the data would be constantly changing and make for more interesting tinkering.

Since I already had a Raspberry Pi and a Nooelec NESDR SMAerTee SDR dongle I was hoping that I could find a solution that would use these to help keep the costs down. I found the SARCNET.ORG site and not only did it use the parts I had, they even have a prebuilt image for the raspberry Pi and information on making your own antenna. The software in the image is a bit old (in fact you can`t easily update it with the current release) but it is fine for the single function that it does.

To start I obtained the software image (you need to fill out a form to request access to the image) and loaded it onto a SD card. I booted up the Raspberry Pi and followed the setup instructions. All went fine till I tried upgrading the raspberry Pi. I got all sorts of errors. After a researching a bit it seems that the image is so old that the current update sites don`t support it. I did find some commands that allowed the update to change the release but was not ever able to clear all the errors. The image works fine as it is so I decided to leave it and move onto the next step.

I did not have a proper AIS antenna (something that works in the 162Mhz range) so I just used the antenna I got with the SDR and connected it all up. I then went through the calibration test. First thing to do is let the system warm up and stabilize for a good 10-20 minutes (most SDR modules run very hot). Then run the routine as described on SARCNET webpage. I found with mine it was pretty close (it is advertised as a 0.5PPM SDR) and didn’t need the PPM correction value changed.

Once I restarted the system I went to the Monitor Your AIS Receiver section and ran the commands. I could immediately see AIS messages being received. The default settings of this system send the data to three ship tracking sites (Packet Mariner, Ship Finder & Vessel Finder) as an anonymous user. But you can setup accounts at some of the sites. Doing so at some of the sites gets you a free account that people have to pay for.

Next had to had to install the system with a proper antenna. The SARCNET site does show how to make an antenna but didn`t seem to have many details. I spent some time researching antenna options and found that the type on antenna they show is often referred to as a flower pot antenna and you can find a few web sites with  information.

I found various projects using different types of PVC but none seemed to be the size that I was able to get . The key part of this design is the coil of coax on the bottom that acts as a choke and allows the antenna to operate correctly. I eventually found that the diameter of the coil wasn`t important but the length of the wire in the coil was. And I found a handy site with a calculator for determining this length:

For my version I wanted to use 1/2 inch PVC for the antenna portion and 3/4 inch PVC for the mounting portion. The 3/4 inch PVC is much stiffer and would allow me to extend the antenna a bit higher for better reception. 

One my first build I bought a 15 foot length of RG58 coax with a BNC connected already crimped on. I didn`t want to try my own crimps as I never seem to have the correct crimper (nor much luck in crimping). The problem I ran into is that typically the build calls for two holes to be drilled so the coax comes out of the 1/2 PVC (from the top antenna portion), coils around the PVC, then goes back through a hole in the 1/2 inch PVC to come out the bottom. There was no way to make a hole big enough for the BNC connector. I ended up cutting a slot to side the cable in and then using a PVC 1/2 to 3/4 adapter to cover the slot. To protect the coax coil I wrapped it all with white electrical tape. I didn`t take any pictures during the initial build but I will be making a new antenna and will show step by step pictures. Honest…

The next step as to make a case and figure out how to mount it all outside. I have a small balcony that points toward the harbor and there is an electrical outlet. I could mount the equipment under the roof overhang where it would be out of the weather but I would still need a case. I had a Telco/Cableco style outdoor box on hand and mounted a piece of plywood in it. I then mounted the Raspberry Pi, the SDR and a small switching power supply in this box.

As noted previously the SDR module does run hot. Very hot. So I stuck on a bunch of small heat sinks meant for Raspberry Pis as I had lots and they were self adhesive (so literally peel and stick). The SDR is also pretty big and I didn`t want that weight possibly breaking the USB connector on the Pi so I used a short USB extender cable. I also rigged up a 12V to 5V power supply so I could use a 12V wall wart to power it all. It uses a cheapy switch buck power supply module and connects to the Pi using a Micro USB connector.

I then mounted the box on the wall and mounted the antenna on the balcony railing. Because I will be making a new antenna (I want it to be taller for better reception and actually take pictures of the build) I have just clamped this antenna to the railing but will come up with a better solution later.

One of the sites I upload the AIS data to is You can see a summary of the AIS data I am sending on this page:

I`m going to try to make my new antenna higher and hope to get slightly better coverage but I`m pretty happy with the results I have considering it`s a home built antenna. 

To make this work with OpenCPN I added the IP of the PC running it to the AIS configuration as a destination for the data and then setup OpenCPN to use the data as a source. It was pretty easy to setup and now my very stationary copy of OpenCPN shows the harbor traffic in real-time.

I am also working on a project to bridge the AIS data from the Raspberry Pi to a NMEA2000 network node so I can play with the data with various homebuilt NMEA2K nodes.

I also plan to add an outdoor GPS module so I can add that data to the feed and also get it into the NMEA2K test network.