Cariad SMS monitoring and control
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.
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.
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.
The system should support bi-directional SMS messaging to send Alarms, Statii and configuration data and receive, control, configuration and other data.
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 )
Peripheral hardware selection:
MID400 - AC opto Isolator. A single digital input is used to monitor the state of the shore power mains.
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:
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.
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.
You need to log in to post a comment