Cariad SMS monitoring and control

The Story:

Inspired by the christmas tree watering project here's my current line of experimentation .....

We own a boat, an 11.6m benetteau Oceanis 390 called 'Cariad'

Basically she's used as a holiday destination and she's currently kept in Preveza, Greece.

One of the big challenges of this arrangement is making sure that A: She doesn't sink when left on a mooring ( not good for the interior woodwork, electronics etc ) and B: The batteries are kept in good condition.

Sometimes we don't get to visit her for 6 months at a time so lead-acid batteries left disconnected lose about 50% of their charge over that time. It's not good for the batteries and a new set costs several hundred Euros and it takes time and effort to repalce them. The boat has solar panels and a sophisticated solar panel regulator from Sunware.

Which is fine but in the middle of summer it can pump out 10 amps or more and if a battery has died 10 amps can get things very hot and could start a fire. The Shore power  charger can pump out 50 amps. A potential bomb with a dry battery connected! So monitoring Battery voltages for the house and engine batteries is required at the very least. Monitoring the shore power connection means that I can contact the marina to intervene if the power goes off during a particularly dark period of the winter or during long periods of bad weather.

Additionally if the temperature gets to around zero there is a possibility that water in the plumbing system, the toilets, sink drains etc may freeze and lead to either leaks or in the worst case sinking! High humidity leads to damp in the boat and may lead to mould on cushions etc ...... not pleasant and it destroys stuff. So being able to monitor temperature and humidity and control a frost heater and a de-humidifier would be good.

While we are at it it would be nice to know if someone tries to get aboard or if someone actually goes aboard when we ask them too! So monitoring an unassigned input would be a good idea.

A normal Bilge pump consists of one of these ....

connected to one of these like this

But i have previously thought about a much more sophisticated setup that will allow me to test the pump, make sure its running and report back if there's anything wrong. The mBed will allow me to do this. At the same time when I am on the boat i can rig a buzzer to tell me if the bilge is taking in water and I can monitor pump runs.

SMS

with the boat in Greece and me in the UK much of the time ........

the only logical solution for monitoring is SMS transfer of data and control.

Other Nice to haves:

While we are at it and with the power of the mBed available hooking up an SCP1000 barometric sensor and making the data, and more importantly the historic and trend data available seems like a good idea. When sailing the trend of the barometric pressure is possibly the most important input when doing weather forecasting.

On board we have a Navtex receiver that uses a particularly chronic piece of Java software to read the text information and display it on a PC. I'd like to read the unit and present the data on a web page served up by the mBed.

Specification

Hardware:The unit should provide:

Dual battery level measuring circuits sensing up to 30v for 24v system.

2 Input monitoring circuits - opto isolated. 1 circuit may be reassigned as a dedicated Bilge Pump level switch monitor.

2 or 3 output control circuits driving high current relays. One relay may be dedicated to driving the Bulge pump.

Communication:

The system should support bi-directional SMS messaging to send Alarms, Statii and configuration data and receive, control, configuration and other data.

Software:

The software must be able to run autonomously for long periods of time (12 months ) it should recover gracefully from power downs or resets.

Under user programmable configuration either via web interaction, usb port, external messaging of a plug in card it should be able to configure the following:

Basic monitoring modes.

  • Shore Power monitoring on or off
  • Battery 2 monitoring on or off
  • Bilge Pump ( Input 1 ) monitoring on or off
  • Input 2 monitoring on or off

Modes of operation

  • Input 2 triggers an intruder alarm
  • Output 2 act as as a frost heater control
  • Output 3 acts as a dehumidifier control
  • Smart bilge pump monitoring is enabled
  • Bilge pump causes a local alarm
  • IP 2 causes a local alarm

 

Alarms: What condition causes what alarm?

Bilge pump ( IP1 )

Input 2

Shore Power

 

Peripheral hardware selection:

MID400 - AC opto Isolator. A single digital input is used to monitor the state of the shore power mains.

SHT75 - Temperature and Humidity Sensor from Sensiron, I have published a library for its use here.

Teltonika Modem - as the SMS subsystem, I had a bunch of them lying around they are RS232 AT command driven, this will be replaced eventually, probably with the new unit from Sparkfun. ( thanks

SCP1000 - Barometric sensor - I had previously used the CSDX 0815 digital barometer sensor from Sensortechnics on Arduino based barometery sensing but the SCP1000 is simply much better!

The libraries in use:

 

 

Some challenges:

One of the things missing from the mBed is some form of EEprom or other nonvolotile storage (20 bytes in the RTC not nearly enough ). My project has a significant amount of configuration data so a solution needed to be found. The localfilesystem provides the perfect solution. Building a config file in plain text in the local file system means that the mBed can be configured from the PC using simple text tools and the mBed can parse and load it at reset time.

Progress ....

The Mbed gets you productive within an hour! Really a tremendous concept. My first venture into the Arm environment and I am blown away at the functionality/price/capacity proposition.

First thing to get connected was my Teltonika modem. standard serial IO and AT commands meand that I was writing code and able to test things early.

Translated my old SHT75 library across, published it and connected up a device. temperature and humidity up and running in an afternoon.

SCP1000 breakout board arrived and a couple of hours later I have pressure ability.

Attached a CF SD card connector to the SPI bus in parallel with the SCP1000 and within the hour I had a device that reads and writes FAT formatted files to a card that is transferrable to a PC now that's impressive!

Unfortunately my SCP1000 device aoppears to have died completely. Spent most of the weekend trying to get a response out of it but the MISO line remains unresponsive. Looks like its dead. Damn!

I purchased a Bilge-Mate electronic bilge switch this weekend. Testing it on the bench it detects water and turns on the pump ........ but never turns it off! Not a good weekend.

Hmm SCP is not dead. I went back to basics, wrote a simple test program, depowered the board and restarted and the sensor works OK. Looks like the SCP and the SD card dont want to be on the same SPI bus. - Off to the Forum for support.

Conflict between the SDcard and the SCP1000. ignoring it for the moment.

Relay driver circuit:

A BC337 and a resistor and the MBed drives high power relays adequately.

 

 

 


6 comments

05 Nov 2010

Sparkfun has a new GSM Module in the Shop: http://www.sparkfun.com/commerce/product_info.php?products_id=10138

05 Nov 2010

I am currently using a Teltonics unit ( I had a bunch of them lying around ) but I am looking at the new Sparkfun module for future use. looks neat.

14 Jan 2011
Why do not use a Liquid Level Sensor insted of the bilge switch? http://www.sparkfun.com/products/10221
14 Jan 2011

I have actually replaced the old Rule float switch with a fancy electronic device that is sealed and electronically isolated. It also switches up to 20 amps automatically so will continue to work if electronics go haywire or the software gets 'confused'.

The level sensor you proposed looks like a tremendous idea for other applications around the boat and I'm going to investigate the product further.

There are 3 fresh water tanks, a big diesel tank for the main engine and a small tank for heating kerosene, there are also 2 black water tanks ( toilet holding tanks ) and it would be nice to know the contents of each one.

Thanks for the tip.

24 Feb 2011
Take a look at http://openalerts.org/. Perhaps it is usefull for your project
24 Apr 2011

Not sure if you got anywhere with the scp1000 and sd conflict, but was having the same issues. Initially, the two libraries use different spi frequencies, so I edited both libraries to constantly make sure that before writing, the spi frequency is always set to the device-dependent frequency. I then added a short wait after the sd spi commands as I was running the SD at 10MHz.

All this seemed to fix the problem, although occasionally I have to repower the SCP1000, but that could be due to a dodgy SCLK connection.

 

As a simple test of communication, I always check the software revision number register which returns 0x03 on my device.

Hope that helps a bit!

Rob

You need to log in to post a comment