Cruisers Forum
 

Go Back   Cruisers & Sailing Forums > Engineering & Systems > Marine Electronics
Cruiser Wiki Click Here to Login
Register Vendors FAQ Community Calendar Today's Posts Log in

Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 11-05-2020, 15:12   #1
Registered User
 
BjarneK's Avatar

Join Date: Dec 2010
Location: Århus, Denmark
Boat: Boreal 47
Posts: 158
NMEA 0183 and 2000 multiplexer for Raspberry Pi

A couple of years ago, I built an add-on board for a Rasperry Pi computer for receiving NMEA 0183 and NMEA 2000 data to the Raspberry Pi. It is in the form of a HAT board, i.e. a board that uses the 40 pin connector on the Pi and is the same size as the Pi, except shorter to leave room for the ethernet and USB connections on the Pi.

It has been working fine, but I have never gotten around to sharing the design. Right now I am stuck in Mexico, so finally got around to picking up the project again. I am redesigning the PCB and could use some input. The idea is to release the PCB information and microcontroller code to let anybody build it. Being stuck in Mexico has the downside that I cannot really order new parts, so this is not going to be done any time soon. But this may still be a good time to get some designs done.

The specification is that it can receive NMEA 0183 from eight independent channels, four at 38,400 bps and four at 4,800 bps. The 38,400 bps channels can individually be configured to 4,800 bps if needed. My prototype board actually has two NMEA 2000 channels, but I am planning on cutting that down to one. Few people have two independent NMEA 2000 networks. The reason I made two of these channels was that I have another network on the boat for tank levels and battery information that I think is CAN bus based, but I have never gotton around to hooking that up.

The price of the components add up to around 25-35 USD and a programmer for the PIC microcontroller will also be needed (35-40 USD). I will not be putting a lot of these boards together, so the idea is that people order parts, including the PCBs and start soldering. All component are through hole versions, so it is not difficult. People can get together in a group and build them together, saving on costs. The place I usually buy PCBs in China sell 10 PCBs for 10 USD (plus shipping), so there are advantages to making several units at once.

My first question is very general: Would you find something like this useful?

My next questions are more technical and are mostly for any electrical engineer types that may be reading this.

The eight NMEA 0813 input channels are optically isolated using HCPL2531 optocouplers with a diode for reverse voltage protection and a 2.2 kOhm resistor to limit the current. For 5 V talkers, this keeps the current below 2 mA which is the limit for a receiver according to the specification. For higher voltage talkers, the current will exceed this specification. A talker should be able to deliver 15 mA according to the standard and this has never given me any problems. Is it something that you would worry about?

The next question concerns the NMEA 2000 receiver. This is not optically isolated from the Raspberry Pi. It seems fairly normal to not isolate NMEA 2000 units, but most often they are powered from the NMEA 2000 network so it is not a problem. In the case of the Raspberry Pi, I prefer to power it using a 12 V to 5 V converter connected to the main battery. This converter has the same ground on the input and output, which means that the ground of the Raspberry Pi is the same as on the NMEA 2000 network. To avoid ground loops, I am not connecting these two grounds since they may be a little bit different in practice due to voltage drops in supply wires on the boat. I use the MCP2562 chip for the physical layer of the NMEA 2000 receiver and only connect the signal wires of the NMEA 2000 cable. The MCP2562 can accomodate ground differences up to 12 V in either direction and still function correctly. Differences of more than 50 V are needed to cause damage. Is this requirement of common ground on the Raspberry Pi and the NMEA 2000 network something you would worry about?

It is of course possible to solve these two electrical issues, but at the cost of a more expensive and more complicated board. I would not build a commercial product like this, but I do not worry about these issues on my own boat.

The final question is in regards to protecting the Raspberry Pi I/O pins. I use UART and SPI to communicate with the board. In my prototype, these communcation channels are connected directly to the PIC 16F1705 that handles the NMEA 0183 and to the MCP2515 that handles NMEA 2000. No problem, but it struct me that if I configure an I/O pin on the Pi to be an output and it is connected to an output from the ICs on the board, I may fry the Raspberry Pi. I figure that connecting a 2.2 kOhm resistor in series with each I/O of th Pi should solve this problem by limiting the current to around 2 mA. I don't think that this will hinder the communication. One could argue that this may not be necessary for the input pins on the MCP2515 since there should never really be a problem. If the PIC is programmed right, the same could be argued for the inputs on that. What do you think? My current thinking is to put a resistor on all the communication pins that I use, but it does take up some space on the PCB.
BjarneK is online now   Reply With Quote
Old 11-05-2020, 15:28   #2
Registered User
 
Dsanduril's Avatar

Join Date: Aug 2011
Location: Petersburg, AK
Boat: Outremer 50S
Posts: 4,229
Re: NMEA 0183 and 2000 multiplexer for Raspberry Pi

An interesting topic to post as I have just spent a disappointing hour looking at Pi hats. I could easily see a use for this, although I don't think I need that many NMEA ports. Still, broad applicability. What would be the killer board for me would be what you are describing + 6-36V input, 5.2V output power supply so I don't have to have the power brick around separately.

The power hat from BC Robotics has interested me because it has a large amount of breadboard space left for something along the lines of your project. I wish it had a broader voltage input range to allow use on 24V systems as well as 12V.

With the values you have shown I wouldn't worry too much about the NMEA 2000 ground connection. I thought about the power connection when I wrote above about a power converter, but I too would prefer to not have the Pi on the NMEA 2000 power drop.

If something can go wrong it will, so I would vote for the comm. port resistors as well, although you could maybe show them as optional for self-builders. Of course, from a space perspective if you leave the space on a printed board you can't really get it back.

I'll at least be interested in seeing your drawings, and might be able to breadboard one together in short order for testing.
Dsanduril is offline   Reply With Quote
Old 11-05-2020, 16:14   #3
cruiser

Join Date: Nov 2007
Location: Probably in an anchorage or a boatyard..
Boat: Ebbtide 33' steel cutter
Posts: 5,030
Re: NMEA 0183 and 2000 multiplexer for Raspberry Pi

What about designing the board in easyeda.com, then anyone could order one through jlcpcb with most of the components soldered on surface mount. Jlcpcb has a huge range of components available. https://jlcpcb.com/parts/componentSe...rchTxt=16F1705

Esp32 based sensor board here I had made by jlcpcb, you could add voltage/current sensors for a few dollars, gold dust on a cruising boat plus accurate barometer would be little.

https://github.com/boatybits/boatymonpy
conachair is offline   Reply With Quote
Old 11-05-2020, 16:58   #4
Registered User
 
BjarneK's Avatar

Join Date: Dec 2010
Location: Århus, Denmark
Boat: Boreal 47
Posts: 158
Re: NMEA 0183 and 2000 multiplexer for Raspberry Pi

Quote:
Originally Posted by Dsanduril View Post
An interesting topic to post as I have just spent a disappointing hour looking at Pi hats. I could easily see a use for this, although I don't think I need that many NMEA ports. Still, broad applicability. What would be the killer board for me would be what you are describing + 6-36V input, 5.2V output power supply so I don't have to have the power brick around separately.

The power hat from BC Robotics has interested me because it has a large amount of breadboard space left for something along the lines of your project. I wish it had a broader voltage input range to allow use on 24V systems as well as 12V.
Thanks for you comments regarding the design.

That is pretty neat power HAT. Unfortunately, there is not going to be room on that board for my whole design. I have three Raspberry Pis on my boat, so separating the power supply and NMEA functionality makes sense for me since I can then use the same type of power supply for all these Pis. So far I have been using standard car type USB supplies where i solder on the 12 V leads and cover this with heat shrink. Not exactly very neat. The other day, I saw this: https://www.adafruit.com/product/1385 Something like that would suit me well, I think. Your are right that it would be nice if such small power supplies would also handle 24 volt input. But that would probably be an extra 5 cents in components...
BjarneK is online now   Reply With Quote
Old 11-05-2020, 17:04   #5
Registered User
 
BjarneK's Avatar

Join Date: Dec 2010
Location: Århus, Denmark
Boat: Boreal 47
Posts: 158
Re: NMEA 0183 and 2000 multiplexer for Raspberry Pi

Quote:
Originally Posted by conachair View Post
What about designing the board in easyeda.com, then anyone could order one through jlcpcb with most of the components soldered on surface mount. Jlcpcb has a huge range of components available. https://jlcpcb.com/parts/componentSe...rchTxt=16F1705

Esp32 based sensor board here I had made by jlcpcb, you could add voltage/current sensors for a few dollars, gold dust on a cruising boat plus accurate barometer would be little.

https://github.com/boatybits/boatymonpy

I like the idea of finding a place where they could build the whole design instead of people having to do it themselves. Can they also program the PICs for you? What do they charge for putting it all together?
BjarneK is online now   Reply With Quote
Old 11-05-2020, 17:05   #6
Registered User
 
Dsanduril's Avatar

Join Date: Aug 2011
Location: Petersburg, AK
Boat: Outremer 50S
Posts: 4,229
Re: NMEA 0183 and 2000 multiplexer for Raspberry Pi

Yes, I too have multiple Pis and only one really needs the navigation information, so for me too it is mostly a desire to be able to get away from the various external "boxes".

I'd still be interested in your project, I already have the Pi powered, and using this hat would get rid of the external USB/serial adapters, so that is very nice. And it would add NMEA 2000 (for me) which would allow me to get some engine data I've been wanting.
Dsanduril is offline   Reply With Quote
Old 11-05-2020, 17:17   #7
cruiser

Join Date: Nov 2007
Location: Probably in an anchorage or a boatyard..
Boat: Ebbtide 33' steel cutter
Posts: 5,030
Re: NMEA 0183 and 2000 multiplexer for Raspberry Pi

Quote:
Originally Posted by BjarneK View Post
I like the idea of finding a place where they could build the whole design instead of people having to do it themselves. Can they also program the PICs for you? What do they charge for putting it all together?
Charges are very reasonable, they have 600 or so standard surface mount components then there's a think it's $3 fee the change cartridge for the other thousands of smd components available.
https://support.jlcpcb.com/article/1...178.1585850621

Easyeda.com is a good design package as well. You'd need to flash the pics yourself though.
conachair is offline   Reply With Quote
Old 11-05-2020, 17:51   #8
cruiser

Join Date: Nov 2007
Location: Probably in an anchorage or a boatyard..
Boat: Ebbtide 33' steel cutter
Posts: 5,030
Re: NMEA 0183 and 2000 multiplexer for Raspberry Pi

My monitor board -
https://easyeda.com/editor#id=|9b753...5190814850862c
Mostly tested and working with an esp32 running python sending signalk data over wifi to a raspberry pi but haven't tested the rs232 yet.
conachair is offline   Reply With Quote
Old 12-05-2020, 09:03   #9
Registered User

Join Date: Nov 2017
Location: Portland, Oregon USA
Boat: Island Packet, Packet Cat 35
Posts: 973
Re: NMEA 0183 and 2000 multiplexer for Raspberry Pi

I am new to Pi, so new I've yet to buy my 1st one lol but that will change soon. Your project sounds awesome and being able to display engine data as well as tank data is perfect. If you need a "tester" to field test your design, instructions etc, please let me know.

Thanks for doing this.
Cpt Mark is offline   Reply With Quote
Old 12-05-2020, 09:56   #10
Registered User

Join Date: Jul 2017
Location: Póvoa de Varzim, Portugal
Posts: 37
Send a message via Skype™ to WhiteHill
Re: NMEA 0183 and 2000 multiplexer for Raspberry Pi

Quote:
Originally Posted by Cpt Mark View Post
I am new to Pi, so new I've yet to buy my 1st one lol but that will change soon. Your project sounds awesome and being able to display engine data as well as tank data is perfect. If you need a "tester" to field test your design, instructions etc, please let me know.

Thanks for doing this.
Me too. Please include me in any future advances. Thanks.
WhiteHill is offline   Reply With Quote
Old 12-05-2020, 10:19   #11
Registered User

Join Date: Dec 2019
Posts: 47
Re: NMEA 0183 and 2000 multiplexer for Raspberry Pi

Hi, I could be interested after looking at your layout using ESP32, I want and in a process to built a wifi system using ESP32 for acquiring data's and send to a tablet using OpenCPN. I have Raymarine ST4000+ witch I could control it with this and if defective bypass it to drive the motor directly. I program the ESP with Visuino witch is a visual programming software, so no need to be a C++ programmer.
JonathanX is offline   Reply With Quote
Old 12-05-2020, 16:24   #12
Registered User

Join Date: Jul 2016
Location: Waldron, WA
Boat: Cape Dory 25D
Posts: 36
Re: NMEA 0183 and 2000 multiplexer for Raspberry Pi

Quote:
Originally Posted by BjarneK View Post
A couple of years ago, I built an add-on board for a Rasperry Pi computer for receiving NMEA 0183 and NMEA 2000 data to the Raspberry Pi. It is in the form of a HAT board, i.e. a board that uses the 40 pin connector on the Pi and is the same size as the Pi, except shorter to leave room for the ethernet and USB connections on the Pi.

It has been working fine, but I have never gotten around to sharing the design. Right now I am stuck in Mexico, so finally got around to picking up the project again. I am redesigning the PCB and could use some input. The idea is to release the PCB information and microcontroller code to let anybody build it. Being stuck in Mexico has the downside that I cannot really order new parts, so this is not going to be done any time soon. But this may still be a good time to get some designs done.

The specification is that it can receive NMEA 0183 from eight independent channels, four at 38,400 bps and four at 4,800 bps. The 38,400 bps channels can individually be configured to 4,800 bps if needed. My prototype board actually has two NMEA 2000 channels, but I am planning on cutting that down to one. Few people have two independent NMEA 2000 networks. The reason I made two of these channels was that I have another network on the boat for tank levels and battery information that I think is CAN bus based, but I have never gotton around to hooking that up.

The price of the components add up to around 25-35 USD and a programmer for the PIC microcontroller will also be needed (35-40 USD). I will not be putting a lot of these boards together, so the idea is that people order parts, including the PCBs and start soldering. All component are through hole versions, so it is not difficult. People can get together in a group and build them together, saving on costs. The place I usually buy PCBs in China sell 10 PCBs for 10 USD (plus shipping), so there are advantages to making several units at once.

My first question is very general: Would you find something like this useful?

My next questions are more technical and are mostly for any electrical engineer types that may be reading this.

The eight NMEA 0813 input channels are optically isolated using HCPL2531 optocouplers with a diode for reverse voltage protection and a 2.2 kOhm resistor to limit the current. For 5 V talkers, this keeps the current below 2 mA which is the limit for a receiver according to the specification. For higher voltage talkers, the current will exceed this specification. A talker should be able to deliver 15 mA according to the standard and this has never given me any problems. Is it something that you would worry about?

The next question concerns the NMEA 2000 receiver. This is not optically isolated from the Raspberry Pi. It seems fairly normal to not isolate NMEA 2000 units, but most often they are powered from the NMEA 2000 network so it is not a problem. In the case of the Raspberry Pi, I prefer to power it using a 12 V to 5 V converter connected to the main battery. This converter has the same ground on the input and output, which means that the ground of the Raspberry Pi is the same as on the NMEA 2000 network. To avoid ground loops, I am not connecting these two grounds since they may be a little bit different in practice due to voltage drops in supply wires on the boat. I use the MCP2562 chip for the physical layer of the NMEA 2000 receiver and only connect the signal wires of the NMEA 2000 cable. The MCP2562 can accomodate ground differences up to 12 V in either direction and still function correctly. Differences of more than 50 V are needed to cause damage. Is this requirement of common ground on the Raspberry Pi and the NMEA 2000 network something you would worry about?

It is of course possible to solve these two electrical issues, but at the cost of a more expensive and more complicated board. I would not build a commercial product like this, but I do not worry about these issues on my own boat.

The final question is in regards to protecting the Raspberry Pi I/O pins. I use UART and SPI to communicate with the board. In my prototype, these communcation channels are connected directly to the PIC 16F1705 that handles the NMEA 0183 and to the MCP2515 that handles NMEA 2000. No problem, but it struct me that if I configure an I/O pin on the Pi to be an output and it is connected to an output from the ICs on the board, I may fry the Raspberry Pi. I figure that connecting a 2.2 kOhm resistor in series with each I/O of th Pi should solve this problem by limiting the current to around 2 mA. I don't think that this will hinder the communication. One could argue that this may not be necessary for the input pins on the MCP2515 since there should never really be a problem. If the PIC is programmed right, the same could be argued for the inputs on that. What do you think? My current thinking is to put a resistor on all the communication pins that I use, but it does take up some space on the PCB.
I have over half a century of experience as an electronic technician, electrical engineer, and software engineer, and I'd certainly be willing to work with you on this project. I have to wonder why you went for a Hat when you could just use RS-422 to USB and CAN to USB adapters plugged into the Rπ USB ports? That would allow you to graft on as many NMEA 0183 devices and NMEA 2000 networks as you needed.
Richv is offline   Reply With Quote
Old 12-05-2020, 16:32   #13
Registered User

Join Date: Apr 2013
Location: Manly, Qld, Aust
Boat: Fusion 40
Posts: 174
Re: NMEA 0183 and 2000 multiplexer for Raspberry Pi

Quote:
Originally Posted by conachair View Post
My monitor board -
https://easyeda.com/editor#id=|9b753...5190814850862c
Mostly tested and working with an esp32 running python sending signalk data over wifi to a raspberry pi but haven't tested the rs232 yet.
My current project has similar elements to yours and i am working with Arduino to do a monitoring and logging routine. Halfway there with most of it but the NMEA2000 has me stumped. Would love to get involved with this.
jacktheflyer is offline   Reply With Quote
Old 12-05-2020, 16:41   #14
Marine Service Provider

Join Date: Aug 2015
Location: Melbourne
Boat: Jenneau Prestige 46
Posts: 50
Send a message via Skype™ to desdestiny
Re: NMEA 0183 and 2000 multiplexer for Raspberry Pi

BjarneK
Count me in and please keep up the good work.
I have wbeen wanting to dabble in Pi for some time and have just purchased a package, however have not started.
I am a little daunted by the steep learning curve.
Can you provide me a link to the company in China from where you source your PCB?
desdestiny is offline   Reply With Quote
Old 12-05-2020, 17:31   #15
cruiser

Join Date: Nov 2007
Location: Probably in an anchorage or a boatyard..
Boat: Ebbtide 33' steel cutter
Posts: 5,030
Re: NMEA 0183 and 2000 multiplexer for Raspberry Pi

Quote:
Originally Posted by desdestiny View Post
I have wbeen wanting to dabble in Pi for some time and have just purchased a package, however have not started.
I am a little daunted by the steep learning curve.
Openplotter has changed all that, quick and easy to set up now.

https://openplotter.readthedocs.io/e...wnloading.html

Quote:
Can you provide me a link to the company in China from where you source your PCB?
I use these guys, great service, they solder surface mount components for you at a reasonable price >
https://jlcpcb.com/
Design the board here >
https://easyeda.com/

conachair is offline   Reply With Quote
Reply

Tags
nmea, nmea 0183


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a NMEA 2000 Chart Plotter to a NMEA 0183 Network SailingPNW Marine Electronics 28 26-04-2021 07:00
NMEA 2000 to NMEA 0183 Davidhoy Marine Electronics 26 13-12-2019 18:39
[SOLD] Shipmodul Miniplex-42BT NMEA-0183 multiplexer with Bluetooth s/v Jedi General Classifieds (no boats) 6 27-09-2016 19:42
For Sale: Raymarine NMEA-0183 Multiplexer NahanniV Classifieds Archive 11 27-03-2013 14:22
For Sale: NMEA-0183 Raymarine Multiplexer new $60 Ram Classifieds Archive 0 16-12-2009 08:59

Advertise Here


All times are GMT -7. The time now is 22:26.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.