rgarside
Well-Known Member
I have just finished testing a 2 port NMEA multiplexer and data logger I have built based on an Arduino Mega 2560.
The Mega 2560 has four UART's, so providing 3-4 NMEA inputs and outputs is no problem. I only need two initially, and used a Max232 chip to interface between RS232 and the TTL level of the Arduino UARTs - this enables both input and output of RS 232 NMEA data.
The datalogger "shield" is from Adafruit, it has an SD card slot, a real-time clock, and a prototyping area I used to mount the Max232. There are a couple of adaptations to make it work with the Mega, but these are all covered in the Adafruit documentation.
I powered it with an integrated 5v switching power supply to minimise the power it draws. It seems to draw about 60 - 70 mA from the 12v supply.
I found that the standard Arduino programming system limits the serial buffer sizes, so I got a lot of buffer overflows when I first tested it with the two input streams. While there are other ways of overcoming this, I subsequently found additional code libraries [ SerialPort and SdFat ] that allow changing the sizes of the buffers, and also speed up writing to the SD card.
The code now seems to run successfully.
Initially I just wanted to log the position and echosounder data that is all on one bit of the boat's network, but then thought it would be good to capture the wind data that is on a second channel - hence the need for two channels.
The position and depth data can be sent to initiatives like TeamSurv for chart improvements, while the wind data should allow me to look at the boat's performance and make polar plots.
In the course of making the logger it was very easy to add a sensor for logging the barometric pressure and temperature, and to measure and log the supply voltage.
If anyone is interested in the Arduino code to make it work, let me know.
Adding another Max232 would be easy and would allow the other two ports available to be interfaced.

The Mega 2560 has four UART's, so providing 3-4 NMEA inputs and outputs is no problem. I only need two initially, and used a Max232 chip to interface between RS232 and the TTL level of the Arduino UARTs - this enables both input and output of RS 232 NMEA data.
The datalogger "shield" is from Adafruit, it has an SD card slot, a real-time clock, and a prototyping area I used to mount the Max232. There are a couple of adaptations to make it work with the Mega, but these are all covered in the Adafruit documentation.
I powered it with an integrated 5v switching power supply to minimise the power it draws. It seems to draw about 60 - 70 mA from the 12v supply.
I found that the standard Arduino programming system limits the serial buffer sizes, so I got a lot of buffer overflows when I first tested it with the two input streams. While there are other ways of overcoming this, I subsequently found additional code libraries [ SerialPort and SdFat ] that allow changing the sizes of the buffers, and also speed up writing to the SD card.
The code now seems to run successfully.
Initially I just wanted to log the position and echosounder data that is all on one bit of the boat's network, but then thought it would be good to capture the wind data that is on a second channel - hence the need for two channels.
The position and depth data can be sent to initiatives like TeamSurv for chart improvements, while the wind data should allow me to look at the boat's performance and make polar plots.
In the course of making the logger it was very easy to add a sensor for logging the barometric pressure and temperature, and to measure and log the supply voltage.
If anyone is interested in the Arduino code to make it work, let me know.
Adding another Max232 would be easy and would allow the other two ports available to be interfaced.

