logo elektroda
logo elektroda
X
logo elektroda

How do you build your own Marine AIS receiver?

andreyatakum 2640 8
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • In previous articles I have already mentioned the possibility of receiving interesting parametric information from aircraft, an air-band receiver for listening to conversations between pilots and traffic controllers. No less interesting may be the data on marine vessels, transmitted by the AIS system. There are websites similar to the popular flightradar24 or flightaware, for example MarineTraffic or VesselFinder.


    Tracking of aircraft or marine traffic: method of data collection .
    The latter use the same method of collecting information and transmitting it to a website, so that any user can check the status of a flight or the voyage of a seagoing vessel. The way it works is that volunteers around the world install a receiver, register it in the system, connect it to the Internet and deliver the data to a server, which processes and shows it in a form that is clear to the user, i.e. as an image on a map.

    In this way, when walking along the sea, we can always check what ship we see on the horizon. However, there are situations when we don't have internet, even mobile internet. For example, on our own small sea vessel - a motor or sailing boat - without a suitable device. In such a case, information on maritime traffic can become not only useful, but lives may depend on it.

    Another issue - some marine vessel owners, most often wealthy government officials, prohibit the display of data on public services. However, to individual viewers they cannot prohibit it. This is legally and technically impossible.

    Anyway, I personally don't own a ship, I have internet almost all the time, but out of curiosity I decided to develop my own Marine AIS receiver.


    Characteristics of the project .
    Having an SDR receiver of the RTL-SDR type does not even require much programming experience. All you need to do is install the appropriate apps on your smartphone or notebook and that's it. I will describe here step by step for beginners the whole procedure, and at the end of the article I will add a schematic and a description of a fully self-contained receiver that avoids the use of an RTL-SDR dongle.

    The aim is to pick up the signal transmitted by the transmitter placed on the ship. The data emission takes place at 161.975 MHz or 162.025 MHz with a bandwidth of 25 kHz, with frequency modulation. Connect the RTL-SDR receiver. We start the Sharp SDR programme, set the frequency, band and modulation mode (narrow FM - 25 kHz). With the presence of a marine vessel within the sensitivity range of the antenna-receiver link, we will see something similar and hear the characteristic sound of a digital signal.

    Computer screen displaying software for receiving radio signals.
    .

    We decode the received data on the computer using the ShipPlotter software. Unfortunately it costs a little (about 100 zl), but you can play around with it free of charge for 3 weeks. By default, this programme receives the sound signal from an analogue receiver or saved in WAV format from another instrument. In our case, the receiver is the same computer on which this application runs. So we can connect the input/output of the sound card and start receiving data. However, often on laptops we have one plug for input and output, you have to solder on the jack wires. The simplest solution would be to use any program that connects the output to the input in a virtual way. There are plenty of programs for this purpose and anyone can use any.

    Personally, when I experiment, I use a physical connection between two computers: one which acts as a receiver and the other as a decoder and data display. It's not a practical solution, but it suits me because I'm going to use a decoder with an analogue receiver, instead of an RTL-SDR dongle, after the experiments.

    Anyway, once this hardware-software complex is up and running, in the ShipPlotter application menu we press View - Messenges. If the hardware and software are working correctly, we get data from the ships.


    Building and operation .
    As for analogue equipment: for several reasons I do not like digital receivers. Especially as in the case with AIS we do not need all their capabilities. I prefer analogue instruments of this type. Especially since in this case the receiver can be very simple.
    For example, it can be realised on the popular MC3362 integrated circuit. In fact, it is developed by Motorola for narrowband receivers. However, this is achieved by a double frequency conversion. The first (usually 10.7 MHz) is used to attenuate the mirror channel, and by the second (455 kHz) we obtain the narrow bandwidth of the audio signal. To extend it, it is sufficient to dispense with the second transformation and to use a broadband filter (25 kHz) at 10.7 MHz in the first IF.
    A typical receiver schematic on the MC3362 looks as follows:

    MC3362 receiver application schematic by Motorola.
    .

    The broadband variant, on the other hand, looks like this:

    Diagram of an AIS receiver based on the MC3362P chip.
    .


    As you can see, the first IF signal from the filter is fed to pin 7, instead of 17. After its amplification, it is detected on the discriminator with inductor L3 and capacitor C12. Obviously, the contour, which consists of these elements, must have the frequency of the first IF. The ceramic filter on 10.7 must have a bandwidth of not less than 25 kHz.
    The heterodyne is to be set to one frequency, which is 161.975 - (or +) IF. A simple quartz oscillator or a frequency synthesiser on an Arduino and si5351 IC can be used:

    Electronic schematic of a receiver on Arduino Pro Mini with SI5351 module.
    .


    The simple code can be found below the spoiler:
    Spoiler:
    #include "si5351.h"
    #include "Wire.h"

    //----------------------------------------------------------------------------
    // LO (heterodyne) frequencies * 10 Hz

    const uint32_t chan_tab[10] =
    {
    15125000,
    15132500,
    };

    Si5351 si5351;
    byte channel;

    #define SELECT_PIN_1 2

    //--------------------------------------------------------------------------------
    byte read_chan_number()
    {
    if (!digitalRead(SELECT_PIN_1)) return 1;

    return 0;
    }

    void set_current_chan()
    {
    byte new_chan;

    new_chan = read_chan_number();
    if (channel != new_chan)
    {
    digitalWrite(LED_BUILTIN,HIGH);
    channel = new_chan;
    si5351.set_freq(chan_tab[channel] * 10000ULL, SI5351_CLK0);
    digitalWrite(LED_BUILTIN,LOW);
    }
    }

    //--------------------------------------------------------------------------

    void setup() {
    Serial.begin(9600);
    bool i2c_found;

    pinMode(LED_BUILTIN,OUTPUT);
    pinMode(SELECT_PIN_1,INPUT_PULLUP);

    i2c_found = si5351.init(SI5351_CRYSTAL_LOAD_8PF, 0, 0);
    if(!i2c_found) // si5351 not found
    {
    while(1)
    {
    digitalWrite(LED_BUILTIN,HIGH);
    delay(200);
    digitalWrite(LED_BUILTIN,LOW);
    delay(100);
    }
    }

    channel = 255;
    si5351.update_status();
    si5351.drive_strength(SI5351_CLK0, SI5351_DRIVE_2MA);
    si5351.set_correction(81000, SI5351_PLL_INPUT_XO);
    set_current_chan();
    si5351.output_enable(SI5351_CLK0, 1);
    }

    void loop()
    {
    set_current_chan();
    Serial.println("channel" + String (channel));
    delay(100);
    }
    .


    Antenna selection .
    An important consideration for this system is the antenna. Common and cheap RTL-SDR receivers are sold with one that is not suitable for anything. It looks like a 500-1000 MHz frequency. AIS reception needs a more efficient solution. In the case with a marine vessel installation, this can be a GP (Ground Plane) type antenna, having omnidirectional radiation in the horizontal plane. It consists of one vertical radiator of length λ/4 (λ as we know is the wavelength, in our case it is about 1.6 m) and several counterweights of length not less than λ/4. The counterweight can be a flat metal roof. When we use the receiver in stationary conditions, i.e. on the shore, it makes sense to use a directional antenna, "looking" towards the sea.
    My GP antenna is located on the roof of an apartment building. It is connected to the receiver with a coaxial cable (as in satellite TV) via an MCX-F-type adapter.

    Portable RTL-SDR receiver on a lace tablecloth
    .

    Cool? Ranking DIY
Do you have a problem with Arduino? Ask question. Visit our forum Arduino.
About Author
andreyatakum
Level 14  
Offline 
andreyatakum wrote 551 posts with rating 761. Live in city Antalya. Been with us since 2021 year.
  • ADVERTISEMENT
  • #2 21287859
    satanistik
    Level 27  
    OPEN CPN can also receive this signal and plot the position on a map, and it is free. I wonder if it would be possible to receive everything if the processor tuned between these channels alternately. I wonder what the channel the ship is transmitting on depends on.
  • #3 21287874
    andreyatakum
    Level 14  
    satanistik wrote:
    I wonder what the channel the ship is transmitting on depends on.


    The second channel (162.025 MHz) is the data exchange between ships.
    satanistik wrote:
    . I wonder if if the processor tuned between these channels alternately it would be possible to receive everything.
    .
    For an SDR type receiver this is no problem. As for analogue we need two, or a quick switch between two channels. In the case with my synthesiser variant this is possible as much as possible. You can connect an n-p-n transistor with the collector to pin D2 with the emitter to ground. And control from the computer. Or add a couple of lines to the code so that the synthesiser connects channels depending on the presence of an audio signal on one of the analogue pins.

    Added at 49 [seconds]: .

    satanistik wrote:
    OPEN CPN can also receive this signal and plot the position on the map and it is free.
    .
    Thanks! I will look for this programme immediately
  • ADVERTISEMENT
  • #4 21287918
    satanistik
    Level 27  
    Link .

    Here is an interesting receiver design on 2 SI4362 chips and an STM proc. The chip listens to both channels and transmits data via UART.
    There are program sources and a schematic and PCB. I don't really see somewhere a description of how to make the inductance, but maybe the author or someone from the shortwave forum could help something.
  • ADVERTISEMENT
  • #5 21288006
    andreyatakum
    Level 14  
    satanistik wrote:
    I don't really see somewhere a description of how to make the inductance but maybe the author or someone from the krutkofalarz forum would help something.
    .
    Exactly that is not a problem.
  • #6 21290184
    ArturAVS
    Moderator
    VHF is a rather short range. If one lives near the sea/ocean then ok. By the way, Si4362 is not even recommended by the manufacturer for new receivers. @andreyatakum Why in the example code, did you not add a quartz calibration option for the Si5351?
  • ADVERTISEMENT
  • #7 21290421
    andreyatakum
    Level 14  
    ArturAVS wrote:
    VHF is a rather short range. If one lives near the sea/ocean then ok.
    .
    True, even for me, living just off the sea shore, catching signals from sea vessels checks the problem, because the trails are in the distance. An example on the map. My place of residence is marked in red. As you can see, the head track is about 50 nm to the south. An RTL-SDR receiver with a cable of approx. 25 m is not very suitable.

    Map of the Mediterranean coast with marked ships and a red square indicating the place of residence.
    .

    ArturAVS wrote:
    Why, in the example code, did you not add a quartz calibration option for the Si5351?
    .
    Because I forgot. I used this scheme for a receiver on the low frequency bands (3.5 MHz) and for a CB radio. There the inaccuracy does not matter much.
  • #8 21290992
    satanistik
    Level 27  
    I was thinking of a receiver to build a navigation computer. On a sailboat, every watt of power counts so grinding out that SDR which requires constant fast calculations may not be optimal. As for the Si chip - it is still on sale and I think that a few pieces for the needs of amateurs will be found for some time yet. In general nowadays circuits are short lived not like NE555. There is a project on google for a colinear antenna which is almost 2m long - maybe it would help with shore reception.
  • Topic summary

    The discussion revolves around building a Marine AIS receiver, focusing on the technical aspects of signal reception and data processing. Participants mention the use of software like OPENCPN for visualizing AIS data on maps. Key components discussed include SDR (Software Defined Radio) receivers, specifically the SI4362 chip for dual-channel listening, and the Si5351 for frequency calibration. Challenges such as limited VHF range and signal reception from distant vessels are noted, along with suggestions for improving reception, such as using a collinear antenna. The conversation also touches on the longevity of electronic components and the need for efficient power usage in marine applications.
    Summary generated by the language model.
    ADVERTISEMENT