My Raspberry Pi Boat Monitor

Forty_Two

Well-Known Member
Joined
23 Sep 2002
Messages
1,183
Location
La Napoule/Oxfordshire
Visit site
As some of you may know I built myself a boat monitoring system using an old Dell laptop running Linux with an Arduino (small microprocessor PCB) that gathers the data. This reports daily by text message giving me AC power and bilge pump status, 4 battery bank voltages, internal & external temps. It sends me text messages if anything changes or battery volts go above or below set limits. It also monitors the passerelle going up/down.

This has been a real success for me, especially when I had a small leak in Sept 2012! Our boat is in SoF so gives great confidence when back at home. This winter has seen 5 months of Up time with no reboots.

Anyway I had decided to build a new system using a Raspberry Pi which would get rid of the laptop & leave me with a single box solution. This is now installed replacing the old system.

As I was re-writing the software I took the opportunity to expand it somewhat. It now monitors both my bilge pumps separately, but even better I can run either by sending a text with the number of seconds to run. I also added a bilge depth sensor & a third temp sensor which covers the engine room.

If a pump runs or stops, the AC power goes off or on, the bilge water depth increases or decreases, the passerelle goes up or down I get an instant text with the precise time of the event. Same if a battery voltage or a temperature goes outside my set range - this is nice because after a power outage I can see the chargers going through their multistage charge routine before settling back to float.

I can request a status message that gives all the info by sending a text and can reset the time of my daily text as I wish. A reboot or power down can also be forced by text as well.

Finally I added a 3G dongle and the system uploads two files each day (using ftp) to some web space of mine. One is a log file which shows me exactly what my software has been doing and the other is a text file with a line written each minute containing the raw data from my sensors. I currently download these files to my Android phone to examine on a text editor but plan eventually to write an app to show graphs of battery volts, temps etc.

I use a Leclerc PAYG SIM in the phone that plugs into the Pi allowing it to send/receive texts. Costs 15 cents/ text to the UK so about 6 Euro/month, not bad for peace of mind. For the 3G Dongle I use a GymSim data SIM & as each upload is about 100Kb the cost is less than 3 cents/day, so again near enough free at about 1 Euro/mth.

I hope to eventually add some cameras & upload still images each day. Might even put one looking in the bilge for confidence – why not they are cheap enough.

I already have four tiny cameras looking at my four fuel tank sight glasses, which I use with a roving LCD monitor on deck when fuelling. Means I never overfill or underfill a tank & no embarrassing (or expensive) spills.

It’s been a fun project with a lot of new learning, good for my retired brain.

For those interested I used Python for the software on the Pi. I have one thread that monitors all the other threads & will reboot the Pi if a part of my software hangs for some reason & sends me a text showing which thread expired. I also have the Broadcom chip hardware watchdog running which will reboot if the Pi itself decides to become unresponsive.

I am using a high quality DC/DC convertor to provide the 5v from the house batteries 12v and have a small extractor fan running at about 50%, although there is very little heat generated in the box - mainly from the Pi’s 3.3v regulator & processor chip.

The Pi has two plug-in extra PCB’s, a real time clock & 8ch ADC for the analogue inputs, there is a seperate pcb with opto isolators & voltage dividers etc for the inputs. A 4 ch relay PCB controls the bilge pumps & powers up the 3G dongle when needed. There is also 4 line x 16 character display on my box so no need for a monitor under normal use. My software cycles the display through all the sensor data. The system just plugs into the boat through a couple of multipin connectors & uses the two Pi Usb’s for the phone and the 3G dongle. If I need to see more detail of what’s going on I can plug the analogue video out from the Pi into one of the TV’s on the boat.

I am staying away from the latest “bleeding edge” Pi firmware/software as it takes a few months for issues to be ironed out. I am currently using 3.6.11 #393 which is very stable and includes everything I need for my purposes. I did try the latest 3.10.19 #600 but didn’t get past three days before the system spontaneously rebooted itself.

Anyway I hope this makes interesting reading for a few folks, Paul

2014-02-09 13.31.48.jpg

20140129_103052.jpg
 
V.well done!

I remember a thread of yours discussing this some time ago.
I do have similar functionality from the BMS I've used in the boat and I'm v.happy with the fact that I can get an SMS when something happens and I can also monitor things remotely. When in the marina with the newly installed open municipality wifi, I could have internet access to the boat as well with nice graphics showing what's on and active, temps on the cabins, light levels, humidity etc :D

I feel that an modular package should be available to boaters (and they should be able to understand the benefits!)
raspberry, arduinos and all that are really so cheap and low in energy consumption that there's no excuse!

cheers

V.
 
Wow that's great going forty two. One of my sons is mad keen on the RPi and has shown me its potential

If you decide to production ise this ( not that you want to ruin your retirement!) please out me in the queue as a customer. What you have there is well ahead of any turnkey product and would be worth £1000 ish (not counting install)
 
Wow that's great going forty two. One of my sons is mad keen on the RPi and has shown me its potential

If you decide to production ise this ( not that you want to ruin your retirement!) please out me in the queue as a customer. What you have there is well ahead of any turnkey product and would be worth £1000 ish (not counting install)

oi you, don't give him such ideas re pricing!
:p

J, you could well be right, good thing with the h/w OP is using is that they are really cheap and robust. So a bit of decent programming (although python is probably not the best there is - but probably better than tcl used in my system...) and you're in for a decent 24/7 system with truly minimal energy consumption.
200-300quid would probably generate enough sales to ruin OP retirement, so maybe the 1K+ you're suggesting is better :p

cheers

V.
 
Very nice, indeed.

Don't suppose you could share what hardware you used for sensors, etc.?

We're working with a relay board in order to remotely activate stuff around the boat, but I'd also like to monitor things such as bilge pump, battery voltages, and temperatures.

Mrs is also a Python nut, I don't suppose you may be considering sharing your code? ;)
 
Very nice, indeed.

Don't suppose you could share what hardware you used for sensors, etc.?

We're working with a relay board in order to remotely activate stuff around the boat, but I'd also like to monitor things such as bilge pump, battery voltages, and temperatures.

Mrs is also a Python nut, I don't suppose you may be considering sharing your code? ;)

Yep +1 to this, I'm also interested to know how you interface the pi to the various devices you're monitoring. I also have a gsm monitor on the boat which keeps an eye on shorepower, but it would be great to expand this to more devices.
 
Yep +1 to this, I'm also interested to know how you interface the pi to the various devices you're monitoring. I also have a gsm monitor on the boat which keeps an eye on shorepower, but it would be great to expand this to more devices.

Jimmy,

OP mentions replacing the old DELL laptop with the Pi.
I guess the arduino remains there, picking up digital/analogue signals, processing them and sending them to the pi for further action. Same way you can signal events (that would most likely need to activate relays as current through an arduino board cannot be lots, but that's not an issue) in order to activate pumps, lights, you name it.

cheers

V.
 
Jimmy,

OP mentions replacing the old DELL laptop with the Pi.
I guess the arduino remains there, picking up digital/analogue signals, processing them and sending them to the pi for further action. Same way you can signal events (that would most likely need to activate relays as current through an arduino board cannot be lots, but that's not an issue) in order to activate pumps, lights, you name it.

cheers

V.

Hi Vas, yes, understood - but it would be v interesting to learn if there are better ways of monitoring. In my own case, I've got a normally-open relay connected to the shorepower, so when the shorepower fails, the relay closes, and the relay is connected to a simple contact-monitoring circuit on the gsm box.

But for bilge pumps, how do you do that? Some sort of dc current monitor? And what about the passerelle?

It's an excellent project by the op though - really impressed by the achievement.
 
Thanks all for the kind comments. Just had to visit the wife who is in hospital with an infection (all going well much praise for the nhs) so not ignoring you all.

JFM, love it that got my attention!

For those asking - no I got rid of the Arduino as I tried to keep it as simple as possible. The top plug in pcb in the picture is an 8 channel Analogue to digital convertor. I take fused feeds from each battery bank through resistors to drop to the adc range to of 0 - 2.

The Bilge sensor is an ASAP tank level sensor so that's just a variable resistor in effect so that's easy to measure. The Temp sensors are a 3 pin device, +5v, 0v & analogue out which again thru some resistors to get the volt range right & to the ADC.

To monitor Bilge pumps just the pump +12v to an opto isolator IC which also sorts the 12v to 3.3 Pi digital input. Same for Passerelle, just tap off the relays in the control box. AC just has a 240v relay feeding 12v to the opto isolator.

All the interfacing is on a good old fashioned veroboard - two 4ch opto isolator IC's, the various voltage dropper resisters & a few other odds & ends.

The relays driven by the Pi are rated at 10A but I use them to drive the large relays I had allready installed to operate my Bilge pumps. All done to minimise cable volt drops etc.

Blimy seems to be a bit of pent up demand out there, i must admit i have impressed myself with this project. When I have switched a Bilge Pump to run & get the text it does seem to impress folks. Sending a text & running a pump even More!
 
Thanks all for the kind comments. Just had to visit the wife who is in hospital with an infection (all going well much praise for the nhs) so not ignoring you all.

JFM, love it that got my attention!

For those asking - no I got rid of the Arduino as I tried to keep it as simple as possible. The top plug in pcb in the picture is an 8 channel Analogue to digital convertor. I take fused feeds from each battery bank through resistors to drop to the adc range to of 0 - 2.

The Bilge sensor is an ASAP tank level sensor so that's just a variable resistor in effect so that's easy to measure. The Temp sensors are a 3 pin device, +5v, 0v & analogue out which again thru some resistors to get the volt range right & to the ADC.

To monitor Bilge pumps just the pump +12v to an opto isolator IC which also sorts the 12v to 3.3 Pi digital input. Same for Passerelle, just tap off the relays in the control box. AC just has a 240v relay feeding 12v to the opto isolator.

All the interfacing is on a good old fashioned veroboard - two 4ch opto isolator IC's, the various voltage dropper resisters & a few other odds & ends.

The relays driven by the Pi are rated at 10A but I use them to drive the large relays I had allready installed to operate my Bilge pumps. All done to minimise cable volt drops etc.

Blimy seems to be a bit of pent up demand out there, i must admit i have impressed myself with this project. When I have switched a Bilge Pump to run & get the text it does seem to impress folks. Sending a text & running a pump even More!

Aha thanks. So the bilge pump warning will only work if you've got a separate float switch for your bilge pump? That makes sense. Unfortunately mine are the OE all-in-one units, although I could probably figure something out from the warning buzzer at the helm.

Are you using the 256mb Pi or the newer 512mb?

Also - you mention using a 3g dongle and also a phone for the texting; is any kind of 3g expansion card available for the Pi?
 
Aha thanks. So the bilge pump warning will only work if you've got a separate float switch for your bilge pump? That makes sense. Unfortunately mine are the OE all-in-one units, although I could probably figure something out from the warning buzzer at the helm.

Are you using the 256mb Pi or the newer 512mb?

Also - you mention using a 3g dongle and also a phone for the texting; is any kind of 3g expansion card available for the Pi?

Pi is 512 model b. You can use an Arduino gsm shield with a convertor shield, I used an old Nokia phone & an E3220 that I had lying about. 3G isn't really needed & I figured that an internal gsm module would be better for non geeks. Could also use a mifi & add wifi to Pi.

Yes you do need to be able to access the bilge pump motor +12v.

Example of today's text, managed to get it in one text message...

Tara Sun Feb 9 09:32:28 2014 AC On: Pump 1 Off: Pump 2 Off: Bilge 50mm: Batts- Hse 13.3v, Port 13.2v, Stbd 13.3v, Geny 13.2v: Temp In 22C, Ext 14C, Eng 20C:
 
Pi is 512 model b. You can use an Arduino gsm shield with a convertor shield, I used an old Nokia phone & an E3220 that I had lying about. 3G isn't really needed & I figured that an internal gsm module would be better for non geeks. Could also use a mifi & add wifi to Pi.

Yes you do need to be able to access the bilge pump motor +12v.

Example of today's text, managed to get it in one text message...

Tara Sun Feb 9 09:32:28 2014 AC On: Pump 1 Off: Pump 2 Off: Bilge 50mm: Batts- Hse 13.3v, Port 13.2v, Stbd 13.3v, Geny 13.2v: Temp In 22C, Ext 14C, Eng 20C:

That first word in your text should be Ta-rah!

I appreciate you might not want to do this if you're intending to develop this as a commercial offering, in which case fair enough - but otherwise as a leg-up to complete beginners like me could you give links to the ADC card you're using, and the temp sensors?
 
That first word in your text should be Ta-rah!

I appreciate you might not want to do this if you're intending to develop this as a commercial offering, in which case fair enough - but otherwise as a leg-up to complete beginners like me could you give links to the ADC card you're using, and the temp sensors?

Very Good!

ADC from these people http://www.abelectronics.co.uk/. I like these guys.

Temp sensor from Farnell AD22100KTZ.

I still have one digital input left on the Pi & one unused relay out which I haven't decided what to use for yet. I really want to freeze the software at the moment till I have seen it stable for a few months. It's around 1,500 lines at the moment.

Many folks have suggested, as you put it, i come up with a commercial offering & I don't rule it out because I know how comforting it is to have an idea of what's going on when the boat is so far away. It would need a fair bit of work to turn it from a project to a commercial proposition. Apart from the many license issues to sort, is the Pi & Python Right? A dedicated board running c++ would probably be more robust, but I am not about to get into C, I chose Python for its lack of brackets Lol!
 
Very Good!

ADC from these people http://www.abelectronics.co.uk/. I like these guys.

Temp sensor from Farnell AD22100KTZ.

I still have one digital input left on the Pi & one unused relay out which I haven't decided what to use for yet. I really want to freeze the software at the moment till I have seen it stable for a few months. It's around 1,500 lines at the moment.

Many folks have suggested, as you put it, i come up with a commercial offering & I don't rule it out because I know how comforting it is to have an idea of what's going on when the boat is so far away. It would need a fair bit of work to turn it from a project to a commercial proposition. Apart from the many license issues to sort, is the Pi & Python Right? A dedicated board running c++ would probably be more robust, but I am not about to get into C, I chose Python for its lack of brackets Lol!

Input: microswitch on your saloon door?
Output: heat or aircon activation? I have web control over the central heating at home and it's v useful when you've been away and you want to warm the place up ready for your return
 
Top