Raspberry Pi Boat Monitoring

May 17, 2004
5,633
Beneteau Oceanis 37 Havre de Grace
Over the last few years I’ve been tinkering to build and expand a way to monitor my boat with an onboard Raspberry Pi computer. A few times I’ve mentioned the types of data I get from it and a couple people have asked for more details. I’ve made some progress documenting the code and the setup to give people ideas on how they could go about something similar.

All of the code, some architecture diagrams, and a full explanation are now at

The Readme file provides a more complete write-up, but some of the features I have are:
  • Bilge pump monitoring
  • Sensors to read things like battery voltages, battery current, cabin and engine temperatures, engine RPM’s, cabin VOC’s and heel angle
  • Logging all NMEA and sensor data for later review
  • Making all of the data available in dashboards to view from anywhere
  • Sending email alerts if parameters go out of tolerances
  • Making the sensor data available on the boat’s NMEA network for display on the chartplotter
Some screenshots of the types of dashboards I can see on my phone:

1658575759978.png


1658579675938.png


And an example of having the data on my chartplotter:
1658579775971.jpeg


Let me know if you have questions or any suggestions to improve the write-up or design.
 

walt

.
Jun 1, 2007
3,541
Macgregor 26S Hobie TI Ridgway Colorado
Over my head. but I know just enough to be impressed!

I am curious about the sample rate you are doing for the current measurement. I have a now more than 10 year old battery monitor and Im pretty sure it samples current from a shunt considerably faster than 1Khz, maybe at least 10Khz.
 

Tedd

.
Jul 25, 2013
777
TES 246 Versus Bowser, BC
Fantastic! I was planning to make a similar system for our new boat, but perhaps I'll just leverage yours?

What's involved in tying into the NMEA bus?

[Ah, I see it's basically an implementation of CANbus. So, connecting is similar to connecting to a CANbus network?]
 
Last edited:
May 17, 2004
5,633
Beneteau Oceanis 37 Havre de Grace
I am curious about the sample rate you are doing for the current measurement. I have a now more than 10 year old battery monitor and Im pretty sure it samples current from a shunt considerably faster than 1Khz, maybe at least 10Khz.
I’m pulling the shunt measurements once per second for the logging and presentation. The State of Charge calculation is done by a Victron Smart Shunt. I don’t know what frequency it polls the amperage at to do its calculations. Most of the DC loads are constant enough that I would think 1 or maybe 10 HZ would be adequate for tracking SOC accurately.
 
May 17, 2004
5,633
Beneteau Oceanis 37 Havre de Grace
What's involved in tying into the NMEA bus?
I have a Yacht Devices USB to NMEA 2000 adapter. The adapter just plugs into the Pi and the NMEA2k network. SignalK on the Pi has plug-ins to ingest the NMEA2K data and to output specific sentences back onto the network. The chartplotter sees the Yacht Devices adapter as a data source and shows the sentences it’s providing.

An NMEA 0183 can be easier to deal with, since the protocol’s been around longer and is better reverse engineered. Hardware to talk to that is a little cheaper. But the sentences that can be sent are a little more limited.
 
May 17, 2004
5,633
Beneteau Oceanis 37 Havre de Grace
Thanks, @Davidasailor26 ! I have a little bit of experience working with CANbus networks that I hope will help in learning NMEA.
There are other hats you can get for the Pi for NMEA connectivity at a slightly lower cost than the Yacht Devices adapter. It’s just a little more DIY than the USB option but probably not too bad, especially with some canbus experience.
 

walt

.
Jun 1, 2007
3,541
Macgregor 26S Hobie TI Ridgway Colorado
Victron Smart Shunt.
Aha.. There are some current pulses that are fairly fast such as trying to measure the DC current into an inverter because these generally have a DC side current spike near the peak voltage of the AC cycles (best for efficiency) or the current pulsing from an outboard each time a magnet goes by the stator coil. I looked up the smart shunt, its basically a battery monitor without a display.
 
Last edited:
Jun 23, 2019
1
S2 8.5 Haverstraw
You can give a try to BBN Marine OS. There are more options for monitoring dashboards. Via NodeRed, SignalK, Grafana, or HomeAssistant.


There are plenty of articles on integrating Victron with HomeAssistant

Thanks
 
May 17, 2004
5,633
Beneteau Oceanis 37 Havre de Grace
You can give a try to BBN Marine OS. There are more options for monitoring dashboards. Via NodeRed, SignalK, Grafana, or HomeAssistant.


There are plenty of articles on integrating Victron with HomeAssistant

Thanks
BBN OS is definitely worth checking out. I didn’t know about the Victron HomeAssistant integrations. Both are pretty interesting depending on what your exact needs are.
 
Dec 4, 2023
138
Hunter 44 Portsmouth
Hi @Davidasailor - where are you currently at with the monitoring system? This thread came up on a Google search for me.

Great work!
 
Jan 7, 2011
5,534
Oday 322 East Chicago, IN
I bought a pican M hat for my RPI 4b last year and have it connected to the NMEA2k network on my boat.

I am running OpenCPN, and SignalK right now.

What I don’t have are. Lot of sensors other than my N2K network (wind, depth, speed, etc). I would love to get more sensors installed, but haven’t gotten them yet.

A list of sensors and how you installed them would be helpful. Also, how do you power your Pi…

I am using a couple of 5v buck converters with USB connections. Works OK, but I hate leaving my ChartPlotter on for the N2K connection and data when I am not there. Ut if I want to monitor wind, etc, they have to be on.


Greg
 

Attachments

Sep 24, 2018
3,369
Catalina 30 MKIII Chicago
I bought a pican M hat for my RPI 4b last year and have it connected to the NMEA2k network on my boat.

I am running OpenCPN, and SignalK right now.

What I don’t have are. Lot of sensors other than my N2K network (wind, depth, speed, etc). I would love to get more sensors installed, but haven’t gotten them yet.

A list of sensors and how you installed them would be helpful. Also, how do you power your Pi…

I am using a couple of 5v buck converters with USB connections. Works OK, but I hate leaving my ChartPlotter on for the N2K connection and data when I am not there. Ut if I want to monitor wind, etc, they have to be on.


Greg
How reliable has this system been so far?
 
May 17, 2004
5,633
Beneteau Oceanis 37 Havre de Grace
Hi @Davidasailor - where are you currently at with the monitoring system? This thread came up on a Google search for me.

Great work!
Thank you! It’s continued to chug along without any serious updates needed. The microcontroller I had getting refrigerator temperature did rust out from condensate. It was in a 3D printed but not waterproof box. I replaced it with a Govee thermometer, and I added some code to read that data via Bluetooth LE. I should probably push that data up to the repo; haven’t done that yet.

I’ve found that the influx database running on the Pi gets too heavy after about a season of data. That seems to cause memory shortages and the system bogs down. Each winter I export the data to a separate influx database running at home so I can point dashboards there if I want to see it. With that everything’s continued running well for several years.
 
Jan 7, 2011
5,534
Oday 322 East Chicago, IN
How reliable has this system been so far?
I wouldn’t use that solely at this point, and really I am only using it as a “repeater” down below. But I can use OpenCPN for route planning, AIS ID, etc. I guess I can also use the Pi as a server so I can view info on my iPad Or phone. But I haven’t tried that.

But my whole RPI system relies on the N2K network. So that needs to stay on if I want to access the data from the Pi.

Greg
 
May 17, 2004
5,633
Beneteau Oceanis 37 Havre de Grace
I bought a pican M hat for my RPI 4b last year and have it connected to the NMEA2k network on my boat.

I am running OpenCPN, and SignalK right now.

What I don’t have are. Lot of sensors other than my N2K network (wind, depth, speed, etc). I would love to get more sensors installed, but haven’t gotten them yet.

A list of sensors and how you installed them would be helpful. Also, how do you power your Pi…

I am using a couple of 5v buck converters with USB connections. Works OK, but I hate leaving my ChartPlotter on for the N2K connection and data when I am not there. Ut if I want to monitor wind, etc, they have to be on.


Greg
Nice! It would be nice to have wind monitoring at least some times, but I don’t leave all the electronics on for that either. It might be interesting to have the Pi control a relay to power just the NMEA bus on demand, so the anemometer could be powered and send its data to the pi, leaving the plotter itself off.
 
Jan 7, 2011
5,534
Oday 322 East Chicago, IN
I tried BBN this year and found it had LOTS of functions, but I could not get my Pican-M NMEA hat to work, and OpenCPN would not work correctly.

There are some things I don’t like in OpenPlotter, but I can live with.

I am just scratching the surface with the Pi’s functionality.
 
  • Like
Likes: jssailem