Arduino Ais Repeater

  How to create an AIS repeater with an Arduino board. This is a hobby project, to remove a PC while sending out the AIS messages to sites like aishub.net

Hardware

 
Components Optional  
Arduino (25 euro)
Arduino Ethernet Shield (30 euro)
 
RS-232 cable to connect to the AIS
7-12V power
Proto Shield (5 euro)
LCD display (? euro)
Some wires
 
 
Another nicer option is to use the Raspberrypi mini computer, it already has a network connector and costs around 35 euro. It also runs linux, so the AISHUB linux software should run. We do need an RS232 to USB cable for this to work.

Software

The software still needs to be build, it should use the standard Arduino Ethernet and Serial library. See the links part for an example program.
Steps:
  1. Simple repeat of all AIS NMEA messages and forward them on the Ethernet connection.
  2. Add CRC checks (modify tinyGPS for this)
  3. Downsampling
  4. Statistics (use the LCD for that)
  5. Diagnostics
  6. Software configuration change (instead of a recompile to change an address)
 

Links

Contact

You can contact me at arduino@oppedijk.com

Code

#include <LiquidCrystal.h>
#include <Ethernet.h>
 
//LiquidCrystal lcs (RS, E, D0, D1, D2, D3)
LiquidCrystal lcd(6, 5, 10, 9, 8, 7);
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192,168,1, 3 };
byte gateway[] = { 192,168,1, 254 };
byte subnet[] = { 255, 255, 0, 0 };
Server server(23);
boolean started = false;
 
void setup() {
  //Start Serial
  Serial.begin(4800);
  //Start network and server
  Ethernet.begin(mac, ip, gateway, subnet);
  server.begin();
  // set up the LCD's number of columns and rows:
  lcd.begin(16,4);
  lcd.setCursor(0, 0);
  lcd.print("waiting");
}
 
void loop() {
  Client client = server.available();
 
  if (client) {
    if (!started) {
      lcd.clear();
      lcd.print("active");
      lcd.setCursor(0,1);
     
      started = true;
    }
    while (Serial.available()  > 0)
    {
      int c = Serial.read();
     
      server.write(c);
      lcd.print(c,BYTE);
    }
  }
}