This is a description of how to build a microcontroller based decoder for decoding AIS. It assumes you already have a VHF receiver / scanner that covers the marine band AND that you have access to its discriminator output. Alternatively you may use a radio module from RadioMetrix which is a pretuned single frequency receiver. AIS is broadcast by vessels interchangibly on two frequencies. (161.975 & 162.025). This receiver is capable of receiving and processing only ONE of these.
The source code was originally developed for a Stellaris Microcontroller LM38S11 by Peter Baston. The C code was then ported by me to the ATMEL family to support an ATMEGA-8 running at 8 MHz. The only difficulty was trying to “squeeze” the 4k RAM required by the original program into the 1k of RAM available on my chip. The LM38S11 has a total of 8K SRAM.
The decoder sends NMEA “sentences” to the PC through the serial/USB interface. The information is sent as “AIVDM” strings at a speed of 38400 baud. More on the AIVDM protocol here. The moment the decoder is connected to the PC a new “virtual” serial port will appear under the Windows “Device Manager”.

Images of the resulting hardware with the PCB inside an aluminium container, with a laser cut plexiglass front panel, with holes for the LEDs and USB type-B connector.

BOM – partlist

  • 1 ATMEGA8
  • 1 8.0000 MHz crystal
  • 1 CMX589
  • 1 4.9152 MHz crystal
  • 1 6 pin ISP connector
  • 1 10k res.
  • 2 1M res.
  • 1 100k res.
  • 1 50k trim res.
  • 1 100k trim res.
  • 1 270k res.
  • 1 320 res.
  • 1 LED
  • 2 33pF
  • 3 22pF
  • 2 15nF
  • 1 female USB port connector
  • 1 USB to TTL PL2303HX
  • RadioMetrix or similar receiver tuned to AIS, or 3.5mm connector for scanner input


AIS decoder schematic


PCB with audio connector expecting audio from the scanner’s discriminator. Also visible on the left is the Lantronix XPort.


Latest Modifications

Latest modifications include the replacement of the outdated RS232/TTL serial interface converter to a USB/TTL converter.
On the radio side, instead of obtaining the AIS bursts from an old scanner, there are some units from RadioMetrix pretuned to various frequencies. I obtained such a module tuned to one of the AIS frequencies.

Software for AIS decoding / visualization:

Another program discovered recently is “AIS decoder” which decodes all 26 message types, but lacks mapping capability.

File Resources